Forum: Poser Python Scripting


Subject: rotating object

pauldol opened this issue on Jun 08, 2011 · 9 posts


pauldol posted Wed, 08 June 2011 at 8:04 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);