本文整理汇总了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()