alias_api.AlDagNode
- class alias_api.AlDagNode
Bases:
AlObject,AlPickable- // py::class_<AlDagNode, AlObject, AlPickable, std::unique_ptr<AlDagNode>>( m, “AlDagNode”, R”doc(
Basic Interface to Alias Dag Node objects.
This class encapsulates the basic functionality for creating, manipulating and deleting a dag node. A dag node is part of a tree-like hierarchical structure known as a directed acyclic graph or DAG. All dag nodes belong to a single DAG which is contained in the current universe. The head of the DAG is accessible by calling the AlUniverse::firstDagNode() static method.
Each dag node can be mutually attached to a previous and next dag node to form a list of dag nodes. This list can belong to a group (or parent) dag node. This list of dag nodes that belong to a group node are called “children” of the group node.
The purpose of a dag node is to contain information which defines particular affine transformations such as scale, rotation and translation. There is a specific fixed order in which the transformations are combined. There are methods for accessing each particular transformation and a method exists for obtaining the local tranformation matrix built from these transformations. For more information, see the description for the method local_transormation_matrix().
Classes derived from this class will refer to a particular type of object. For example, the AlCameraNode class is derived from AlDagNode and refers to AlCamera objects only. The shape, position and/or orientation of the object referred to is defined by combining the transformations for the dag node with all the transformations inherited from the dag nodes above it in the DAG. There is a method for obtaining the global tranformation matrix, which is built from the local transformations and all inherited transformations. For example, if dag node A is a parent of dag node B which is a parent of dag node C, then the global transformation of C is the matrix product [C]*[B]*[A], where [C], [B], and [A] are local transformations of each dag node.
A dag node can have some user-defined text associated with it and so there are methods for getting and setting the text.
Users cannot instantiate an AlDagNode directly. A derived class of an AlDagNode must be instantiated and then if required the create method of the class must be called. This will automatically insert the dag node into the DAG as a parent-less node. A dag node can be moved so that it is a sibling of any dag node in the DAG. Deleting a dag node removes the node from its list of siblings. For derived classes, deletion of a dag node will cause the deletion of the object that it refers to.
Since an AlDagNode simply contains transformations but does not refer to any transformable object, this class is of little practical use on its own. It is primarily an abstract base class from which other dag node classes are derived. NOTE that NULL dag nodes created in the Alias Interactive package are retrieved by this library as group nodes without children.
What does a transformation matrix mean? This matrix is the product of matrices for scale, rotate and translate. One useful piece of information from this matrix is the POSITION of an object. The first three values in the bottom row of the matrix (indices (3,0), (3,1), and (3,2)) represent the translation of the origin (0,0,0) in the x, y, and z directions. For instance, if you placed a sphere at (20, 30, 16) in the Alias interactive package, then moved it to (-30, 16, 28), you would notice that its global transformation matrix would have (-30, 16, 28) in the bottom row.
Additionally AlDagNode includes AlCopyOptions as a nested class. This class allows for the querying and setting of options for AlDagNode.copy_object(). When first instantiated an instance of AlCopyOptions will have it’s values set according to the values in Edit->Duplicate Object option box. It is not possible to set the values in this option box through this class.
- add_joint(self: alias_api.AlDagNode) int
Add an AlJoint to this dag node to maintain IK information.
- add_sibling_node(self: alias_api.AlDagNode, sibling: alias_api.AlDagNode) int
Insert an AlDagNode as the next sibling of this AlDagNode object.
- affected_transformation_matrix(*args, **kwargs)
Overloaded function.
affected_transformation_matrix(self: alias_api.AlDagNode, tm: alias_api.AlTM, matrix: alias_api.AlTM) -> int
Compute the transformation matrix for the object which is obtained by multiplying the local transformation matrix with the given AlTM ‘tm’.
affected_transformation_matrix(self: alias_api.AlDagNode, tm: alias_api.AlTM) -> tuple[int, typing.Annotated[list[typing.Annotated[list[float], “FixedSize(4)”]], “FixedSize(4)”]]
Compute the transformation matrix for the object which is obtained by multiplying the local transformation matrix with the given AlTM ‘tm’.
- bounding_box(self: alias_api.AlDagNode) tuple[int, Annotated[list[Annotated[list[float], 'FixedSize(4)']], 'FixedSize(8)']]
Returns the eight corners of the bounding box in world space.
- comment(self: alias_api.AlDagNode) tuple[int, int, str]
Obtain the size and address of a block of textual data associated with the object.
- copy_object(*args, **kwargs)
Overloaded function.
copy_object(self: alias_api.AlDagNode, options: AlDagNode::AlCopyOptions = None) -> alias_api.AlDagNode
Copy this AlDagNode returning a pointer to the new copy.
copy_object(self: alias_api.AlDagNode, options: AlDagNode::AlCopyOptions, num_of_blind_data_ids_to_copy: typing.SupportsInt, blind_data_ids_to_copy: typing.SupportsInt) -> alias_api.AlDagNode
Return an exact duplicate of this AlDagNode wrapper.
- copy_transform(self: alias_api.AlDagNode, node: alias_api.AlDagNode) int
Copy the local transformation from the given node on to this node.
- copy_wrapper(self: alias_api.AlDagNode) alias_api.AlObject
Return an exact duplicate of this AlDagNode wrapper.
- create_symmetric_geometry(self: alias_api.AlDagNode) int
Create the symmetric geometry for this node if it is on a symmetric plane.
- delete_object(self: alias_api.AlDagNode) int
Delete the AlDagNode from the Alias Universe and return the status of the performed operation.
- do_updates(self: alias_api.AlDagNode, new_state: SupportsInt = 1) 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.
- get_surface_orientation(self: alias_api.AlDagNode) tuple[int, int]
Set the ‘opposite’ flag of the surface or mesh in ‘node’.
- global_transformation_matrix(*args, **kwargs)
Overloaded function.
global_transformation_matrix(self: alias_api.AlDagNode, matrix: alias_api.AlTM) -> int
Compute the global transformation matrix for the object.
global_transformation_matrix(self: alias_api.AlDagNode) -> tuple[int, typing.Annotated[list[typing.Annotated[list[float], “FixedSize(4)”]], “FixedSize(4)”]]
Compute the global transformation matrix for the object.
- inverse_global_transformation_matrix(*args, **kwargs)
Overloaded function.
inverse_global_transformation_matrix(self: alias_api.AlDagNode, matrix: alias_api.AlTM) -> int
Compute the inverse global transformation matrix for the object.
inverse_global_transformation_matrix(self: alias_api.AlDagNode) -> tuple[int, typing.Annotated[list[typing.Annotated[list[float], “FixedSize(4)”]], “FixedSize(4)”]]
Compute the inverse global transformation matrix for the object.
- is_a_construction_plane(self: alias_api.AlDagNode) int
Return True if the dag node is a construction plane.
- is_ancestor_an_instance(self: alias_api.AlDagNode) int
Returns True if this AlDagNode or one of its ancestors is an instance node, else False.
- is_display_mode_set(self: alias_api.AlDagNode, mode: alias_api.AlDisplayModeType) int
Return true if the specified display mode is set (on), else false.
- is_instanceable(self: alias_api.AlDagNode) int
Return True. An AlDagNode is instanceable by default, unless overridden by derived class.
- is_instanced(self: alias_api.AlDagNode) int
Return True if this is an instance node.
- layer(self: alias_api.AlDagNode) alias_api.AlLayer
Returns layer the node is assigned.
- local_rotate_by(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Perform a dag node rotation based on the setting of the local axes.
- local_rotation_angles(self: alias_api.AlDagNode) tuple[int, float, float, float]
These angles allow you to determine how the local rotation axis have been rotated from their initial position.
- local_rotation_axes(self: alias_api.AlDagNode) tuple[int, Annotated[list[float], 'FixedSize(3)'], Annotated[list[float], 'FixedSize(3)'], Annotated[list[float], 'FixedSize(3)']]
Return the vectors representing the local rotation axes for this node. These axes are the three axes vectors in the world space co-ordinates.
- local_transformation_matrix(*args, **kwargs)
Overloaded function.
local_transformation_matrix(self: alias_api.AlDagNode, matrix: alias_api.AlTM) -> int
Compute the local transformation matrix for the object.
local_transformation_matrix(self: alias_api.AlDagNode) -> tuple[int, typing.Annotated[list[typing.Annotated[list[float], “FixedSize(4)”]], “FixedSize(4)”]]
Compute the local transformation matrix for the object.
- local_translate_by(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Perform a dag node translation based on the setting of the local axes.
- property name
Get or set the AlDagNode name.
- next_node(self: alias_api.AlDagNode) alias_api.AlDagNode
Return a pointer to the object’s next sibling AlDagNode or None if there is no next sibling.
- parent_node(self: alias_api.AlDagNode) AlGroupNode
Returns the parent group node.
- prev_node(self: alias_api.AlDagNode) alias_api.AlDagNode
Return a pointer to the object’s previous sibling AlDagNode or None if there is no next sibling.
- remove_blind_data(self: alias_api.AlDagNode, user_type: SupportsInt) int
Remove the block of data of the given type from the object.
- remove_comment(self: alias_api.AlDagNode) int
Remove the block of text associated with this object from the object itself.
- remove_joint(self: alias_api.AlDagNode) int
Remove the AlJoint to this dag node to maintain IK information.
- rotate_pivot(self: alias_api.AlDagNode) tuple[int, alPyMath::Vec3]
Returns a vector that represents the rotation pivot position in world space.
- rotation(self: alias_api.AlDagNode) tuple[int, float, float, float]
Return the amount of rotation (in degrees) about the x, y, and z axes.
- scale(self: alias_api.AlDagNode) tuple[int, float, float, float]
Return the amount of scale in the x, y, and z direction.
- scale_pivot(self: alias_api.AlDagNode) tuple[int, alPyMath::Vec3]
Returns a vector that represents the scale pivot position in world space.
- search_across(self: alias_api.AlDagNode, name: str) alias_api.AlDagNode
Search across the DAG tree (starting at the current node), for a dag node with a specific ‘name’.
- search_below(self: alias_api.AlDagNode, name: str) alias_api.AlDagNode
Search the DAG tree (rooted at the child of the current node), for a dag node with a specific ‘name’.
- send_geometry_modified_message(self: alias_api.AlDagNode) int
Send out an update message notifying that the geometry of this dag node has been modified.
- set_blind_data(self: alias_api.AlDagNode, user_type: SupportsInt, size: SupportsInt, data: str) int
Associates a block of ‘data’ with the object.
- set_comment(self: alias_api.AlDagNode, size: SupportsInt, data: str) int
Associates a block of textual ‘data’ with the object.
- set_display_mode(self: alias_api.AlDagNode, mode: alias_api.AlDisplayModeType, on: SupportsInt) int
Set the display mode (by name) for this dag node.
- set_layer(*args, **kwargs)
Overloaded function.
set_layer(self: alias_api.AlDagNode, layer: alias_api.AlLayer) -> int
Set the layer on the dag node.
When a layer is set to an AlDagNode, the following settings are done:
All the child nodes of the current node are automatically assigned to the layer object.
All the parent nodes are automatically assigned to the default layer.
All the sibling nodes are unaffected.
- param layer
The layer object to be assigned to the AlDagNode
- type layer
AlLayer
- return
The status code result Success - the layer was assigned successfully InvalidArgument - the layer is invalid InvalidObject - the dag node was invalid
- rtype
int(AlStatusCode)
set_layer(self: alias_api.AlDagNode, layer_number: typing.SupportsInt) -> int
Set the layer ID on the dag node.
When a layer is set to an AlDagNode, the following settings are done:
All the child nodes of the current node are automatically assigned to the layer object.
All the parent nodes are automatically assigned to the default layer.
All the sibling nodes are unaffected.
- param layer_number
The layer number to be assigned to the AlDagNode
- type layer_number
int
- return
The status code result Success - the layer was assigned successfully InvalidArgument - the layer number is invalid InvalidObject - the dag node was invalid
- rtype
int(AlStatusCode)
- set_local_rotation_angles(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Setting the local rotation angles is the only means by which the local rotations axes can be modified.
- set_local_rotation_axes(self: alias_api.AlDagNode, arg0: Annotated[collections.abc.Sequence[SupportsFloat], 'FixedSize(3)'], arg1: Annotated[collections.abc.Sequence[SupportsFloat], 'FixedSize(3)'], arg2: Annotated[collections.abc.Sequence[SupportsFloat], 'FixedSize(3)']) int
Set the local rotation axes of this dag node to the given world space vectors.
- set_rotate_pivot(*args, **kwargs)
Overloaded function.
set_rotate_pivot(self: alias_api.AlDagNode, p: alPyMath::Vec3) -> int
Set the rotate pivot.
- param p
The rotate pivot position in world space.
- type p
Vec3
- return
The status code result of the operation.
- rtype
int(AlStatusCode)
set_rotate_pivot(self: alias_api.AlDagNode, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> int
Set the rotate pivot.
- param x
The x component of the rotate pivot position in world space.
- type x
float
- param y
The y component of the rotate pivot position in world space.
- type y
float
- param z
The z component of the rotate pivot position in world space.
- type z
float
- return
The status code result of the operation.
- rtype
int(AlStatusCode)
- set_rotation(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Set the amount of rotation (in degress) about the x, y, z axes. The rotation will be done after the scale transformation and before the final local translation.
- set_scale(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Set the local scale vector. The scale transformation will be done before the local rotations. There is no restriction on the values of the components of the scale vector.
- set_scale_pivot(*args, **kwargs)
Overloaded function.
set_scale_pivot(self: alias_api.AlDagNode, p: alPyMath::Vec3) -> int
Set the scale pivot.
- param p
The scale pivot position in world space.
- type p
Vec3
- return
The status code result of the operation.
- rtype
int(AlStatusCode)
set_scale_pivot(self: alias_api.AlDagNode, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat) -> int
Set the scale pivot.
- param x
The x component of the scale pivot position in world space.
- type x
float
- param y
The y component of the scale pivot position in world space.
- type y
float
- param z
The z component of the scale pivot position in world space.
- type z
float
- return
The status code result of the operation.
- rtype
int(AlStatusCode)
- set_surface_orientation(self: alias_api.AlDagNode, flag: SupportsInt) int
Set the ‘opposite’ flag of the surface or mesh in ‘node’.
- set_translation(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Set the final local translation vector. The translation transformation will be done after rotations.
- set_world_translation(self: alias_api.AlDagNode, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) int
Set the final world translation vector.
- translation(self: alias_api.AlDagNode) tuple[int, float, float, float]
Return the final local translation vector.
- type(self: alias_api.AlDagNode) alias_api.AlObjectType
Return the AlDagNode type identifier.
- update_draw_info(self: alias_api.AlDagNode) int
Force the internal draw information to be updated to match the dag node’s geometry.
- version(self: alias_api.AlDagNode) int
Return the version of the dag node.