本文整理汇总了Python中Red9.core.Red9_Meta.registerMClassNodeCache方法的典型用法代码示例。如果您正苦于以下问题:Python Red9_Meta.registerMClassNodeCache方法的具体用法?Python Red9_Meta.registerMClassNodeCache怎么用?Python Red9_Meta.registerMClassNodeCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Red9.core.Red9_Meta
的用法示例。
在下文中一共展示了Red9_Meta.registerMClassNodeCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _iterate_
# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import registerMClassNodeCache [as 别名]
def _iterate_(self):
self.call2_func = self.test2_func
for i in range(self.int_targetCount):
self.progressBar_set(status = ("Pass 1: Substantiating Call %i"%i), progress = i, maxValue = self.int_targetCount)
#string = mc.joint(n = "obj_{0}".format(i))
string = mc.createNode('network',n = "obj_{0}".format(i))
#string = mc.createNode('transform',n = "obj_{0}".format(i))
t1 = time.clock()
n1 = self.test1_func(string)
t2 = time.clock()
self.l_times_1.append(t2-t1)
r9Meta.registerMClassNodeCache(n1)
t1 = time.clock()
#self.l_roots_2.extend( [self.test2_func(self._toCall)] )
self.call2_func(n1.mNode)
t2 = time.clock()
self.l_times_2.append(t2-t1)
示例2:
# 需要导入模块: from Red9.core import Red9_Meta [as 别名]
# 或者: from Red9.core.Red9_Meta import registerMClassNodeCache [as 别名]
#>>How are they different? =========================================================================
#Take a moment to select each node and look at their user attributes in the attribute editor
#You'll notice that our meta call created node has several user attributes
mc.listAttr(o1.mNode, userDefined = True)
mc.listAttr(n1.mNode, userDefined = True)
#>>Caching =========================================================================
r9Meta.printMetaTypeRegistry()#...this is a list of the kinds of maya nodes registered for creation and searching
r9Meta.printSubClassRegistry()#...this is a list of metaClass subclasses registered in memory.
#One of the main benefits of meta nodes is that they may be cached for speed. Let's look at the cache.
r9Meta.printMetaCacheRegistry()#...one of our nodes is cached, one is not
r9Meta.registerMClassNodeCache(o1)#...let's push our cmd created node into the cache
r9Meta.printMetaCacheRegistry()#...now it is cached with it's dag handle
r9Meta.resetCache()
r9Meta.printMetaCacheRegistry()#...returns a list of cached nodes. It will most likely be empty
#>>Conversion =========================================================================
#...The wrong way....
n1.mClass = 'cgmNode'#let's try changing our mClass and...
n1 = r9Meta.MetaClass('callCreated')#...reinstantiating it
n1#...hmmm, still returns okay as it was cached. Note the mClass attr in the result doesn't match the class type
#...add an mClass attribute to an uncached node