ParametricParam¶
Inherits Param
Synopsis¶
A parametric param represents one or more parametric functions as curves. See detailed explanation below.
Functions¶
- def
addControlPoint
(dimension, key, value[,interpolation=NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeSmooth]) - def
addControlPoint
(dimension, key, value, leftDerivative, rightDerivative, [,interpolation=NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeSmooth]) - def
deleteAllControlPoints
(dimension) - def
deleteControlPoint
(dimension, nthCtl) - def
getCurveColor
(dimension) - def
getNControlPoints
(dimension) - def
getNthControlPoint
(dimension, nthCtl) - def
getValue
(dimension, parametricPosition) - def
setCurveColor
(dimension, r, g, b) - def
setNthControlPoint
(dimension, nthCtl, key, value, leftDerivative, rightDerivative) - def
setNthControlPointInterpolation
(dimension, nthCtl, interpolation) - def :meth: setDefaultCurvesFromCurrentCurves<NatronEngine.ParametricParam.setDefaultCurvesFromCurrentCurves> ()
Detailed Description¶
A parametric parameter has as many dimensions as there are curves. Currently the number of
curves is static and you may only specify the number of curves via the nbCurves argument
of the createParametricParam(name,label,nbCurves)
function.
Parametric curves work almost the same way that animation curves do: you can add control points and remove them.
You can peak the value of the curve at a special parametric position with the getValue(dimension,parametricPosition)
function. The parametric position is represented by the X axis on the graphical user interface.
Member functions description¶
-
NatronEngine.ParametricParam.
addControlPoint
(dimension, key, value[, interpolation=NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeSmooth])¶ Parameters: - dimension –
int
- key –
float
- value –
float
- interpolation –
KeyFrameTypeEnum
Return type: - dimension –
Attempts to add a new control point to the curve at the given dimension. The new point will have the coordinate (key,value). This function returns a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
addControlPoint
(dimension, key, value, leftDerivative, rightDerivative[, interpolation=NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeSmooth]) Parameters: - dimension –
int
- key –
float
- value –
float
- leftDerivative –
float
- rightDerivative –
float
- interpolation –
KeyFrameTypeEnum
Return type: - dimension –
Attempts to add a new control point to the curve at the given dimension. The new point will have the coordinate (key,value) and the derivatives (leftDerivative, rightDerivative). This function returns a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
deleteAllControlPoints
(dimension)¶ Parameters: dimension – int
Return type: StatusEnum
Removes all control points of the curve at the given dimension. This function returns a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
deleteControlPoint
(dimension, nthCtl)¶ Parameters: - dimension –
int
- nthCtl –
int
Return type: - dimension –
Attempts to remove the nth control point (sorted in increasing X order) of the parametric curve at the given dimension.
This function returns a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
getCurveColor
(dimension)¶ Parameters: dimension – ColorTuple
Returns a ColorTuple with the [R,G,B] color of the parametric curve at the given dimension on the graphical user interface.
-
NatronEngine.ParametricParam.
getNControlPoints
(dimension)¶ Parameters: dimension – int
Return type: int
Returns the number of control points of the curve at the given dimension.
-
NatronEngine.ParametricParam.
getNthControlPoint
(dimension, nthCtl)¶ Parameters: - dimension –
int
- nthCtl –
int
Return type: tuple
- dimension –
Returns a tuple containing information about the nth control point (sorted by increasing X order) control point of the curve at the given dimension. The tuple is composed of 5 members:
This function returns in the status a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
getValue
(dimension, parametricPosition)¶ Parameters: - dimension –
int
- parametricPosition –
double
Return type: double
- dimension –
Returns the Y value of the curve at the given parametricPosition (on the X axis) of the curve at the given dimension.
-
NatronEngine.ParametricParam.
setCurveColor
(dimension, r, g, b)¶ Parameters: - dimension –
int
- r –
float
- g –
float
- b –
float
- dimension –
Set the color of the curve at the given dimension.
-
NatronEngine.ParametricParam.
setNthControlPoint
(dimension, nthCtl, key, value, leftDerivative, rightDerivative)¶ Parameters: - dimension –
int
- nthCtl –
int
- key –
float
- value –
float
- leftDerivative –
float
- rightDerivative –
float
Return type: - dimension –
Set the value of an existing control point on the curve at the given dimension. The nthCtl parameter is the (zero based) index of the control point (by increasing X order). The point will be placed at the coordinates defined by (key,value) and will have the derivatives given by leftDerivative and rightDerivatives.
This function returns a NatronEngine.Natron.StatusEnum.eStatusOK upon success, otherwise NatronEngine.Natron.StatusEnum.eStatusFailed is returned upon failure.
-
NatronEngine.ParametricParam.
setNthControlPointInterpolation
(dimension, nthCtl, interpolation)¶ Parameters: - dimension –
int
- nthCtl –
int
- interpolation –
KeyFrameTypeEnum
Return type: - dimension –
Set the interpolation type of the curve surrounding the control point at the given index nthCtl.
-
NatronEngine.ParametricParam.
setDefaultCurvesFromCurrentCurves
()¶
Set the default curves of the parameter from the current state of the curves. The default state will be used when the parameter is restored to default.