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
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, otherwiseFalse
intermediate/i (bool) – set the shape to intermediate; defaults to
False
lineWidth/lw (
None
,float
) – an override for the line width; defaults toNone
dispCV/dcv (bool) – display CVs on the curve; defaults to
True
- Typeparent/p
None, str,
Transform
- Returns
The curve shape.
- Return type
- classmethod createLine(startPt, endPt, numAnchors=2, **kwargs)#
Convenience wrapper for
create()
to quickly draw a straight bezier line.
- clusterAnchor(anchorIndex, **kwargs)#
- clusterAll(merge=False, tolerance=1e-06, anchors=False)#
Overloads
clusterAll()
to add the anchors / a option.
- numAnchors(worldSpace=False)#
Note
Adapted from
paya.runtime.plugs.BezierCurve.numAnchors()
; a worldSpace/ws keyword argument has been added, defaulting toFalse
Documentation from
paya.runtime.plugs.BezierCurve.numAnchors()
:- Returns
The number of anchors on this Bezier curve.
- Return type
- paramAtAnchor(anchorIndex, worldSpace=False)#
Note
Adapted from
paya.runtime.plugs.BezierCurve.paramAtAnchor()
; a worldSpace/ws keyword argument has been added, defaulting toFalse
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 toFalse
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 toFalse
Documentation from
paya.runtime.plugs.BezierCurve.getCVAtAnchor()
:- Parameters
- Returns
The point at the root CV of the specified anchor.
- Return type
- pointAtAnchor(anchorIndex, plug=False, worldSpace=False)#
Note
Adapted from
paya.runtime.plugs.BezierCurve.pointAtAnchor()
; a worldSpace/ws keyword argument has been added, defaulting toFalse
Documentation from
paya.runtime.plugs.BezierCurve.pointAtAnchor()
:
- 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 toFalse
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 toFalse
Documentation from
paya.runtime.plugs.BezierCurve.getControlVerts()
:- Parameters
plug/p (bool) – return plugs rather than values; defaults to
False
anchors/a (bool) – organise the return into bezier anchor groups; see
paya.lib.nurbsutil.itemsAsBezierAnchors()
; defaults toFalse
- Returns
The members of the
controlPoints
info array for this curve.- Return type
- 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 onmotion path
nodes; defaults toNone
upObject/uo (None, str,
Transform
) – similar tomotion 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 toNone
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 oncurveWarp
nodes; defaults toNone
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 usingcreateUpVectorSampler()
; defaults toNone
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 toFalse
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 toNone
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
- 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
- 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