paya.runtime.nodes.BezierCurve#

class BezierCurve(*args, **kwargs)#

Inheritance

BezierCurve NurbsCurve NurbsCurve CurveShape CurveShape DeformableShape DeformableShape GeometryShape GeometryShape Shape Shape DagNode DagNode Entity Entity ContainerBase ContainerBase DependNode DependNode PyNode ProxyUnicode

classmethod create(*points, name=None, parent=None, displayType=None, conformShapeName=None, intermediate=False, lineWidth=None, dispCV=True)#

Bezier curve constructor. Points can be static or dynamic.

Parameters
  • *points – if provided, the number of CV points must be ‘legal’ for a Bezier curve; namely, outer anchors must receive two CVs each, and inner anchors must each receive three CVs; if omitted, an empty Bezier curve shape node will be createds

  • *points – None, str, tuple, list, Point, Vector

  • name/n (str) – a name for the curve shape node; defaults to a contextual name

  • parent/p – an optional destination parent; no space conversion will take place; if the parent has transforms, the curve shape will be transformed as well; defaults to None

  • displayType/dt (None, int, str) –

    if provided, an index or enum label:

    • 0: ‘Normal’

    • 1: ‘Template’

    • 2: ‘Reference’

    If omitted, display overrides won’t be activated at all.

  • conformShapeName/csn (bool) – if reparenting, rename the shape to match the destination parent; defaults to True if parent has been specified, otherwise False

  • intermediate/i (bool) – set the shape to intermediate; defaults to False

  • lineWidth/lw (None, float) – an override for the line width; defaults to None

  • dispCV/dcv (bool) – display CVs on the curve; defaults to True

Typeparent/p

None, str, Transform

Returns

The curve shape.

Return type

BezierCurve

classmethod createLine(startPt, endPt, numAnchors=2, **kwargs)#

Convenience wrapper for create() to quickly draw a straight bezier line.

Parameters
Returns

The bezier curve shape.

Return type

BezierCurve

clusterAnchor(anchorIndex, **kwargs)#
Parameters
  • anchorIndex (int) – the index of the anchor to cluster

  • **kwargs – forwarded to paya.runtimes.nodes.Cluster.create()

Returns

A cluster for the specified anchor.

Return type

Cluster

clusterAll(merge=False, tolerance=1e-06, anchors=False)#

Overloads clusterAll() to add the anchors / a option.

Parameters
  • anchors/a (bool) – group clusters by bezier anchor; defaults to False

  • merge/mer (bool) – merge CVs if they overlap within the specified tolerance; defaults to False

  • tolerance/tol (float) – the merging tolerance; defaults to 1e-6

Returns

The clusters.

Return type

[Cluster]

numAnchors(worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.numAnchors(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.numAnchors():

Returns

The number of anchors on this Bezier curve.

Return type

int

paramAtAnchor(anchorIndex, worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.paramAtAnchor(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.paramAtAnchor():

This is a fixed / static-only calculation.

Parameters

anchorIndex (int) – the anchor index

Returns

The U parameter.

paramsAtAnchors(worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.paramsAtAnchors(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.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, worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.getCVAtAnchor(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.getCVAtAnchor():

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, worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.pointAtAnchor(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.pointAtAnchor():

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, worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.getCVsAtAnchor(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.getCVsAtAnchor():

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, worldSpace=False)#

Note

Adapted from paya.runtime.plugs.BezierCurve.getControlVerts(); a worldSpace/ws keyword argument has been added, defaulting to False

Documentation from paya.runtime.plugs.BezierCurve.getControlVerts():

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)#

Note

Adapted from paya.runtime.plugs.BezierCurve.matrixAtAnchor(); only runs in world space.

Documentation from paya.runtime.plugs.BezierCurve.matrixAtAnchor():

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)#

Note

Attached from plug class. Plug outputs are replaced with shapes. These should be caught, as some operations may entirely replace the original shape instance. History is always preserved.

Documentation from paya.runtime.plugs.BezierCurve.inbetweenAnchors():

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)#

Note

Attached from plug class. Plug outputs are replaced with shapes. These should be caught, as some operations may entirely replace the original shape instance. History is always preserved.

Documentation from paya.runtime.plugs.BezierCurve.subdivideAnchors():

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