# -*- coding: utf-8 -*- """ :author: Jeremy Ernst :description: This module contains the class for defining the arm component. The arm component consists of at minimum, 3 joints: the upperarm, lowerarm, and hand. There are also options for 3 twist joints in the upper and lower arm areas. """ import artv2.components.base_components.base_component as base class Arm(base.ART_Component): """ This class is define and creates the arm component. The arm component consists of at minimum, 3 joints: the shoulder, elbow, and wrist. There are also options for 3 twist joints in the upper and lower arm areas. """ nice_name = "Arm" category = "Limbs" base_name = "arm" has_sides = True can_overwrite_names = True joint_mover_file = "resources\\rigging_guides\\arm.ma" mirror_table = {"translateX": -1, "translateY": -1, "translateZ": -1, "rotateX": 1, "rotateY": 1, "rotateZ": 1} # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def _add_metadata(self, network_node, prefix, suffix): super(Arm, self)._add_metadata(network_node, prefix, suffix) network_node.unlock() network_node.addAttr("num_upperarm_twists", min=0, max=3, dv=0, keyable=False) network_node.addAttr("num_lowerarm_twists", min=0, max=3, dv=0, keyable=False) network_node.num_upperarm_twists.set(lock=True) network_node.num_lowerarm_twists.set(lock=True) network_node.lock() # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @property def num_upperarm_twists(self): """ This property holds the number (int) of upperarm twist joints that the module will create or has. example usage: .. code-block:: python arm_inst = arm.Arm() arm_inst.num_upperarm_twists = 2 :return: Number of upperarm twist joints the module has. :rtype: int """ return self.network_node.num_upperarm_twists.get() @num_upperarm_twists.setter def num_upperarm_twists(self, new_number): self.set_twist_joints("num_upperarm_twists", new_number, 0, 3, "_upperarm_twist_0") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @property def num_lowerarm_twists(self): """ This property holds the number (int) of lowerarm twist joints that the module will create or has. example usage: .. code-block:: python arm_inst = arm.Arm() arm_inst.num_lowerarm_twists = 2 :return: Number of lowerarm twist joints the module has. :rtype: int """ return self.network_node.num_lowerarm_twists.get() @num_lowerarm_twists.setter def num_lowerarm_twists(self, new_number): self.set_twist_joints("num_lowerarm_twists", new_number, 0, 3, "_lowerarm_twist_0")