本文整理汇总了Python中GafferSceneTest.traverseScene方法的典型用法代码示例。如果您正苦于以下问题:Python GafferSceneTest.traverseScene方法的具体用法?Python GafferSceneTest.traverseScene怎么用?Python GafferSceneTest.traverseScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GafferSceneTest
的用法示例。
在下文中一共展示了GafferSceneTest.traverseScene方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __writeScene
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def __writeScene( self, script, args ) :
import GafferScene
import GafferSceneTest
scene = script.descendant( args["scene"].value )
if isinstance( scene, Gaffer.Node ) :
scene = next( ( x for x in scene.children( GafferScene.ScenePlug ) ), None )
if scene is None :
IECore.msg( IECore.Msg.Level.Error, "stats", "Scene \"%s\" does not exist" % args["scene"].value )
return
if args["preCache"].value :
GafferSceneTest.traverseScene( scene )
memory = _Memory.maxRSS()
with _Timer() as sceneTimer :
with self.__performanceMonitor or _NullContextManager(), self.__contextMonitor or _NullContextManager() :
with Gaffer.Context( script.context() ) as context :
for frame in self.__frames( script, args ) :
context.setFrame( frame )
GafferSceneTest.traverseScene( scene )
self.__timers["Scene generation"] = sceneTimer
self.__memory["Scene generation"] = _Memory.maxRSS() - memory
示例2: computeScene
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def computeScene() :
with self.__context( script, args ) as context :
for frame in self.__frames( script, args ) :
context.setFrame( frame )
if args["sets"] :
GafferScene.SceneAlgo.sets( scene, args["sets"] )
else :
GafferSceneTest.traverseScene( scene )
示例3: computeScene
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def computeScene() :
with self.__context( script, args ) as context :
for frame in self.__frames( script, args ) :
context.setFrame( frame )
if isinstance( scene, GafferDispatch.TaskNode.TaskPlug ) :
context["scene:render:sceneTranslationOnly"] = IECore.BoolData( True )
scene.execute()
else :
if args["sets"] :
GafferScene.SceneAlgo.sets( scene, args["sets"] )
else :
GafferSceneTest.traverseScene( scene )
示例4: testThreading
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def testThreading(self):
sphere = IECore.SpherePrimitive()
instanceInput = GafferSceneTest.CompoundObjectSource()
instanceInput["in"].setValue(
IECore.CompoundObject(
{
"bound": IECore.Box3fData(IECore.Box3f(IECore.V3f(-2), IECore.V3f(2))),
"children": {
"sphere": {
"object": sphere,
"bound": IECore.Box3fData(sphere.bound()),
"transform": IECore.M44fData(IECore.M44f.createScaled(IECore.V3f(2))),
}
},
}
)
)
seeds = IECore.PointsPrimitive(
IECore.V3fVectorData([IECore.V3f(1, 0, 0), IECore.V3f(1, 1, 0), IECore.V3f(0, 1, 0), IECore.V3f(0, 0, 0)])
)
seedsInput = GafferSceneTest.CompoundObjectSource()
seedsInput["in"].setValue(
IECore.CompoundObject(
{
"bound": IECore.Box3fData(IECore.Box3f(IECore.V3f(1, 0, 0), IECore.V3f(2, 1, 0))),
"children": {
"seeds": {
"bound": IECore.Box3fData(seeds.bound()),
"transform": IECore.M44fData(IECore.M44f.createTranslated(IECore.V3f(1, 0, 0))),
"object": seeds,
}
},
}
)
)
instancer = GafferScene.Instancer()
instancer["in"].setInput(seedsInput["out"])
instancer["instance"].setInput(instanceInput["out"])
instancer["parent"].setValue("/seeds")
instancer["name"].setValue("instances")
GafferSceneTest.traverseScene(instancer["out"])
示例5: __printScene
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def __printScene(self, script, args):
import GafferScene
import GafferSceneTest
scene = script.descendant(args["scene"].value)
if isinstance(scene, Gaffer.Node):
scene = next((x for x in scene.children(GafferScene.ScenePlug)), None)
if scene is None:
IECore.msg(IECore.Msg.Level.Error, "stats", 'Scene "%s" does not exist' % args["scene"].value)
return
memory = _Memory.maxRSS()
with _Timer() as sceneTimer:
with self.__performanceMonitor or _NullContextManager():
GafferSceneTest.traverseScene(scene)
self.__timers["Scene generation"] = sceneTimer
self.__memory["Scene generation"] = _Memory.maxRSS() - memory
示例6: testAlembicThreading
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def testAlembicThreading( self ) :
mesh = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -1 ), imath.V2f( 1 ) ) )
fileName = self.temporaryDirectory() + "/test.abc"
root = IECoreScene.SceneInterface.create( fileName, IECore.IndexedIO.OpenMode.Write )
root.writeBound( imath.Box3d( mesh.bound() ), 0 )
for i in range( 0, 1000 ) :
child = root.createChild( str( i ) )
child.writeObject( mesh, 0 )
child.writeBound( imath.Box3d( mesh.bound() ), 0 )
del root, child
sceneReader = GafferScene.SceneReader()
sceneReader["fileName"].setValue( fileName )
for i in range( 0, 20 ) :
sceneReader["refreshCount"].setValue( sceneReader["refreshCount"].getValue() + 1 )
GafferSceneTest.traverseScene( sceneReader["out"] )
示例7: testNameClashesWithThreading
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def testNameClashesWithThreading( self ) :
sphere = IECoreScene.SpherePrimitive()
input1 = GafferSceneTest.CompoundObjectSource()
input1["in"].setValue(
IECore.CompoundObject( {
"bound" : IECore.Box3fData( sphere.bound() ),
"children" : {
"myLovelyObject1" : {
"bound" : IECore.Box3fData( sphere.bound() ),
"object" : sphere,
},
},
} ),
)
plane = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( -1 ), imath.V2f( 1 ) ) )
input2 = GafferSceneTest.CompoundObjectSource()
input2["in"].setValue(
IECore.CompoundObject( {
"bound" : IECore.Box3fData( plane.bound() ),
"children" : {
"myLovelyObject1" : {
"bound" : IECore.Box3fData( plane.bound() ),
"object" : plane,
},
},
} ),
)
group = GafferScene.Group()
group["name"].setValue( "topLevel" )
group["in"][0].setInput( input1["out"] )
group["in"][1].setInput( input2["out"] )
GafferSceneTest.traverseScene( group["out"] )
示例8: traverser
# 需要导入模块: import GafferSceneTest [as 别名]
# 或者: from GafferSceneTest import traverseScene [as 别名]
def traverser() :
try :
GafferSceneTest.traverseScene( g["out"] )
except Exception, e :
exceptions.append( e )