Wed, Dec 25, 1:31 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Moving magnets...


Josiah ( ) posted Sat, 16 November 2002 at 2:57 PM · edited Mon, 04 November 2024 at 6:53 AM

Ok, here I am again; I create a ball prop, then I run this script on it. The center of the magnet base should move to the vertex defined as "vert" (the ball prop has 162 verts). The problem is, it dosent seem to work! I use the print statments to show the mag bases before and after origin, and it DOES move! Something screwy with the coordinate systems I am using, do I need to get the verts coordinates in another way, such as "world"? How can this be done? #################################### scene = poser.Scene() actor = scene.CurrentActor() geom = actor.Geometry() vert = geom.Vertex(100) # vertex no. 100 scene.CreateMagnet() actor = scene.Actor("Mag Base 1") print "before origin", actor.Origin() actor.SetOrigin(vert.X(), vert.Y(), vert.Z()) print "after origin", actor.Origin() scene.DrawAll() #################################### Thanks once again to the wise sages of this forum for any help they might be able to provide! josiah


ockham ( ) posted Sat, 16 November 2002 at 4:17 PM

You're beyond my territory here! One thing you might try: just before DrawAll, use GeomChanged() on all the actors you've affected.

My python page
My ShareCG freebies


ockham ( ) posted Sat, 16 November 2002 at 4:17 PM

Oops, I mean MarkGeomChanged().

My python page
My ShareCG freebies


Josiah ( ) posted Sat, 16 November 2002 at 8:30 PM

Ok, I found that the origin was moving correctly, but the "origin of an object is not it's location in 3d space but a reference to its own center! So by moving the origin, I am just moveing the point about which transforms occur, not the object itself!


ockham ( ) posted Sun, 17 November 2002 at 11:50 AM

Try WorldDisplacement instead of Origin. In my experience, W-D gives the proper actual position for most things.

My python page
My ShareCG freebies


Privacy Notice

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.