Forum: Poser Python Scripting


Subject: Applying a pose

Borkum opened this issue on Nov 23, 2002 ยท 4 posts


Borkum posted Sat, 23 November 2002 at 6:41 AM

I've tried applying a pose to a figure by using scene.LoadLibraryPose but when I grab the vertices from the actor geometries they haven't changed from the default position. Is there something I am missing? Why don't the vertices positions reflect the pose of the figure? Thanks, Michael


Josiah posted Mon, 25 November 2002 at 7:50 AM

If I am not mistaken in what you are saying, I ran into this when I tried to create a script that moved the vertices of a figures bent elbow objects into alignment with an ideally shaped bent elbow object made in 3dsmax. I used this approach because it is hard to create a morph on a straight peice that looks the way you want it when bent. Anyway, instead of moving the vertices of the mesh I saw in the scene, it moved the verts from the "original" object which in turn doubled the bend! It seems that the Poser keeps two versions of the object meshes, the original object and the modified "virtual" object you see in the scene.I believe Poser creates a new pose or new morph by moving the vertices you see in the scene(not the ones in the base object). However when you try to get a vertex coordinates, Poser wants to give you the ones of the unaltered base object and not of the "virtual" one you see in the scene. I can't say I know away around this. I wish I did! If I am off base here on what you mean, this script will load a pose; ####################################################### scene = poser.Scene() scene.LoadLibraryFigure("Runtime:Libraries:character:People:Business Man.cr2") scene.LoadLibraryPose("Runtime:Libraries:Pose:Action Sets:Stalker.pz2") scene.DrawAll() ####################################################### (paths for Poser 4, 4 lines of code, all start with "scene"). I hate these little reply boxes!


Borkum posted Mon, 25 November 2002 at 9:58 AM

You nailed the problem exactly. I want the "altered" vertices - not the unmodified ones that Poser wants to give me. Guess I'll have to keep digging to see if I can find a way to do this. Thanks, Michael


Josiah posted Mon, 25 November 2002 at 1:09 PM

This is frustrating because the info must exist, but we can't get to it. Without this, a method of collision detection via python wouldn't be possible. I tried "WorldVertex()" also and got the same results as with "Vertex()". I tried each method with the casual business man using this script; ########################################### scene = poser.Scene() actor = scene.Actor("Left Forearm") geom = actor.Geometry() vertMS = geom.Vertex(22) vertWS = geom.WorldVertex(22) print "model position: ", vertMS.X(), vertMS.Y(), vertMS.Z() print "world position: ", vertWS.X(), vertWS.Y(), vertWS.Z() v = actor.Parameter("Bend") v.SetValue(-100) print "moved model position: ", vertMS.X(), vertMS.Y(), vertMS.Z() print "moved world position: ", vertWS.X(), vertWS.Y(), vertWS.Z() ########################################### This script prints out the model space and world space xyz coordinates of vertex #22 in the left forearm before and after the forearm is moved. In each case, the locations remain the same. If you do figure out a solution to this, please post it! josiah