Forum: Poser Python Scripting


Subject: Please help...Whats this error?

Josiah opened this issue on Nov 10, 2002 ยท 5 posts


stewer posted Mon, 11 November 2002 at 12:33 PM

An optimization tip: Try to do as few Poser function calls inside the loop as possible, keep your stuff in arrays. You won't notice much of a difference in the example of a simple sphere, but things will add up on larger models with thousands of polygons. #--------------------- scene = poser.Scene() actor1 = scene.Actor("sphere01") geom1 = actor1.Geometry() numVerts = geom1.NumVertices() verts1 = geom1.Vertices() actor2 = scene.Actor("sphere02") geom2 = actor2.Geometry() verts2 = geom2.Vertices() for i in range(numVerts): ~ vert = verts2[i] ~ targetX = vert.X() ~ targetY = vert.Y() ~ targetZ = vert.Z() ~ vert = verts1[i] ~ vert.SetX(targetX) ~ vert.SetY(targetY) ~ vert.SetZ(targetZ) actor.MarkGeomChanged() scene.DrawAll()