Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
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!
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
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
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