splineIK.utils.curve module

splineIK.utils.curve.convertToBezierCurve(curve)

Check if the parsed curve is a bezier curve, if this is not the case convert the curve to a bezier curve.

Parameters:curve (str) – Name of curve
splineIK.utils.curve.createCurveShape(name, points)

Create a curve and rename the shapes to be unique.

Parameters:
  • name (str) – Name of curve
  • points (list) – List of points.
splineIK.utils.curve.createFollicle(name, curve, parameter, forwardDirection='z', upDirection='y', overrideNormal=None, subtractPositionFromNormal=False)

Create a follicle on a curve. The name will be used for the creation of all of the nodes. The overrideNormal attribute can be used if the up vector needs to be any different then what the curve can provide, this can be the translation attribute of a transform. The subtractPositionFromNormal can be used of the normal parsed is in world space, this means that the normal will be converted to local space.

Parameters:
  • name (str) –
  • curve (str) – curve to attach follicle too
  • parameter (float) – parameter on curve between 0-1
  • forwardDirection (str) – (“x”, “y”, “z”), default “z”
  • upDirection (str) – (“x”, “y”, “z”), default “y”
  • overrideNormal (str) – override normal connection, (eg. translate)
  • subtractPositionFromNormal (bool) – subtract the position from the normal
Returns:

locator, pointOnCurve, aimConstraint

Return type:

tuple

splineIK.utils.curve.nearestPointOnCurve(curve, pos)

Find the nearest point on a curve, the function will return the parameter and point. The point is of type OpenMaya.MPoint.

Parameters:
  • curve (str) –
  • pos (list) –
Returns:

parameter, point

Return type:

float, OpenMaya.MPoint

splineIK.utils.curve.numCVs(curve)

Get the number of CVs of a curve.

Parameters:curve
Returns:number of cvs
Return type:int
splineIK.utils.curve.parameterLength(curve)

Return the parameter length of a curve.

Parameters:curve (str) –
Returns:parameter length or curve
Return type:float
splineIK.utils.curve.splitCurveToParametersByLength(curve, num)

Get a list of parameters evenly spaced along a curve, based on the length of the curve. Ranges are normalizes to be between 0-1.

Parameters:
  • curve (str) –
  • num (int) –
Returns:

parameters

Return type:

list

splineIK.utils.curve.splitCurveToParametersByParameter(curve, num)

Get a list of parameters evenly spaced along a curve, based on the division of its parameters. Ranges are normalizes to be between 0-1.

Parameters:
  • curve (str) –
  • num (int) –
Returns:

parameters

Return type:

list