Example #1
0
    def getSkinDatas(self):

        """
        !@Brief Get Skin datas on selected object.
        add SkinTools instance in list for set in ui
        """

        #   Get maya nodes
        maya_nodes = pmc.selected()
        if not maya_nodes:
            raise RuntimeError("\n\tNothing is selected !!!\n")

        #   Clean List
        self.clearList()

        #   Get skin and instance
        skin_instances = []
        for maya_node in maya_nodes:

            skin_instance = SkinTools(maya_node)

            if not skin_instance.SKIN_NODE:
                continue

            if not isinstance(skin_instance.SKIN_NODE, basestring):
                skin_instance.datasInNotes()

            skin_instances.append(skin_instance)

        self.addItemToList(skin_instances, 0, heigth=30)
Example #2
0
    def restoreByFile(self):

        """
        !@Brief  Restore skin from files.
        add SkinTools instance in list for set in ui.
        """

        #   Get files path
        files_path = file_manage.FileChoser(text='Select Skin File', extension='skin')
        if not files_path:
            raise RuntimeError("\n\tNo files path selected !!!\n")

        #   Restore skin and instance
        for file_path in files_path:
            skin_instance = SkinTools.restoreByFile(file_path)
            self.addItemToList([skin_instance], 0, heigth=30, clear_datas=False)