freeze transforms?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2010   #1
Question freeze transforms?

Hi all,

I can't seem to find any way in the API for Softimage 2010 to freeze the transforms on an object. I can freeze the modeling operators like so (in C#):

GetXSI().ExecuteCommand( "FreezeObj", new object[] { obj.Name } );

But this doesn't freeze the transforms applied in local kinematics. I can do it in the user interface just by clicking Transform->Freeze All Transforms, (which creates a Center operator,) but how can I do this via the API?

Thank you for any input.

Kevin
__________________
"He who loves not, is not; he who dreams not, is not."
 
Old 09 September 2010   #2
freezing transforms

Ok, I figured it out, although it is a bit roundabout.

Freezing transforms, as I knew, actually creates a Center operator. It seems the only way to freeze transforms is to manually create that Center operator. To create the operator:

var centerOp = (Operator)GetXSI().ExecuteCommand( "ApplyOperator", new object[] { "CenterManip", obj.Name } );

Then we need to set its parameters. As a shortcut to gain access to them:

var opParams = centerOp.Parameters;

If you actually want to duplicate the behaviour of "Freeze All Transforms" you'd have to access the local kinematics and take the transform parameters out of that and put them into the Center operator and then reset them in local kinematics. A bit tricky due to rotation order.

In my case I only wanted to apply specific transforms, so, for instance, to scale 10x in the Z direction:

opParams["sclz"].set_Value( null, 10 );

Cheers,
Kevin
__________________
"He who loves not, is not; he who dreams not, is not."
 
Old 09 September 2010   #3
Even though I know a thing about scripting, thanks a lot for sharing with the rest of us, the solution you found.
__________________
ULTRADIGITAL.PT | C4D Tutorials
 
Old 09 September 2010   #4
For future reference:
If you want to freeze the transforms of an object, it's basically equivalent to multiplying the points for its transform, then resetting the transform to 0.
This requires a frozen stack in run-once form, or you can write and apply it at any point in operator form.

The operation is trivial:
for each point in the mesh:
multiply pointposition vector by kine.global.transform
set kine.global.transform to an ID transform

This is the equivalent of freezing transforms, and fundamentally what the centre operator does.
__________________
Come, Join the Cult http://www.cultofrig.com - Rigging from First Principles
 
Old 09 September 2010   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:44 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.