freeze transforms?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  09 September 2010
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.

"He who loves not, is not; he who dreams not, is not."
  09 September 2010
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 );

"He who loves not, is not; he who dreams not, is not."
  09 September 2010
Even though I know a thing about scripting, thanks a lot for sharing with the rest of us, the solution you found.
  09 September 2010
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
set to an ID transform

This is the equivalent of freezing transforms, and fundamentally what the centre operator does.
Come, Join the Cult - Rigging from First Principles
  09 September 2010
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
Society of Digital Artists

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

All times are GMT. The time now is 04:48 AM.

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