paya.runtime.plugs.NurbsCurve#

class NurbsCurve(*args, **kwargs)#

Inheritance

Geometry Attribute Attribute PyNode ProxyUnicode

classmethod createArc(*points, directionVector=None, radius=1.0, toggleArc=False, sections=8, degree=3, guard=None)#
Parameters
  • points (tuple, list, Point, Vector) – two or three points, packed or unpacked

  • directionVector/dv (None, tuple, list, Vector, Vector) – on two-point arcs this defaults to [0, 0, 1] (Z) and defines the arc’s ‘normal’; on three point arcs it must be provided explicitly if ‘guard’ is requested, and it is used to jitter the input points to avoid Maya errors

  • radius/r (float, Math1D) – for two-point arcs only: the arc radius; defaults to 1.0

  • toggleArc/tac (bool) – for two-point arcs only: draw the arc on the outside; defaults to False

  • sections/s (int, Math1D) – the number of arc sections; defaults to 8

  • degree/d (int, Math1D) – the arc degree; defaults to 3

  • guard (bool) – for three-point arcs only: prevent the arc from disappearing with an error when the input points are collinear; defaults to True if directionVector was provided, otherwise False.

Returns

An output for a circular arc.

Return type

NurbsCurve

classmethod createLine(startPoint, endPoint, degree=None, numCVs=None)#
Parameters
  • startPoint (tuple, list, str, Math1D) – the start point of the line

  • startPoint – the end point of the line

  • degree/d – the curve degree; if omitted, it is automatically derived from ‘numCVs’; if ‘numCVs’ is also omitted, defaults to 1

  • numCVs/cvs (int) – the number of CVs; if omitted, it is automatically derived from ‘degree’; if ‘degree’ is also omitted, defaults to 2

Returns

A curve output for a straight line.

Return type

NurbsCurve

createShape(dispCV=True, **kwargs)#

Overloads paya.runtime.plugs.Geometry.createShape() to add the dispCV/dcv argument.

Parameters
Returns

The generated shape.

Return type

NurbsCurve

_resolveNumberFractionsOrParams(numberFractionsOrParams, parametric=False, uniform=False)#

Utility method. Resolves the numberFractionsOrParams argument on distribution methods into a list of fractions or parameters.

If numberFractionsOrParams is a list, it will merely be conformed and passed back. Otherwise, the return will always be values, not plugs.

Parameters
  • numberFractionsOrParams (float, [float | Math1D]) –

    one of:

    • a single integer value, specifying how many fraction or parameter values to return, or

    • a user list of fractions or parameters, which can be values or plugs

  • parametric/par (bool) – if numberFractionsOrParams is a number, generate parameters, not fractions; defaults to False

  • uniform/uni (bool) – if generating parameters, distribute them by length, not parametric space; defaults to False

Returns

If ‘parametric’ is True, a list of parameters; otherwise, a list of fractions.

Return type

[float, Math1D]

initNearestPointOnCurve(point, reuse=True)#

Initialises a nearestPointOnCurve node.

Parameters
  • point (tuple, list, str, Point, Vector) – the reference point

  • reuse/re (bool) – where available, retrieve any already-connected node with the same configuration; defaults to True

Returns

The nearestPointOnCurve node.

Return type

NearestPointOnCurve

numCVs()#

This is a static-only operation.

Returns

The number of CVs on this curve.

Return type

int

numSpans()#

This is a static-only operation.

Returns

The number of spans on this curve.

Return type

int

findExistingInfoNode()#
Returns

The first curveInfo node connected to this curve, or None.

Return type

None | paya.runtime.nodes.CurveInfo

info(reuse=True, plug=False)#
Parameters
  • reuse/re (bool) – where available, retrieve an already-connected node; defaults to True

  • plug/p (bool) – return a curveInfo node rather than information in a dict; defaults to False

Returns

If plug is True, a curveInfo node; otherwise, a dictionary with the following keys: 'arcLength', 'controlPoints', 'knots'

Return type

dict | paya.runtime.nodes.CurveInfo

length(plug=False)#

If plug is False, a temporary curveInfo node will be used instead of maya.OpenMaya.MFnNurbsCurve.length() to ensure correct space management.

This method will always use a :param bool plug/p: return a plug, not just a value; defaults

to False

Returns

The length of this curve.

Return type

float | Math1D

getKnots(plug=False)#
Parameters

plug/p – return the knots array of a curveInfo node, not just a list of values; defaults to False

Returns

[int] | [paya.runtime.plugs.Math1D]

motionPath(**config)#

Creates a motionPath node and connects it to this curve. All other configuration is performed via config.

Parameters

**config – a source: plug mapping to configure the node’s attributes; sources can be plugs or values

Returns

The motionPath node.

Return type

MotionPath

motionPathAtParam(param, **config)#

Creates a motionPath and hooks it up to the specified parameter. All other configuration is performed via **config*. Flags uValue and fractionMode will always be overriden.

Parameters
  • param – the parameter at which to create the motionPath node

  • **config – a source: plug mapping to configure the node’s attributes; sources can be plugs or values

Rtype param

float, Math1D

Returns

The motionPath node.

Return type

MotionPath

motionPathAtFraction(fraction, **config)#

Creates a motionPath and hooks it up to the specified fraction. All other configuration is performed via **config*. Flags uValue and fractionMode will always be overriden.

Parameters
  • fraction – the fraction at which to create the motionPath node

  • **config – a source: plug mapping to configure the node’s attributes; sources can be plugs or values

Rtype fraction

float, Math1D

Returns

The motionPath node.

Return type

MotionPath

infoAtParam(param, reuse=True, plug=None, turnOnPercentage=False)#
Parameters
  • param (float, Math1D) – the curve parameter to inspect

  • turnOnPercentage/top (bool) – per the namesake attribute on pointOnCurveInfo, interpret param a percentage ratio within parametric space (note that this is not the same as fractionMode on motion paths; defaults to False

  • reuse/re (bool) – if plug is True, reuse any matching pointOnCurveInfo nodes; defaults to True

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

return a

pointOnCurveInfo node rather than a dictonary of values; default is auto-configured based on arguments

Returns

If plug is True, a pointOnCurveInfo node; otherwise, a dictionary with the followingk keys: 'position', 'tangent', 'normalizedTangent', 'normal', 'normalizedNormal'

Return type

PointOnCurveInfo, dict

getControlVerts(plug=False)#
Parameters

plug/p (bool) – return plugs rather than values; defaults to False

Returns

The members of the controlPoints info array for this curve.

Return type

[Vector], [Point]

getControlVert(cvIndex, plug=False)#
Alias

pointAtCV

Parameters
  • cvIndex (int) – the index of the CV to inspect

  • plug/p (bool) – return a plug, not just a value; defaults to False

Returns

The position of the specified CV.

pointAt(paramOrFraction, parametric=True, plug=None)#

Dispatches pointAtParam() if parametric=True, otherwise pointAtFraction().

Parameters

parametric/par (bool) – interpret paramOrFraction as a U parameter rather than a length fraction; defaults to False

pointAtParam(param, plug=None)#
Parameters
  • param (float, Math1D) – the parameter to sample

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A point at the specified parameter.

Return type

Point, Vector

pointAtLength(length, plug=None)#
Parameters
  • length (float, Math1D) – the length to sample

  • plug/p (bool) – return a plug, not a value; if False, param must be a value; defaults to False

Returns

A point at the specified length.

Return type

Vector

pointAtFraction(fraction, plug=None)#
Parameters
  • fraction (float, Math1D) – the fraction to sample

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A point at the specified fraction.

Return type

Vector

nearestPoint(refPoint, plug=None)#
Parameters
  • refPoint (tuple, list, str, Vector) – the reference point

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The closest point on this curve to refPoint.

Return type

Vector

distributePoints(numberFractionsOrParams, parametric=False, uniform=False, plug=None)#
Parameters
  • numberFractionsOrParams

    one of:

    • a single integer value, specifying how many fraction or parameter values to return, or

    • a user list of fractions or parameters, which can be values or plugs

  • parametric/par (bool) – if numberFractionsOrParams is a number, generate parameters, not fractions; defaults to False

  • uniform/uni (bool) – if generating parameters, distribute them by length, not parametric space; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A list of point values or plugs.

Return type

[Point | Vector]

paramAtStart(plug=False)#
Parameters

plug/p (bool) – return plugs, not values; defaults to False

Returns

The parameter at the start of this curve.

Return type

float, Math1D

paramAtEnd(plug=False)#
Parameters

plug/p (bool) – return plugs, not values; defaults to False

Returns

The parameter at the end of this curve.

Return type

float, Math1D

knotDomain(plug=False)#
Parameters

plug/p (bool) – return plugs, not values; defaults to False

Returns

The min and max U parameters on this curve.

Return type

(float | Math1D, float | Math1D)

paramAtPoint(point, plug=None)#

This is a ‘forgiving’ implementation, and uses the closest point.

Alias

nearestParam

Parameters
  • point (tuple, list, str, Vector, Point) – the reference point

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The nearest parameter to the reference point.

Return type

float, Math1D

paramAtFraction(fraction, plug=None)#
Parameters
  • fraction (float, Math1D) – the fraction to sample

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The parameter at the given fraction.

Return type

float, Math1D

paramAtLength(length, plug=None)#
Parameters
  • length (float, Math1D) – the length at which to sample a parameter

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The parameter at the given length.

Return type

float, Math1D

distributeParams(numberFractionsOrParams, parametric=False, uniform=False, plug=None)#
Parameters
  • numberFractionsOrParams (float, [float | Math1D]) –

    one of:

    • a single integer value, specifying how many fraction or parameter values to return, or

    • a user list of fractions or parameters, which can be values or plugs

  • parametric/par (bool) – if numberFractionsOrParams is a number, generate parameters, not fractions; defaults to False

  • uniform/uni (bool) – if generating parameters, distribute them by length, not parametric space; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A list of parameter plugs or values.

Return type

[float | Math1D]

lengthAtFraction(fraction, plug=None)#
Parameters
  • fraction (float, Math1D) – the fraction to inspect

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The curve length at the specified fraction.

Return type

float | Math1D

lengthAtParam(param, plug=None, checkDomain=True)#

Differs from the PyMEl / API findLengthFromParam() in that it returns properly-spaced curve lengths.

Parameters
  • param (float, Math1D) – the parameter to inspect

  • checkDomain/cd (bool) – perform gating against the current curve knot domain to prevent sampling errors at the very start or end of the curve; defaults to True

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The curve length at the specified parameter.

Return type

Math1D

lengthAtPoint(point, plug=None)#

This is a ‘forgiving’ implementation, and uses the closest point.

Parameters
  • point (tuple, list, str, Point, Vector) – the point to inspect

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The curve length at the specified point.

Return type

Math1D

distributeLengths(numberFractionsOrParams, parametric=False, uniform=False, plug=None)#
Parameters
  • numberFractionsOrParams (float, [float | Math1D]) –

    one of:

    • a single integer value, specifying how many fraction or parameter values to return, or

    • a user list of fractions or parameters, which can be values or plugs

  • parametric/par (bool) – if numberFractionsOrParams is a number, generate parameters, not fractions; defaults to False

  • uniform/uni (bool) – if generating parameters, distribute them by length, not parametric space; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A list of lengths.

Return type

[float | Math1D]

fractionAtPoint(point, plug=None)#

This is a ‘forgiving’ implementation, and uses the closest point.

Parameters
  • point (tuple, list, str, Point, Vector) – the point at which to sample a fraction

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The length fraction at the specified point.

Return type

float | Math1D

fractionAtParam(param, plug=None)#
Parameters
  • param (float, str, Math1D) – the parameter at which to sample a fraction

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The length fraction at the specified parameter.

Return type

float | Math1D

fractionAtLength(length, plug=None)#
Parameters
  • length (float, str, Math1D) – the length at which to sample a fraction

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The length fraction at the specified length.

Return type

float | Math1D

distributeFractions(number)#

Convenience method. Equivalent to floatRange(0, 1, number).

Parameters

number (int) – the number of fractions to generate

Returns

A uniform list of fractions.

Return type

[float]

normalAtParam(param, normalize=False, plug=None)#
Parameters
  • param (float, Math1D) – the parameter at which to sample the normal

  • normalize/nr (bool) – return the normalized normal; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

normalAtFraction(fraction, normalize=False, plug=None)#
Parameters
  • fraction – the fraction at which to sample the normal

  • normalize/nr (bool) – return the normalized normal; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

normalAtLength(length, normalize=False, plug=None)#
Parameters
  • length – the length at which to sample the normal

  • normalize/nr (bool) – return the normalized normal; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

normalAtPoint(point, normalize=False, plug=None)#
Parameters
  • point (tuple, list, str, Vector, Point) – the point at which to sample the normal

  • normalize/nr (bool) – return the normalized normal; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

tangentAtParam(param, normalize=False, plug=None)#
Parameters
  • param (float, Math1D) – the parameter at which to sample the tangent

  • normalize/nr (bool) – return the normalized tangent; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

tangentAtFraction(fraction, normalize=False, plug=None)#
Parameters
  • fraction (float, Math1D) – the fraction at which to sample the tangent

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • normalize/nr (bool) – normalize the output vector; defaults to False

Returns

The sampled vector.

Return type

Vector, Vector

tangentAtLength(length, normalize=False, plug=None)#
Parameters
  • length (float, Math1D) – the length at which to sample the tangent

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • normalize/nr (bool) – normalize the output vector; defaults to False

Returns

The sampled vector.

Return type

Vector, Vector

tangentAtPoint(point, normalize=False, plug=None)#
Parameters
  • point (list, tuple, str, Point, Vector) – the point at which to sample the normals

  • normalize/nr (bool) – normalize the output vector; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

The sampled vector.

Return type

Vector, Vector

distributeTangents(numberFractionsOrParams, plug=None, normalize=False, parametric=False, uniform=True)#
Parameters
  • numberFractionsOrParams

    this should either be

    • A number of fractions or parameters to sample along the curve, or

    • An explicit list of fractions or parameters at which to construct the tangents

  • plug/p (bool) – return attribute outputs, not values; defaults to False

  • normalize/nr (bool) – normalize the tangents; defaults to False

  • parametric/par (bool) – interpret numberOrFractions as parameters, not fractions; defaults to False

  • uniform/uni (bool) – if parametric is True, and numberFractionsOrParams is a number, initial parameters should be distributed by length, not parametric space; defaults to False

Returns

A list of tangents.

Return type

[Vector] | [Vector]

upVectorAtParam(param, sampler=None, plug=None)#
Parameters
  • param (float, Math1D) – the parameter at which to sample the up vector

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • sampler/sam (str, Network, CurveUpVectorSampler) – an up vector sampler to use; sampler can be created using createUpVectorSampler(); if this is omitted, then the last sampler created using createUpVectorSampler(setAsDefault=True) will be retrieved; defaults to None

Raises

RuntimeError – No default up vector sampler has been configured on this curve output.

Returns

An up vector at the specified parameter. A default up vector sampler must have been configured on this curve using createUpVectorSampler().

Return type

CurveUpVectorSampler

upVectorAtFraction(fraction, plug=None, **kwargs)#

Converts fraction into a parameter and defers to upVectorAtParam().

Parameters
  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to upVectorAtParam()

upVectorAtLength(length, plug=None, **kwargs)#

Finds the parameter at the specified length and defers to upVectorAtParam().

Parameters
  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to upVectorAtParam()

upVectorAtPoint(point, plug=None, **kwargs)#

Finds the closest parameter to the specified point and defers to upVectorAtParam().

Parameters
  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to upVectorAtParam()

createUpVectorSampler(resolution=9, unwindSwitch=0, interpolation='Linear', aimCurve=None, closestPoint=True, upObject=None, upVector=None, parallelTransport=False, setAsDefault=True)#

Depending on options, returns one of the following up-vector samplers:

Not all options can be combined. If all options are omitted, an optimised curve normal sampler will be returned.

Use sampleAtParam() on the returned object to pull up vectors.

Parameters
  • upVector/upv (None, zip, list, tuple, str, Vector, Vector, [[float | str | Math1D], [tuple | list, paya.runtime.data.Vector, paya.runtime.plugs.Vector]]) – this can be a single up vector, or zipped pairs of parameter: vector, indicating known up vectors at specific points; if a single up vector is provided then, if it’s combined with upObject, the vector is multiplied by the object’s world matrix (similar to ‘Object Rotation Up’ on motionPath nodes); otherwise, the vector is used on its own; if pairs are provided then they will be blended using parallel-transport or linearly (similar to IK spline twist); defaults to None

  • upObject/uo (str, Transform) – if provided on its own, works as an aiming interest (similar to ‘Object Up’ mode on motionPath nodes); if combined with upVector, the object’s world matrix is used to multiply the up vector; defaults to None

  • resolution/res (int) – if using parallel transport, the number of solutions to generate; higher values improve accuracy at the expense of interactivity; defaults to 9

  • unwindSwitch/uws (int, str, Math1D, [int | str | Math1D]) –

    an integer value or plug, or a list of integer values or plugs (one per segment, i.e. len(paramVectorKeys)-1) specifying how to resolve angle- blending edge cases in per-segment parallel transport:

    • 0 (shortest, the default)

    • 1 (positive)

    • 2 (negative)

  • interpolation/i:

    defines how to interpolate values from param: vector pairs:

    • 0 ('None') (you wouldn’t normally want this)

    • 1 ('Linear') (the default)

    • 2 ('Smooth')

    • 3 ('Spline')

  • parallelTransport/pt (bool) – use parallel-transport; defaults to False

  • aimCurve (str, paya.runtime.nodes.NurbsCurve, paya.runtime.nodes.Transform, paya.runtime.plugs.NurbsCurve) – an aim-curve from which to pull aiming interest points, similarly to the option on curveWarp nodes; defaults to None

  • closestPoint/cp (bool) – pull points from aimCurve by proximity rather than matched parameter; defaults to True

  • setAsDefault/sad (bool) – make this the default fallback up vector source for other sampling operations; defaults to True

Raises

NotImplementedError – The requested options can’t be combined.

Returns

The sampler system.

Return type

CurveUpVectorSampler

getUpVectorSamplers()#
Returns

All up vector samplers created on this curve output.

Return type

[CurveUpVectorSampler]

getDefaultUpVectorSampler()#
Returns

The last up vector sampler that was created on this curve with setAsDefault=True.

Return type

CurveUpVectorSampler

clearUpVectorSamplers()#

Removes all up vector samplers and their dependencies.

Warning

This will break any rigging that hangs off one or more of the samplers.

matrixAtParam(param, primaryAxis, secondaryAxis, upVector=None, upObject=None, aimCurve=None, closestPoint=True, upVectorSampler=None, defaultToNormal=None, globalScale=None, squashStretch=False, plug=None)#

Note

Unlike matrixAtFraction(), which uses a motionPath node, this builds off of a pointOnCurveInfo.

Parameters
  • param (float, str, Math1D) – the parameter at which to construct the matrix

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • upVector/upv (None, str, tuple, list, Vector, Vector) – if provided on its own, used directly; if combined with upObject, multiplied by the object’s world matrix, similar to the ‘Object Rotation Up’ mode on motion path nodes; defaults to None

  • upObject/uo (None, str, Transform) – similar to motion path nodes, if provided on its own, used as an aiming interest (‘Object Up’ mode); if combined with upVector, the up vector is multiplied by the object’s world matrix (‘Object Rotation Up’ mode); defaults to None

  • aimCurve/aic (None, str, paya.runtime.plugs.NurbsCurve, paya.runtime.nodes.NurbsCurve, Transform) – a curve from which to pull aiming interests, similar to the option on curveWarp nodes; defaults to None

  • closestPoint/cp (bool) – pull points from aimCurve by proximity, not matched parameters; defaults to True

  • upVectorSampler/ups (None, str, Network, CurveUpVectorSampler) – an up vector sampler created using createUpVectorSampler(); defaults to None

  • defaultToNormal/dtn (bool) – when all other up vector options are exhausted, don’t fall back to any ‘default’ up vector sampler previously created using createUpVectorSampler(setAsDefault=True); instead, use the curve normal (the curve normal will be used anyway if no default sampler is defined); defaults to False

  • globalScale/gs (None, float, str, Math1D) – a baseline scaling factor; note that scale will be normalized in all cases, so if this is value rather than a plug, it will have no practical effect; defaults to None

  • squashStretch/ss (bool) – allow squashing and stretching of the primaryAxis on the output matrix; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

matrixAtFraction(fraction, primaryAxis, secondaryAxis, upVector=None, upObject=None, aimCurve=None, closestPoint=True, upVectorSampler=None, defaultToNormal=None, globalScale=None, squashStretch=False, plug=None)#

Note

Unlike matrixAtParam(), which uses a pointOnCurveInfo <paya.runtime.nodes.PointOnCurveInfo node, this builds off of a motionPath.

Parameters
  • fraction (float, str, Math1D) – the fraction at which to construct the matrix

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • upVector/upv (None, str, tuple, list, Vector, Vector) – if provided on its own, used directly; if combined with upObject, multiplied by the object’s world matrix, similar to the ‘Object Rotation Up’ mode on motion path nodes; defaults to None

  • upObject/uo (None, str, Transform) – similar to motion path nodes, if provided on its own, used as an aiming interest (‘Object Up’ mode); if combined with upVector, the up vector is multiplied by the object’s world matrix (‘Object Rotation Up’ mode); defaults to None

  • aimCurve/aic (None, str, paya.runtime.plugs.NurbsCurve, paya.runtime.nodes.NurbsCurve, Transform) – a curve from which to pull aiming interests, similar to the option on curveWarp nodes; defaults to None

  • closestPoint/cp (bool) – pull points from aimCurve by proximity, not matched parameters; defaults to True

  • upVectorSampler/ups (None, str, Network, CurveUpVectorSampler) – an up vector sampler created using createUpVectorSampler(); defaults to None

  • defaultToNormal/dtn (bool) – when all other up vector options are exhausted, don’t fall back to any ‘default’ up vector sampler previously created using createUpVectorSampler(setAsDefault=True); instead, use the curve normal (the curve normal will be used anyway if no default sampler is defined); defaults to False

  • globalScale/gs (None, float, str, Math1D) – a baseline scaling factor; note that scale will be normalized in all cases, so if this is value rather than a plug, it will have no practical effect; defaults to None

  • squashStretch/ss (bool) – allow squashing and stretching of the primaryAxis on the output matrix; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

matrixAtParamOrFraction(paramOrFraction, primaryAxis, secondaryAxis, parametric=True, plug=None, **kwargs)#

Dispatches matrixAtParam() or matrixAtFraction(). See either of those for full parameter information.

Parameters
  • paramOrFraction (float, str, Math1D) – the parameter or fraction at which to construct a matrix

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • parametric (bool) – interpret paramOrFraction as a U parameter rather than a length fraction; defaults to True

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to matrixAtParam() or :meth:`matrixAtFraction

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

matrixAtPoint(point, primaryAxis, secondaryAxis, plug=None, **kwargs)#

Finds the closest parameter to point and dispatches matrixAtParam(). See that method for full parameter information.

Parameters
  • point (tuple, list, Point, Vector) – the reference point

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to matrixAtParam()

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

matrixAtLength(length, primaryAxis, secondaryAxis, plug=None, **kwargs)#

Finds the parameter at length and dispatches matrixAtParam(). See that method for full parameter information.

Parameters
  • length (tuple, list, Point, Vector) – the partial length at which to construct the matrix

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

  • **kwargs – forwarded to matrixAtParam()

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

distributeMatrices(numberFractionsOrParams, primaryAxis, secondaryAxis, parametric=False, uniform=False, chain=False, upVector=None, upObject=None, aimCurve=None, closestPoint=True, upVectorSampler=None, defaultToNormal=None, globalScale=None, squashStretch=False, plug=None)#
Parameters
  • numberFractionsOrParams

    this should either be

    • A number of fractions or parameters to generate along the curve, or

    • An explicit list of fractions or parameters at which to construct the matrices

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • parametric/par (bool) – interpret numberOrFractions as parameters, not fractions; defaults to False

  • uniform/uni (bool) – if parametric is True, and numberFractionsOrParams is a number, initial parameters should be distributed by length, not parametric space; defaults to False

  • chain/cha (bool) – aim each matrix towards the next in the series, similar to chain joints; defaults to False

  • upVector/upv (None, str, tuple, list, Vector, Vector, [None | str | tuple | list | Vector | Vector]) –

    either

    • A single up vector, or

    • A list of up vectors (one per matrix)

    If up vectors are provided on their own, they are used directly; if they are combined with ‘up objects’ (upObject), they are multiplied by the objects’ world matrices, similar to the ‘Object Rotation Up’ mode on motion path nodes; defaults to None

  • upObject/uo (None, str, Transform) – this can be a single transform, or a list of transforms (one per sample point); if provided on its own, used as an aiming interest (similar to ‘Object Up’ mode on motionPath nodes); if combined with upVector, the vector will be multiplied with the object’s matrix (similar to ‘Object Rotation Up’); defaults to None

  • aimCurve/aic (None, str, paya.runtime.plugs.NurbsCurve, paya.runtime.nodes.NurbsCurve, Transform) – a curve from which to pull aiming interests, similar to the option on curveWarp nodes; defaults to None

  • closestPoint/cp (bool) – pull points from aimCurve by proximity, not matched parameters; defaults to True

  • upVectorSampler/ups (None, str, Network, CurveUpVectorSampler) – an up vector sampler created using createUpVectorSampler(); defaults to None

  • defaultToNormal/dtn (bool) – when all other up vector options are exhausted, don’t fall back to any ‘default’ up vector sampler previously created using createUpVectorSampler(setAsDefault=True); instead, use the curve normal (the curve normal will be used anyway if no default sampler is defined); defaults to False

  • globalScale/gs (None, float, str, Math1D) – a baseline scaling factor; note that scale will be normalized in all cases, so if this is value rather than a plug, it will have no practical effect; defaults to None

  • squashStretch/ss (bool) – allow squashing and stretching of the primaryAxis on the output matrix; defaults to False

  • plug/p (bool) – force a dynamic output, or indicate that one or more of the arguments are plugs to skip checks; defaults to None

Returns

A matrix at the specified position.

Return type

paya.runtime.data.Matrix, paya.runtime.plugs.Matrix

distributeJoints(numberFractionsOrParams, primaryAxis, secondaryAxis, parametric=False, uniform=False, upVector=None, upObject=None, aimCurve=None, closestPoint=True, upVectorSampler=None, defaultToNormal=None, globalScale=None, squashStretch=False, chain=False, displayLocalAxis=True, radius=1.0, rotateOrder='xyz', parent=None, freeze=True, decompose=True, plug=False)#

Distributes joints along this curve. Pass plug/p=True for live connections.

Parameters
  • numberFractionsOrParams

    this should either be

    • A number of fractions or parameters to generate along the curve, or

    • An explicit list of fractions or parameters at which to construct the matrices

  • primaryAxis (str) – the primary (aim) matrix axis, for example ‘-y’

  • secondaryAxis (str) – the secondary (up) matrix axis, for example ‘x’

  • parametric/par (bool) – interpret numberOrFractions as parameters, not fractions; defaults to False

  • uniform/uni (bool) – if parametric is True, and numberFractionsOrParams is a number, initial parameters should be distributed by length, not parametric space; defaults to False

  • upVector/upv (None, str, tuple, list, Vector, Vector, [None | str | tuple | list | Vector | Vector]) –

    either

    • A single up vector, or

    • A list of up vectors (one per matrix)

    If up vectors are provided on their own, they are used directly; if they are combined with ‘up objects’ (upObject), they are multiplied by the objects’ world matrices, similar to the ‘Object Rotation Up’ mode on motion path nodes; defaults to None

  • upObject/uo (None, str, Transform) – this can be a single transform, or a list of transforms (one per sample point); if provided on its own, used as an aiming interest (similar to ‘Object Up’ mode on motionPath nodes); if combined with upVector, the vector will be multiplied with the object’s matrix (similar to ‘Object Rotation Up’); defaults to None

  • aimCurve/aic (None, str, paya.runtime.plugs.NurbsCurve, paya.runtime.nodes.NurbsCurve, Transform) – a curve from which to pull aiming interests, similar to the option on curveWarp nodes; defaults to None

  • closestPoint/cp (bool) – pull points from aimCurve by proximity, not matched parameters; defaults to True

  • upVectorSampler/ups (None, str, Network, CurveUpVectorSampler) – an up vector sampler created using createUpVectorSampler(); defaults to None

  • defaultToNormal/dtn (bool) –

    when all other up vector options are exhausted, don’t fall back to any ‘default’ up vector sampler previously created using :meth:`createUpVectorSampler(

    setAsDefault=True) <createUpVectorSampler>`;

    instead, use the curve normal (the curve normal will be used anyway if no default sampler is defined); defaults to False

  • globalScale/gs (None, float, str, Math1D) – a baseline scaling factor; note that scale will be normalized in all cases, so if this is value rather than a plug, it will have no practical effect; defaults to None

  • squashStretch/ss (bool) – allow squashing and stretching of the primaryAxis on the output matrix; defaults to False

  • chain/cha (bool) – create the joints as a contiguous chain with aimed, rather than tangent-based, matrix orientation; defaults to False

  • displayLocalAxis/dla (bool) – display the local matrix axes; defaults to True

  • radius/rad (float) – the joint display radius; defaults to 1.0

  • rotateOrder/ro (None, str, int, Math1D) – the rotate order for the joint; defaults to 'xyz'

  • parent/p (None, str, Transform) – an optional destination parent for the joints

  • freeze/fr (bool) – zero-out transformations (except translate) at the initial pose; defaults to True

  • decompose/dec (bool) –

    if False, connect to offsetParentMatrix instead of driving the joint’s SRT channels; note that, if freeze is requested, the initial matrix

    will always be applied via decomposition and then frozen; defaults to True

  • plug/p (bool) – drive the joints dynamically; defaults to False

Returns

The individual joints or a chain (if chain was requested).

Return type

[Joint] | Chain

toBezier(force=False)#

Converts this NURBS curve to a Bezier curve.

Parameters

force/f (bool) – when this is False, this plug will be passed through as-is if it’s already a Bezier curve; defaults to False

Returns

The bezier curve.

Return type

BezierCurve

toNurbs(force=False)#

Converts this Bezier curve to a NURBS curve.

Parameters

force/f (bool) – when this is False, this plug will be passed through as-is if it’s already a Bezier curve; defaults to False

Returns

The NURBS curve.

Return type

NurbsCurve

bSpline(tolerance=0.001, keepRange=1)#
Parameters
  • keepRange/kr (int, str, Math1D) –

    An index or enum key for the node’s keepRange` enumerator:

    • 0: ‘0 to 1’

    • 1: ‘Original’ (the default)

    • 2: ‘0 to #spans’

  • tolerance/tol (float, Math1D) – the fit tolerance; defaults to 0.001

Returns

The B-spline.

Return type

NurbsCurve

subCurve(minValue, maxValue, relative=False)#

Connects and configures a subCurve node and returns its output.

Alias

sub

Parameters
  • minValue (float, Math1D) – a source for the minValue attribute

  • maxValue (float, Math1D) – a source for the maxValue attribute

  • relative/r (bool) – set the node to ‘relative’; defaults to False

Returns

The sub-curve.

Return type

NurbsCurve

attach(*curves, blend=False, blendBias=0.5, parameter=0.1, blendKnotInsertion=False, reverse1=False, reverse2=False, multipleKnots=True)#

Note

If more than one curves are passed-in, the result may be different from calling detach() per pair, because the inputCurves array will be used on the node.

Parameters
  • *curves (str, NurbsCurve) – one or more curves to attach to this one

  • blend (bool) – use blended attachments; defaults to False

  • blendBias/bb (float, Math1D) – ignored if more than two curves are involved; the bias for blended attachments; defaults to 0.5

  • blendKnotInsertion (bool) – ignored if more than two curves are involved; add a blend knot; defaults to False

  • parameter/p (float) – ignored if more than two curves are involved or blendKnotInsertion is False; the parameter for the blend knot; defaults to 0.1

  • reverse1/rv1 (bool) – ignored if more than two curves are involved; reverse the first curve; defaults to False

  • reverse2/rv2 (bool) – ignored if more than two curves are involved; reverse the second curve; defaults to False

  • multipleKnots (bool) – keep multiple knots; defaults to True

Returns

The combined curve.

Return type

NurbsCurve

detach(*parameters, select=None)#

Detaches this curve at the specified parameter(s).

Parameters
  • *parameters (float, Math1D) – the parameter(s) at which to ‘cut’ the curve

  • select/sel – a subset of output indices to include in the return; keep attributes will configured accordingly

Returns

[NurbsCurve]

initExtendCurve(**config)#

Connects and configures an extendCurve node.

Parameters

**config – an unpacked mapping of attrName: attrSource for attribute configuration; sources can be values or plugs

Returns

The extendCurve node.

Return type

ExtendCurve

retract(length, atStart=None, atBothEnds=None)#

Retracts this curve.

Parameters
  • length (float, Math1D) – the retraction length

  • atStart/ats (bool) – retract at the start of the curve instead of the end; defaults to False

  • atBothEnds – retract at both ends of the curve; defaults to False

Returns

The modified curve.

Return type

NurbsCurve

setLength(targetLength, atStart=False, vector=None, linear=None, circular=None, extrapolate=None, multipleKnots=True)#

Uses gated retractions and extensions to force the length of this curve.

Parameters
  • targetLength (float, Math1D) – the target length

  • atStart/ats (bool) – anchor the curve at the end rather than the start; defaults to False

  • vector (None, tuple, list, Vector, Vector) – a vector along which to extend; this is recommended for spine setups where tangency should be more tightly controlled; if this is omitted, the linear / circular / extrapolate modes will be used instead

  • circular/cir (bool) – ignored if vector was provided; use the ‘circular’ mode of the extendCurve node; defaults to False

  • linear/lin (bool) – ignored if vector was provided; use the ‘linear’ mode of the extendCurve node; defaults to False

  • extrapolate/ext (bool) – ignored if vector was provided; use the ‘extrapolate’ mode of the extendCurve node; defaults to Tru``e

  • multipleKnots (bool) – keep multiple knots; defaults to True

Returns

extendByLength(length, circular=None, linear=None, extrapolate=None, atStart=None, atEnd=None, multipleKnots=True)#
Parameters
  • length (float, Math1D) – the length to add to the curve

  • circular (bool) – use a circular extension; defaults to False

  • linear (bool) – use a linear extension; defaults to True

  • extrapolate (bool) – use an extrapolated extension; defaults to False

  • atStart (bool) – extend at the start of the curve; defaults to False

  • atEnd (bool) – extend at the start of the curve; defaults to True

  • multipleKnots/mul (bool) – preserve multiple knots; defaults to True

Returns

This curve output, extended accordingly.

Return type

NurbsCurve

extendByVector(vector, atStart=False, useSegment=False, multipleKnots=True)#
Parameters
  • vector (list [float], str, Vector, Vector) – the vector along which to extend

  • atStart – extend at the start of the curve; defaults to False

  • useSegment/seg (bool) – uses an attached line segment for the extension; defaults to False

  • multipleKnots/mul (bool) – preserve multiple knots; defaults to True

Returns

This curve output, extended along the specified vector.

Return type

NurbsCurve

extendByPoint(point, atStart=False, useSegment=False, multipleKnots=True)#
Parameters
  • point (list [float], str, Vector, Vector) – the point towards which to extend

  • atStart – extend at the start of the curve; defaults to False

  • useSegment/seg (bool) – uses an attached line segment for the extension; defaults to False

  • multipleKnots/mul (bool) – preserve multiple knots; defaults to True

Returns

This curve output, extended towards the specified point.

Return type

NurbsCurve

extend(atStart=None, atEnd=None, point=None, vector=None, length=None, multipleKnots=True, useSegment=False)#
Parameters
  • length (float, Math1D) – the length to add to the curve; defaults to None

  • vector (list [float], str, Vector, Vector) – the vector along which to extend; defaults to None

  • point (list [float], str, Vector, Vector) – the point towards which to extend; defaults to None

  • atStart – extend at the start of the curve; defaults to False

  • atEnd – extend at the start of the curve; defaults to True

  • useSegment/seg (bool) – uses an attached line segment for the extension (vector / point only); defaults to False

  • multipleKnots/mul (bool) – preserve multiple knots; defaults to True

Raises

ValueError

One of:

  • More than one of vector, point or length were specified.

  • Both atStart and atEnd were specified when extending with point / vector.

  • None of vector, point or length were specified.

  • The useSegment option was requested when extending by curve.

Returns

This curve output, extended accordingly.

Return type

NurbsCurve

squashStretch(squashy, stretchy, globalScale=None, vector=None)#
Parameters
  • squashy (str, Math1D) – the user attribute to control how squashy the output should be

  • stretchy (str, Math1D) – the user attribute to control how stretchy the output should be

  • globalScale/gs (str, Math1D) – (recommended) an attribute to use as a normalizing factor for length calculations; defaults to None

  • vector/v – (recommended) an extension vector to use when the curve is under-shot (e.g. an extracted animation control axis); defaults to None

Returns

This curve output with added squash-stretch effects.

Return type

NurbsCurve

rebuild(spans=None, degree=None, keepRange=1, endKnots=0, keepEndPoints=True, keepTangents=True, keepControlPoints=False, tolerance=0.01, rebuildType=0, matchCurve=None)#

Same signature as the API method. If any arguments are omitted, they are derived from the curve’s current state.

Parameters
  • spans/s – the target number of spans; defaults to the current number of spans

  • degree/d (int, str, Math1D) – the target degree, one of 1, 2, 3, 5 or 7; defaults to the current degree

  • keepRange/kr (int, str, Math1D) –

    an integer or label for the enumerator on rebuildCurve, namely:

    • 0 (‘0 to 1’)

    • 1 (‘Original’) (the default)

    • 2 (‘0 to #spans’)

  • endKnots/end (int, str, Math1D) –

    an integer or label for the enumerator on rebuildCurve, namely:

    • 0 (‘Non Multiple end knots’)

    • 1 (‘Multiple end knots’)

  • keepEndPoints/kep (bool, str, Math1D) – keep end points; defaults to True

  • keepTangents/kt (bool, str, Math1D) – keep tangents; defaults to True

  • keepControlPoints/kcp (bool, str, Math1D) – keep control points; defaults to False

  • tolerance/tol (float, str, Math1D) – the rebuild tolerance; defaults to 0.01

  • matchCurve/mc (str, NurbsCurve, NurbsCurve, Transform) – a curve shape or input for the ‘Match Knots’ mode; if provided, rebuildType will be overriden to 2; defaults to None

  • rebuildType/rt (int, str, Math1D) –

    an integer or label for the enumerator on rebuildCurve, namely:

    • 0 (‘Uniform’) (the default)

    • 1 (‘Reduce Spans’)

    • 2 (‘Match Knots’)

    • 3 (‘Remove Multiple Knots’)

    • 4 (‘Curvature’)

    • 5 (‘End Conditions’)

    • 6 (‘Clean’)

Returns

The rebuilt curve.

cvRebuild(numCVs, degree=None, endKnots='Multiple end knots', keepRange='Original', keepControlPoints=False, keepEndPoints=True, keepTangents=False)#

Rebuilds this curve to the specified number of CVs.

Parameters
  • degree/d (int) – the degree to build to; defaults to this curve’s (current) degree if omitted

  • endKnots/end

    An enum index or label:

    • 0: ‘Non Multiple end knots’

    • 1: ‘Multiple end knots’ (the default)

  • keepRange/kr (int, str) –

    An enum index or label:

    • 0: ‘0 to 1’

    • 1: ‘Original’ (the default)

    • 2: ‘0 to #spans’

  • keepEndPoints/kep (bool) – keep end points; defaults to True

  • keepTangents/kt (bool) – keep tangents; defaults to False

Returns

The rebuilt curve.

Return type

NurbsCurve

cageRebuild()#
Returns

A linear curve with the same CVs as this one.

Return type

NurbsCurve

reverse()#
Returns

The reversed curve.

Return type

NurbsCurve

blend(otherCurve, weight=0.5)#

Blends this curve output towards otherCurve via an avgCurves node. You may get unexpected results if the curves don’t match in terms of spans, degree etc.

Parameters
  • otherCurve (str, NurbsCurve) – the curve to blend towards

  • weight/w (float, Math1D) – the blend weight; the other curve will take over fully at 1.0; defaults to 0.5

Returns

The blended curve.

Return type

NurbsCurve

insertKnot(*parameters, insertBetween=None)#
Parameters
  • *parameters (float | Math1D | [float | Math1D]) – the parameters at, or between, which to add knots

  • insertBetween/ib (bool) – if this is specified, cuts won’t be performed at the specified parameters, but rather between them; this should be a scalar, or a list of scalars (one per internal segment, i.e. len(parameters)-1), specifying the number(s) of cuts; defaults to None

Returns

The edited curve.

Return type

NurbsCurve