Component Base Class¶
Code author: Jeremy Ernst
-
class
ART_Component(prefix='', suffix='', network_node=None)[source]¶ Base class for defining a component (arm, leg, torso, single joint, etc) in ARTv2. All components should inherit from this class.
When creating a new component, here is a list of common attributes and functions you will want or need to override.
Type Name Description attribute nice_name The string nice name of the component (as it will appear in UIs) attribute base_name The string base name of the component. This is a simple string used to identify the component type and append onto nodes created by the component. For example, on a leg component, the base_name is simply: “leg” attribute has_sides Bool for whether or not the component supports different sides,like a leg or arm do. attribute joint_mover_file The relative path from the ARTv2 directory to the joint mover file of the component. For example, self.joint_mover_file = “resources/rigging_guides/root.ma” function _add_metadata This method adds attributes you want to keep track of that are unique to your component. Make sure that you still call on the base class’s _add_metadata method to setup the required attributes. -
_add_metadata(network_node, prefix, suffix)[source]¶ Method for adding metadata attributes to the network node that are important for the component. The ones created by the base class are necessary for all components.
Parameters: - network_node (PyNode) – component’s network node name to add attributes to.
- prefix (str) – the component’s (optional) prefix.
- suffix (str) – the component’s (optional) suffix.
-
Properties¶
-
prefix¶ This property holds the component’s prefix (optional)
Returns: Returns the component’s prefix. Return type: str
-
suffix¶ This property holds the component’s suffix (optional)
Returns: Returns the component’s suffix. Return type: str
-
parent¶ This property holds the joint name of the parent of this component.
-
network_node¶ This property holds the network node that contains this module’s metadata.