alias_api.AlCurveCV
- class alias_api.AlCurveCV
Bases:
AlObject,AlClusterable,AlAnimatable,AlSettable,AlPickableEncapsulates methods common to curve CVs.
AlCurveCV is the class used to access and manipulate curve CV’s (also referred to as Control Points). There is one AlCurveCV object for each CV of an AlCurve as you see it in the interactive Alias package. You cannot create or delete an AlCurveCV. AlCurveCV’s are only created through AlCurve’s.
There are methods to query and set the multiplicity of a CV, and methods to query the world position and the “unaffected” position of a CV. The “unaffected” position of a CV is its position BEFORE any transformations (from its parent dag node or from affecting clusters) have been applied to it. There is also a method to access the clusters that affect a CV. Methods setWorldPosition(*) are used for setting either the unaffected or affected(clusters) position of a CV.
Multiplicity:
When an AlCurveCV has a multiplicity > 1, CV’s are internally piled up at that position. In this case, an AlCurveCV actually represents more than one CV internally. To access ALL CV’s, use the methods in the AlCurve class to query values “including multiplicity”, or use the example code below. By representing AlCurveCV’s this way, then if an AlCurveCV is moved, the corresponding multiple CV’s at that position are moved as well, acting exactly like the Alias interactive package.
Creation:
Note that certain routines require that the given CV be installed in the Dag (i.e., that the curve belongs to a AlCurveNode). If any of these are called on a CV that’s not part of the Dag, they will simply fail.
- Routines that require the CV to be in the Dag:
next world_position set_multiplicity set_unaffected_position set_world_position
- copy_wrapper(self: alias_api.AlCurveCV) alias_api.AlObject
Makes an exact copy of this AlCurveCV wrapper.
- curve(self: alias_api.AlCurveCV) alias_api.AlCurve
Returns a pointer to the AlCurve that this curve CV belongs to.
- do_updates(self: alias_api.AlCurveCV, arg0: SupportsInt) int
The doUpdate flag is used to notify the system that you are finished performing. If this flag is true, then it is equivalent to sending out a ‘geometry modified’ message to the rest of the system. When the system receives the update message, then operations such as construction history etc are performed.
This feature is important when using construction history plugins. Construction history plugins should always set the doUpdate flag to FALSE when performing updates (otherwise an infinite update loop will result, usually ending in a core dump). The update can be explicitly forced using the AlDagNode.send_geometry_modified_message() method.
This flag DOES NOT UPDATE THE SCREEN. Use the AlUniverse::redrawScreen to perform the screen refresh.
If the previous state of the flag was FALSE and the new state is TRUE, then an update will be performed now and on each subsequent dag modification.
- Returns
The status code result of the operation: Success - the new state was set InvalidObject - this DagNode is invalid.
- Return type
- index(self: alias_api.AlCurveCV) int
Returns the index of this CV.
Returns -1 if the index could not be found. The index of the first CV is 0.
- multiplicity(self: alias_api.AlCurveCV) int
Returns the multiplicity of this curve CV.
The returned value is 1, 2 or 3, unless the call fails, in which case it is 0.
- next(self: alias_api.AlCurveCV) alias_api.AlCurveCV
Returns a pointer to the next AlCurveCV.
Otherwise, returns None if there is no next curve CV, or if this CV is not in the Dag.
The “not in the dag” restriction cannot be removed since the ‘face’ identifier lives in the dag, so we cannot differentiate faces from ordinary curves.
- prev(self: alias_api.AlCurveCV) alias_api.AlCurveCV
Returns a pointer to the previous AlCurveCV.
Otherwise, returns None if there is no previous curve CV.
- set_multiplicity(self: alias_api.AlCurveCV, new_multiplicity: SupportsInt) int
Sets the multiplicity of this curve CV to the given multiplicity. The new multiplicity must be 1, 2, or 3.
- Parameters
new_multiplicity (int) – the multiplicity to set this AlCurveCV to.
- Returns
The status code result of the operation: Success - the multiplicity was set InvalidArgument - the multiplicity was not 1, 2 or 3 InvalidObject - the CV was invalid InsufficientMemory - not enough memory to allocate a new block Failure - the CV is not created or not in the world
- Return type
- set_unaffected_position(self: alias_api.AlCurveCV, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat, w: SupportsFloat) int
Sets either the CVs PW directly or the cluster local Pw if the CV is affected by clusters. If many CVs are to be moved it is more efficient to use AlCurve.set_cvs_unaffected_position().
- Parameters
x (float) – the new unaffected position in the x direction
y (float) – the new unaffected position in the y direction
z (float) – the new unaffected position in the z direction
w (float) – homogeneous coordinate
- Returns
The status code result of the operation: Success - the position of this curve CV was set InvalidObject - the CV was not valid sFailure - the CV is not created or not in the world.
- Return type
- set_world_position(*args, **kwargs)
Overloaded function.
set_world_position(self: alias_api.AlCurveCV, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat, w: typing.SupportsFloat, include_world: typing.SupportsInt) -> int
Set the world position of the CV. The CV may also be in a cluster.
- param x
the new unaffected position in the x direction
- type x
float
- param y
the new unaffected position in the y direction
- type y
float
- param z
the new unaffected position in the z direction
- type z
float
- param w
homogeneous coordinate
- type w
float
- param include_world
include world transformation in move
- type include_world
bool
- return
The status code result of the operation: Success - the position of this curve CV was set InvalidObject - the CV was not valid sFailure - the CV is not created or not in the world. The move could not be performed
- rtype
AlStatusCode
set_world_position(self: alias_api.AlCurveCV, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat, w: typing.SupportsFloat, tm: alias_api.AlTM) -> int
Set the world position of the CV. The CV may also be in a cluster.
Note that this method uses the inverse of the transformation matrix that is passed in so that the calling routine does not need to generate it.
- param x
the new unaffected position in the x direction
- type x
float
- param y
the new unaffected position in the y direction
- type y
float
- param z
the new unaffected position in the z direction
- type z
float
- param w
homogeneous coordinate
- type w
float
- param tm
user’s transformation matrix
- type tm
AlTM
- return
The status code result of the operation: Success - the position of this curve CV was set InvalidObject - the CV was not valid sFailure - the CV is not created or not in the world. The move could not be performed
- rtype
AlStatusCode
- type(self: alias_api.AlCurveCV) alias_api.AlObjectType
Returns the class identifier ‘CurveCVType’
- unaffected_position(self: alias_api.AlCurveCV) tuple[int, float, float, float, float]
Returns the position of this curve CV PRIOR TO ANY TRANSFORMATIONS (hence “unaffected”).
How are the unaffected position and world position related? The world position is the unaffected position with the inclusive transformation of all dag nodes above this curve applied to it AND the transformations of all affecting clusters applied to it (in appropriate proportions).
- Returns
A tuple containing: (1) the status code result of the operation:
Success - the position of this curve CV was returned InvalidObject - the CV was invalid Failure - the CV is not created or not in the world.
the unaffected position - the unaffected position in the x direction - the unaffected position in the y direction - the unaffected position in the z direction - homogeneous coordinate
- Return type
tuple<AlStatusCode, float, float, float, float>
- world_position(self: alias_api.AlCurveCV) tuple[int, float, float, float, float]
Returns the position of this curve CV in world space. This position includes the transformations of all dag nodes above this curve and the effects of all clusters.
Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].
- Returns
A tuple containing: (1) the status code result of the operation:
Success - the position of this curve CV in world space was returned InvalidObject - the CV was invalid Failure - the CV is not created or not in the world.
The position of the CV in world space. - the world position in the x direction - the world position in the y direction - the world position in the z direction - the homogeneous coordinate
- Return type
tuple<AlStatusCode, float, float, float, float>