ParametricParam

Inherits Param

Synopsis

A parametric param represents one or more parametric functions as curves. See detailed explanation below.

Functions

Detailed Description

../../../_images/parametricParam.png

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:
  • dimensionint
  • keyfloat
  • valuefloat
  • interpolationKeyFrameTypeEnum
Return type:

StatusEnum

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:
  • dimensionint
  • keyfloat
  • valuefloat
  • leftDerivativefloat
  • rightDerivativefloat
  • interpolationKeyFrameTypeEnum
Return type:

StatusEnum

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:dimensionint
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:
  • dimensionint
  • nthCtlint
Return type:

StatusEnum

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:dimensionColorTuple

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:dimensionint
Return type:int

Returns the number of control points of the curve at the given dimension.

NatronEngine.ParametricParam.getNthControlPoint(dimension, nthCtl)
Parameters:
  • dimensionint
  • nthCtlint
Return type:

tuple

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:

[status: StatusEnum, key : float, value: float, left derivative: float, right derivative: float]

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:
  • dimensionint
  • parametricPositiondouble
Return type:

double

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:
  • dimensionint
  • rfloat
  • gfloat
  • bfloat

Set the color of the curve at the given dimension.

NatronEngine.ParametricParam.setNthControlPoint(dimension, nthCtl, key, value, leftDerivative, rightDerivative)
Parameters:
  • dimensionint
  • nthCtlint
  • keyfloat
  • valuefloat
  • leftDerivativefloat
  • rightDerivativefloat
Return type:

StatusEnum

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:
Return type:

StatusEnum

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.