當前位置: 首頁>>代碼示例>>Python>>正文


Python Source.addKeyableAttrs方法代碼示例

本文整理匯總了Python中source.Source.addKeyableAttrs方法的典型用法代碼示例。如果您正苦於以下問題:Python Source.addKeyableAttrs方法的具體用法?Python Source.addKeyableAttrs怎麽用?Python Source.addKeyableAttrs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在source.Source的用法示例。


在下文中一共展示了Source.addKeyableAttrs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from source import Source [as 別名]
# 或者: from source.Source import addKeyableAttrs [as 別名]

#.........這裏部分代碼省略.........
        Places the model in place of the bounding
        box and applies cached positioning if available
        """
        standIn = self.getStandInFromSelection()
        standIn.focus()

    def saveState(self, *args):
        """
        Saves snapshot and any keyed info
        to standin
        """
        standIn = self.getStandInFromSelection()
        standIn.save()

    def cacheStandin(self, startFrame=False, endFrame=False, *args):
        """
        Iterates through all the frames in the
        current range saving all the selected attributes
        to a json cache file
        """
        standIn = self.getStandInFromSelection()
        standIn.focus()
        if isinstance(startFrame, int):
            standIn.cache(startFrame, endFrame)
        else:
            standIn.cache()

    def duplicateStandin(self, *args):
        """
        Duplicate the selected standin
        """
        standIn = self.getStandInFromSelection()
        newStandin = standIn.duplicate()

    def deleteItem(self, *args):
        """
        Deletes the standin and removes references
        """
        standIn = self.getStandInFromSelection()
        standIn.delete()

    def selectAll(self, *args):
        """
        Select every standin in the current scene
        """
        pm.select(self.coreNode.children)

    def applyMeshes(self, keyFrame=False):
        """
        Iterates through every standin found in
        the scene and replaces it with the meshes
        (run during render)
        """
        if not keyFrame:
            keyFrame = int(pm.currentTime(q=1))
        startTime = datetime.now()
        self.coreNode.applyMeshes(keyFrame)

        execTime = datetime.now() - startTime
        print("applied in %s ms"%execTime)

    def deleteMeshes(self, *args):
        """
        Deletes all the temporary stand-in meshes
        for the scene
        """
        self.coreNode.deleteMeshes()

    def appendNewKeys(self, source, newAttrs):
        """
        Appends keys from selected nodes to standin
        """
        # select the source
        pm.select(source)
        # load the source data
        self.load()
        self.source.addKeyableAttrs(newAttrs)

    def createUI(self):
        """
        Creates the interaction Gui
        """
        self.gui = Gui(
            setup=self.setup,
            load=self.load,
            generate=self.generate,
            delete=self.deleteItem,
            duplicate=self.duplicateStandin,
            editCurrent=self.focusModel,
            saveCurrent=self.saveState,
            selectChildren=self.selectChildren,
            cacheSelected=cacheStandin,
            appendKeys=self.appendNewKeys
        )

    def setupCoreNode(self):
        """
        Moved to coreNode.py class
        """
        self.coreNode = CoreNode()
開發者ID:campbellwmorgan,項目名稱:charactercrowd,代碼行數:104,代碼來源:characterCrowd.py


注:本文中的source.Source.addKeyableAttrs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。