Tue, Feb 4, 6:07 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: rotating object


pauldol ( ) posted Wed, 08 June 2011 at 8:04 AM · edited Tue, 04 February 2025 at 1:49 AM

Hello everybody,

I need to rotate an object first around it's Y-axis and then around the X-axis.

To my understanding, rotating around Y-axis corresponds to "twist" and rotating around X-axis corresponds to "bend".

I do rotations in the objects local coordinates and NOT in world coordinates.

My problem is that if I first "twist" then I need to rotate around the NEW rotated relative X-axis and NOT around the initial X-axis.

Hope my question is clear!

Thank you in advance,

Paul


LaurieA ( ) posted Wed, 08 June 2011 at 8:30 AM

Do you mean an object attached to a figure or just a standalone object? Poser suffers from a severe case if gimbal lock. Sure wish the powers that be would fix that ;).

Laurie



nruddock ( ) posted Wed, 08 June 2011 at 3:25 PM

Quote - Poser suffers from a severe case of gimbal lock. Sure wish the powers that be would fix that ;)

Can't be fixed, it's an inherent problem of using Euler angles for rotation. One solution to the OP's problem is to parent the item to an invisible prop, and use it to provide the X rotation, and the original prop for Y rotation.


pauldol ( ) posted Thu, 09 June 2011 at 12:05 PM

Quote - Do you mean an object attached to a figure or just a standalone object? Poser suffers from a severe case if gimbal lock. Sure wish the powers that be would fix that ;).

Laurie

 

I use from the poser library: Poser8->Additional Figures-> Hands->RightHand

I guess RightHand is a figure.

However it has many parts: e.g. rThumb1,rIndex0 etc

One of the parts is called "Right Hand". I rotate this object.

I also noticed maybe a bug?

when I execute this command: rightHandActor.SetParameter("Side-Side", -45);

and rightHandActor.SetParameter("Bend", -45); it works fine.

But when I try to alter the "Twist" parameter:

rightHandActor.SetParameter("Twist", -45); it doesn't rotate the object.

I also use scene.DrawAll() but still no effect.

 

Any ideas???

 

Thank you!

Paul


nruddock ( ) posted Thu, 09 June 2011 at 3:51 PM

Some actors may be locked, or have limits set in such a way that effectively prevent rotation.

This is normal for rotation axes that are unnatural for human joints.


LaurieA ( ) posted Thu, 09 June 2011 at 3:58 PM

Yes, nruddock has a point. A wrist doesn't twist on it's own. The forearm twists, but not the wrist joint itself. Check the file menu at (and since I don't have it open, atm - I'm guessing. I think it's under figure) Figure/Limits or Set Limits. If that's checked, there will be certain things that you can't do with a joint like a bend or a twist that can't be done to the real joint :). If you still want to twist the hand anyway, uncheck the Limits.

Laurie



nruddock ( ) posted Thu, 09 June 2011 at 6:23 PM

Quote - Check the file menu at (and since I don't have it open, atm - I'm guessing. I think it's under figure) Figure/Limits or Set Limits. If that's checked, there will be certain things that you can't do with a joint like a bend or a twist that can't be done to the real joint :). If you still want to twist the hand anyway, uncheck the Limits.

Some limits may be "forced" by a setting in the CR2.
To change that you have to edit the file.


markschum ( ) posted Thu, 09 June 2011 at 10:25 PM

If limits are forced you can not turn them off without editing the cr2 file BUT you can often alter the limit values, which lets you use whatever settings you want.


pauldol ( ) posted Sat, 11 June 2011 at 10:03 AM

Quote - Some actors may be locked, or have limits set in such a way that effectively prevent rotation.

This is normal for rotation axes that are unnatural for human joints.

 

Thanks for the reply.

The problem is that if I manually try to "Twist" through tha palette then it works!

If I try to twist it using python then it has the problem.

But I found a way to make it work.

Here is the code:

rightHandActor = scene.Actor("Right Hand");
parmTwist = rightHandActor.ParameterByCode(poser.kParmCodeXROT);
parmTwist.SetValue(-22.5);


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.