Example #1
0
    def replace_guides(self):
        """
        replaces the guide joints with the actual bound joints.
        :return: <tuple> bound joint array.
        """
        if self.if_guides_exist():
            positions = self.get_guide_positions()
            self.finished_joints = ()

            for name, jnt_array, pos_array in zip(self.names,
                                                  self.guide_joints,
                                                  positions):
                # remove the existing guides
                object_utils.remove_node(jnt_array)

                # set the positions gathered from the guide joints
                self.finished_joints += joint_utils.create_joint(
                    name,
                    num_joints=len(pos_array),
                    prefix_name=self.prefix_name,
                    use_position=pos_array,
                    bound_joint=True,
                    as_strings=True),

                # parent the replaced joints
                if len(self.finished_joints) > 1:
                    object_utils.do_parent(self.finished_joints[-1],
                                           self.finished_joints[-2])

            # set the guide joints to zero
            self.guide_joints = []
Example #2
0
    def replace_guides(self):
        """
        replaces the guide joints with the actual bound joints.
        :return: <tuple> bound joint array.
        """
        if self.if_guides_exist():
            self.guide_positions = self.get_guide_positions()
            self.finished_joints = ()

            # create the joints for this module
            bind_joints = self.create_joints(self.guide_positions,
                                             suffix="bnd")
            fk_joints = self.create_joints(self.guide_positions, suffix="fk")
            ik_joints = self.create_joints(self.guide_positions, suffix="ik")

            # remove the existing guide joints
            object_utils.remove_node(self.guide_joints)

            self.finished_joints += bind_joints
            self.finished_joints += fk_joints
            self.finished_joints += ik_joints

            # set the guide joints to zero
            self.guide_joints = []
            return bind_joints, fk_joints, ik_joints
Example #3
0
 def replace_guides(self):
     """
     replaces the guide joints with the actual bound joints.
     :return: <tuple> bound joint array.
     """
     if self.if_guides_exist():
         positions = self.get_guide_positions()
         object_utils.remove_node(self.guide_joints)
         self.guide_joints = []
         return joint_utils.create_joint(self.name,
                                         prefix_name=self.prefix_name,
                                         num_joints=len(positions),
                                         use_position=positions,
                                         bound_joint=True,
                                         as_strings=True),
Example #4
0
    def create_pivots(self):
        """
        gets the pivot positions.
        :return: <bool> True for success.
        """
        positions = self.get_pivot_positions()
        for pivot_name, position in zip(self.pivot_names, positions):
            # sets the position array to this pivot node.
            object_utils.create_group(pivot_name, position=position)

        # remove the guide pivots
        if self.pivot_locators:
            for piv_loc in self.pivot_locators:
                object_utils.remove_node(piv_loc)
            self.pivot_locators = ()
        return True
Example #5
0
 def replace_guides(self):
     """
     replaces the guide joints with the actual bound joints.
     :return: <tuple> bound joint array.
     """
     self.finished_joints = ()
     if self.if_guides_exist():
         positions = self.get_guide_positions()
         object_utils.remove_node(self.guide_joints)
         for position in positions:
             self.finished_joints += joint_utils.create_joint(
                 self.name,
                 prefix_name=self.prefix_name,
                 use_position=position,
                 bound_joint=True,
                 as_strings=True)[0],
         self.guide_joints = []
Example #6
0
 def remove(self):
     """
     removes the guide joints from the scene.
     :return: <bool> True for success.
     """
     if self.guide_joints:
         for jnt_array in self.guide_joints:
             object_utils.remove_node(jnt_array)
     if self.finished_joints:
         for jnt_array in self.finished_joints:
             object_utils.remove_node(jnt_array)
     if self.built_groups:
         object_utils.remove_node(self.built_groups[0])
     if self.pivot_locators:
         for loc in self.pivot_locators:
             object_utils.remove_node(loc)
     self.finished = False
     self.created = False
Example #7
0
 def remove(self):
     """
     removes the guide joints from the scene.
     :return: <bool> True for success.
     """
     if self.guide_joints:
         object_utils.remove_node(self.guide_joints)
     if self.built_groups:
         object_utils.remove_node(self.built_groups[0])
     if self.finished_joints:
         object_utils.remove_node(self.finished_joints)
     self.finished = False
     self.created = False
Example #8
0
    def remove(self):
        """
        removes the guide joints from the scene.
        :return: <bool> True for success.
        """
        if self.guide_joints:
            for jnt_array in self.guide_joints:
                object_utils.remove_node(jnt_array)
        if self.finished_joints:
            for jnt in self.finished_joints:
                object_utils.remove_node(jnt)
        if self.built_groups:
            for k in self.built_groups:
                print(k)
                if isinstance(k, dict):
                    object_utils.remove_node(k['group_names'][0])
                elif isinstance(k, (str, unicode)):
                    object_utils.remove_node(k)
                elif isinstance(k, (list, tuple)):
                    object_utils.remove_node(k)
                else:
                    object_utils.remove_node(k)

        self.finished = False
        self.created = False