Maya Transformations

Hi,

I've read a bunch of posts about maya transformations, specifically getting the transforms (translate, scale, rotate) after freezing transforms. I'm still not clear though on how to approach my problem. Given an object, which may have transforms frozen, I want to take another object and move it into the exact same position, same orientation, and size. I'm not sure how to get the values after freezing transforms. I know Maya has to keep them somewhere (possibly in a concatenated matrix?), because renderman's renderman artists tools produces a concatenated matrix when generating ribs. I would think the concatenated matrix would work for my needs if one exists, because I could just apply it to the other object. Any help is greatly appreciated. This problem has been driving me nuts.

old story ;]

if you freeze transformation, center pivot or move the pivot of a transform object the position shown in the channelBox is not correct anymore. At this actions a offset is given at the localPivot attributes of the transform. You can see this in the AttributeEditor under Pivots.

you can always get the worldspace translation with
CODE
xform -q -t -ws $objName;

Frozen rotation and scale plays hard to get. But at the scale you could take the boundingbox of each object and scale to match them though.

see resetPivot

Well thing is thats the exact point of freezing. To make the transform identity, if you have flushed histroy theres NO WAY TO GET THIS INFORMATION BACK. Its gone, because thats whats the entire idea of freezing premultiply all the transforms to the shape.

This is why rule of 1 is! Unless you know what your doing DO NOT FREEZE ANYTHING

However there are 3 situations whre you may luck out:

  • You still have the history, in wich case just delete the node taht does the freezing
  • You have a point or area to use a s reference, thusis most often happens with blendshapes. To get the transform back snap together the areas that dont have changed and apply a refreeze on everything. MIND you theres no way to automate this task very sanely because to a computer everything is the same. SO its a manual job
  • you happen to othrwise remember the values, in which case you can counter move it freeze and move back (well basically ist athe asme as above but dosent rely on measuring the value)
  • Whoever taught any of you the habit of freezing was a bloody idiot.

    PS everybody's way works only if the objects in question are exactly identical

    Thanks for the replies. One thing I have learned from all of this is, DON"T freeze transforms! I now understand what it does and when to use it.

    boy, people who say "never" do anything scare me as much as people who say "always" do something. The real answer is "understand" what you are doing......

    Umm nobody except you said those two words

    But Paulie is right!

    You just need to know what you are doing! :]
    As long as only the translation is frozen the data is still at the lovalPivot-Attributes! And thats what resetPivot and Naughtys unfreeze is for.
    Its only gone forever if you combine more actions like moving the pivot and then freeze.

    I mean there are cases where freezing is good!

    Yes i said unless you know what your doing (because ods are that anyone who don't understand maths behind 3d don't know what freeze actually does),

    QUOTE(ewerybody @ 05/14/07, 11:16 AM) [snapback]266083[/snapback]
    As long as only the translation is frozen the data is still at the lovalPivot-Attributes!

    Well unfortunately they are not. This contains a assumption local pivots somehow coincidence with the origin of the object (freezing places the roigin at 0 0 0), theres no guarantee of such things for any other object type except joints, the pivot may have allready moved piror to any freeze. There may be circumstances like I outlined above where you can in fact get this information back (considering pivot position 0 is strictly speaking just step 3, your remembering the value).

    However please note:

    The act of freezing is a bit like compressing images to jpeg over and over again because once you do the premutiplication your points get their point vectors multiplied in and that includes some floating point roundups. Now the act of reversing this rounds once more. And theres unfortunately no way to get the data back intact, this causes maya to use vastly more memory on things like blend shapes it can in worst case cause very annoying errors also.

    That is not to say you cant make the objects comparable again, thats close enough but not quite. It just means that any work flow where you end up doing this is inherently flawed. So while you may indeed be able to fix this later on in the game the damages still theree, uless your extremely lucky.

    So if you end up using things like freezing and then subsequently unfreezing that in your wrokflow often theres something wrong with the fundamental way you choose to maintain your data from start up. See storing objects offset from their local center while common is not sane for any further transformation of the objects as the precision diminishes when you get further form the local origin of your object.

    Theres nothing wrong with freezing, if reconfiguring the center of where you want your calculated vectors to come form. But is should only be used for this purpose. IN this case it can be good. Theres however no sane reason for doing this inside Maya aside for fixing some import/export issues. Or just tidying stuff up for some point calculation development. And in these cases moving the origin to where you pivot is can be sane. Even then if you continuously keep doing this over and over for the same model theres something wrong in the underlying thinking.

    BUT
    Freezing shouldnt be used to keep the translation values nice tough, because thats what its mostly erroneously used for. If you want to have a object that says its at 0 but is NOT having its pivot at smack in the middle of the local sapeces origin then you need some other methods for this

    PS just to add a bit:

    the transform values are supposed to reflect where the origin of your object is. But for some reason (well ist so keying rotations would be saner) rotation makes for a exception in this. Wich often leads people to believe that the values are just conveniences. In way it would be better if the developpers of maya really developed a internal way of representing the origin truly separate of the traslate vaues wich most users asume the program is doing (surprise surprise they arent), this way the users would heva ewhat they clearly seek to freeze for aswell as possibility to manage origin separately

    PPS. Unfreeze is a bad name for the operation, it is tha same thing as freeze for all intents except it considers the pivot to be the center of the freeze not local coordinate. Wich is much more intuitive anyway. The side effect is that it can do unfreeze but that shuldnt be considered its main purpose.