MetaDataManager.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Modular_Rigging_Thesis 作者: LoganKelly 项目源码 文件源码
def enterRigEditMode(self,*args):
        self.versionComboBox.setEnabled(False)
        newRig = args[0]
        global g_rigEditModeFileName
        global xmlPath
        global rootNode
        projectDir = cmds.workspace(q=True,rd=True)
        #remove the HUD item at (2,0) if one is present
        cmds.headsUpDisplay(rp=(2,2))
        #add our HUD item for the rig edit mode
        cmds.headsUpDisplay("",s=2,b=2,ba="center",lfs="large",dw=50,l="Rig Edit Mode")

        tempDir = mel.eval("getenv TEMP;")
        #get the path to the XML file and save it for later use
        if newRig is False:
            current = self.rigList.currentItem()
            rootNode = "MRN_"+current.text()
            xmlPath = cmds.getAttr(str(rootNode+".xmlPath"))
            #write over temporary rig file
            shutil.copy(xmlPath, tempDir+"/rigTemp.xml")
            xmlPath = tempDir+"/rigTemp.xml"
        else:
            rootNode = ""
            xmlPath = ""


        #save the scene to a file, and load a new, empty scene


        g_rigEditModeFileName = cmds.file(q=True,sceneName=True)
        if g_rigEditModeFileName == "":
            cmds.file(rn=tempDir+"\\rigModeTemp.ma")
        cmds.file(f=True,save=True,type="mayaAscii")
        cmds.file(f=True,new=True)

        #load the rig file into the current scene
        if newRig is False:
            commandString = "loadRig -p \""+xmlPath+"\";"
            rigName = mel.eval(commandString)


        self.refreshListWidget()
        self.addRigBtn.setEnabled(False)
        self.updateAllBtn.setEnabled(False)
        self.enterRigEditBtn.setEnabled(False)
        self.rigList.setEnabled(False)
        self.createRigBtn.setEnabled(False)
        self.openNodeBtn.setEnabled(True)
        self.exitRigEditBtn.setEnabled(True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号