MCPcopy Create free account
hub / github.com/ImageEngine/cortex / writeWalk

Method writeWalk

test/IECoreScene/SceneCacheTest.py:188–203  ·  view source on GitHub ↗
( m )

Source from the content-addressed store, hash-verified

186 r = imath.Rand48()
187
188 def writeWalk( m ) :
189
190 if m.name() != "/" :
191 if r.nextf( 0.0, 1.0 ) < 0.5 :
192 m.writeObject( IECoreScene.SpherePrimitive( r.nextf( 1.0, 4.0 ) ), 0.0 )
193
194 if r.nextf( 0.0, 1.0 ) < 0.5 :
195 t = imath.V3d( r.nextf(), r.nextf(), r.nextf() )
196 m.writeTransform( IECore.M44dData( imath.M44d().translate( t ) ), 0.0 )
197
198 thisDepth = int( r.nextf( 1, 4 ) )
199 if thisDepth > len(m.path()) :
200 numChildren = int( r.nextf( 4, 50 ) )
201 for i in range( 0, numChildren ) :
202 mc = m.createChild( str( i ) )
203 writeWalk( mc )
204
205 m = IECoreScene.SceneCache( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Write )
206 writeWalk( m )

Callers

nothing calls this directly

Calls 8

lenFunction · 0.50
strFunction · 0.50
nameMethod · 0.45
writeObjectMethod · 0.45
SpherePrimitiveMethod · 0.45
writeTransformMethod · 0.45
pathMethod · 0.45
createChildMethod · 0.45

Tested by

no test coverage detected