Links
Links are used to ensure that nodes update to match each other’s positions when doing rig layout.
They are like parent constraints that exist without any additional nodes or connections between nodes, and are only updated when requested by the designer.
Link information is stored in the scene on each node using metadata.
- class DefaultLinkPositioner
Bases:
LinkPositionerDefault link positioner, updates the follower to match a single leaders position.
- calculate_target_matrix(follower, target_nodes, link_data)
Calculate the target matrix to use for a linked node.
- class IKPoleLinkPositioner
Bases:
LinkPositionerIK Pole positioner, updates the follower to be placed along the pole vector.
- calculate_target_matrix(follower, target_nodes, link_data)
Calculate the target matrix to use for applying a linked position to the follower node.
- create_link(follower, target_nodes)
Create a link between a follower and other nodes. Default implementation just stores the given target nodes, and optionally calculates offsets.
- Parameters:
follower (PyNode) – The node to be linked such that it can be positioned later automatically
target_nodes – The nodes to link to the follower.
- class LinkPositioner
Bases:
objectHandles updating the transform of a linked object to match its target.
- apply_link_position(follower, link_data)
Update the transform of follower using its link data
- calculate_offsets(follower, target_mtx)
Calculate the offset translate, rotate, and scale for a follower and target matrix.
- calculate_target_matrix(follower, target_nodes, link_data)
Calculate the target matrix to use for applying a linked position to the follower node.
- create_link(follower, target_nodes)
Create a link between a follower and other nodes. Default implementation just stores the given target nodes, and optionally calculates offsets.
- Parameters:
follower (PyNode) – The node to be linked such that it can be positioned later automatically
target_nodes – The nodes to link to the follower.
- get_offset_matrix(link_data)
Return the offset matrix to apply using any offsets defined in the link’s metadata.
- get_target_node(link_data)
Return the first target node of the link.
- recreate_link(node, link_data)
Re-create the link between a follower and other nodes. Useful for updating offsets.
- set_follower_matrix_with_offset(follower, target_mtx, link_data)
Set the new world matrix of a follower node, incorporating the saved offsets from link_data if applicable.
- set_link_meta_data(node, link_data)
Set the metadata for a linked node
- class WeightedLinkPositioner
Bases:
LinkPositionerWeighted positioner updates the follower to be placed at a weighted location between targets.
- calculate_target_matrix(follower, target_nodes, link_data)
Calculate the target matrix to use for applying a linked position to the follower node.
- create_link(follower, target_nodes)
Create a link between a follower and other nodes. Default implementation just stores the given target nodes, and optionally calculates offsets.
- Parameters:
follower (PyNode) – The node to be linked such that it can be positioned later automatically
target_nodes – The nodes to link to the follower.
- recreate_link(node, link_data)
Re-create the link between a follower and other nodes. Useful for updating offsets.
- cleanup_links()
Cleanup all nodes in the scene that have broken links
- get_all_linked_nodes()
Return all nodes in the scene that are linked
- get_link_meta_data(node)
Return all link metadata for a node
- get_linked_nodes(node) List[pymel.core.PyNode]
Return all leaders a node is linked to.
- get_positioner(link_type) LinkPositioner
Create and return a new positioner instance for a link type.
- recreate_link(node, keep_offset=False)
Recreate the link for a node, updating or removing its offsets if necessary.
- set_link_meta_data(node, link_data)
Set the metadata for a linked node
- unlink(node)
Remove a link from a node