当前位置: 首页>>代码示例>>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;未经允许,请勿转载。