paya.runtime.plugs.BezierCurve#

class BezierCurve(*args, **kwargs)#

Inheritance

NurbsCurve Geometry Attribute Attribute PyNode ProxyUnicode

getShapeMFn()#

Returns an API function set for the shape type associated with this plug, initialised around the MObject of the data block. Useful for performing spot inspections (like numCVs() on a curve output) without creating a shape.

Returns

The function set.

Return type

MFnNurbsCurve

numAnchors()#
Returns

The number of anchors on this Bezier curve.

Return type

int

paramAtAnchor(anchorIndex)#

This is a fixed / static-only calculation.

Parameters

anchorIndex (int) – the anchor index

Returns

The U parameter.

paramsAtAnchors()#

This is a fixed / static-only calculation. It evaluates slightly more quickly than repeated calls to paramAtAnchor().

Returns

The U parameters at each Bezier anchor root.

Return type

[int]

getCVAtAnchor(anchorIndex, asPoint=None, asIndex=None, plug=False)#
Parameters
  • anchorIndex (int) – the index of the Bezier anchor to inspect

  • asPoint/ap (bool) – return a CV point position (the default)

  • asIndex/ai (bool) – return a CV index; this will always be a value, even if plug is True

  • plug/p – if asPoint is requested, return a plug, not just a value; defaults to False

Returns

The point at the root CV of the specified anchor.

Return type

int | Point | Vector

pointAtAnchor(anchorIndex, plug=False)#
Parameters
  • anchorIndex (int) – the index of the Bezier anchor to inspect

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

Returns

The position of the root CV at the specified anchor.

Return type

Point | Vector

getCVsAtAnchor(anchorIndex, asPoint=None, asIndex=None, asDict=False, plug=False)#
Parameters
  • anchorIndex (int) – the index of the anchor to inspect

  • asPoint/ap (bool) – return CV point positions (the default)

  • asIndex/ai (bool) – return CV indices; indices are always returned as values, not scalar outputs, even if plug is True

  • plug/p – if asPoint is requested, return point outputs, not just values; defaults to False

  • asDict/ad (bool) –

    returns the information in a dictionary with the following keys:

    • 'in': the in-tangent point or index (may be omitted)

    • 'root': the point or index for the main anchor CV

    • 'out': the out-tangent point or index (may be omitted)

    Defaults to False.

Returns

The CV indices or positions.

Return type

[int] | [paya.runtime.plugs.Vector] | [paya.runtime.data.Point]

getControlVerts(plug=False, anchors=False)#
Parameters
Returns

The members of the controlPoints info array for this curve.

Return type

[Vector], [Point]

matrixAtAnchor(anchorIndex, primaryAxis, secondaryAxis, upVector=None, upObject=None, aimCurve=None, closestPoint=True, upVectorSampler=None, defaultToNormal=None, globalScale=None, squashStretch=False, plug=None)#
Parameters
  • anchorIndex (int) – the index of the anchor 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’

  • 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 anchor.

Return type

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

inbetweenAnchors(numTweens=1)#
Parameters

numTweens/num (int) – the number of anchors to insert between each pair of existing anchors; defaults to 1

Returns

The edited Bezier curve.

Return type

BezierCurve

subdivideAnchors(subdivisions=1)#

Subdivides this Bezier curve by recursively adding knots between its anchors.

Parameters

subdivisions/sub (int) – the number of times to subdivide; defaults to 1

Returns

The edited Bezier curve.

Return type

BezierCurve