Maybe somebody can help explain what is going on in a scene. I have an object parented to another object. The parent, in this example, a box, has some keys on it making the box move up and down. The child, a ball sitting inside the box, follows along with the box. Now I add some keys to the ball which make the ball bounce up and down in the box. Now, at frame 0, if I unparent the ball, then re parent it to the box, everything seems to behave normally. If I move to a frame where the ball is in the air, and unparent it, then reparent it to the box, and hit play, the ball flies off to some strange location. Why does this happen? I know "Don't un parent the ball bla bla ba..." This is just an example to reproduce what is happening. Any ideas what is going on, and how I could re parent the ball without the wacky result?
Child's transformation values are relative to parent's coordinate space. When you unparent something it's transformation values stay the same but are intrepreted inside different ( global ) coordinate space thus yielding different end result. Unless ofcourse you enable "preserve position" in unparenting options. Understanding how maya dag graphs work is useful here ( search documentation )
Note that you can't animate parenting. Object it either parented or not. You can't have it parented on frame 1 and not-parented on frame 10. If you need this kind of behaviour - use parent constraints.
QUOTE(failure @ 11/15/05, 06:29 PM)
Child's transformation values are relative to parent's coordinate space. When you unparent something it's transformation values stay the same but are intrepreted inside different ( global ) coordinate space thus yielding different end result. Unless ofcourse you enable "preserve position" in unparenting options. Understanding how maya dag graphs work is useful here ( search documentation )
Note that you can't animate parenting. Object it either parented or not. You can't have it parented on frame 1 and not-parented on frame 10. If you need this kind of behaviour - use parent constraints.
[snapback]219778[/snapback]
Thanks for the reply. I will give "preserve position" a try tomorrow. It is still hard for me to understand. I figured it was all relative to the parents "world" but it confuses me because if I unparent and re parent on certain frames, it does not exhibit this strange behavior, when I would expect it on all frames. By the way, I actually don't need it to animate. Thanks again.
Just an update...
I guess I was already using "preserve position". That does keep the object in the current location but here is the problem I am having. If you look at the translate values before unparenting, then unparent, and re parent, the values are different now. The thing I don't understand is that this makes no difference if there are no keys on the child. Even though the values are different, it still sits in the same place relative to the parent throughout the animation. However, if there are keys, even if the curves are flat, meaning that the child does not move anywhere relative to the parent, when unparenting and reparenting, the values are once again different, but this time the child flies off into space. Any ideas?
invest some time in reading the besics of basics regardinghierarchy. THeres nothing wierd in this behaivour.
- because keyframes supercede everything else, keyframes dont reside on the object so they wont be afffected by unparentting. KAyframes are allways set in LOCAL SPACE ulkess constrained otherwise.
you can observethe same thing by moving any object and then changing time, that is if autokeyframes are off. you seem to have them on se 3.
- Maya does asume your manipulations are final untill yous start playbak, at wich point maya refreshes the data from your anim curve.
3, Now if you have atokeyframe on then what happens is it gets parentted allright but it gets also keyed with new values for the new position also (maya does not care HOW the values got changed anyy change maya keys them) thius maya will interpolate between theese 2 points.
Use part consytraints tehts what they are there for.
QUOTE(Joojaa @ 11/16/05, 06:42 AM)
invest some time in reading the besics of basics regardinghierarchy. THeres nothing wierd in this behaivour.
- because keyframes supercede everything else, keyframes dont reside on the object so they wont be afffected by unparentting. KAyframes are allways set in LOCAL SPACE ulkess constrained otherwise.
you can observethe same thing by moving any object and then changing time, that is if autokeyframes are off. you seem to have them on se 3.
- Maya does asume your manipulations are final untill yous start playbak, at wich point maya refreshes the data from your anim curve.
3, Now if you have atokeyframe on then what happens is it gets parentted allright but it gets also keyed with new values for the new position also (maya does not care HOW the values got changed anyy change maya keys them) thius maya will interpolate between theese 2 points.
Use part consytraints tehts what they are there for.
[snapback]219830[/snapback]
Actually, I know my autokeyframe is off and is off during the unparenting and parenting. Also, when the reparenting happens with the keyframes, the reason for the shift is that it keeps, not changes, the same values as before. For example, if translate x was 3 before unparenting, and 1 when unparented, when reparented, it will be something like 2. Now the keys value didn't change so when it updates during playback, it is obviously going to be set to 3! But to be in the same location as when it was reparented, it needs to be 2. But, the real issue is this...Why when I reparent the object did it go from translateX being 3 to being 2? I realize everyone will say, use parent constraints or whatever but that won't work in what I am trying to accomplish. I have scenes which have been already set up by somebody else and need to have this parent unparent stuff done to it. I understand if nobody can get it to work, I was just wondering if anybody happened to know how to do it. Thanks!
parent contsrain canb do all the things parent can. NAyawy i cant replicate the shooting of no matter whgat stupidity i try!
Offcourse the values change... because the local space is different your reading the local values. if the value wouldnt chnage the object would move. Thats why ist called parentting!
Anyway could you kindy explain what your after then if parent contraints cant do it!
PS ill draw you a picture... but i can only help you understand i cant make you smarter ![]()
QUOTE(Joojaa @ 11/16/05, 08:45 AM)
parent contsrain canb do all the things parent can. NAyawy i cant replicate the shooting of no matter whgat stupidity i try!
Offcourse the values change... because the local space is different your reading the local values. if the value wouldnt chnage the object would move. Thats why ist called parentting!
Anyway could you kindy explain what your after then if parent contraints cant do it!
[snapback]219847[/snapback]
Actually they can't in this situation. The reason being, like I said before, this is a scene that has already been set up with animation on the child object. So the moment I unparent it, there is a problem. The reason being, like you said, the local space is different but the keys remain the same. So if the key says to be at position 100 and the object is at position 100 while parented, and position 1 when unparented, the animation will obviously shoot off during playback. So the logical thing would be to reparent it back up, however this makes the position not 100 but something like 70. The main thing I am after...
A ball is parented to a box which is parented to a characters hand. The characters hand is animated which moves the box up and down. The object parented to the box has translate and rotate keys on it. However, the person used the wrong object. The real object needs to be put into the correct location with the correct keys. I realize that it can be parented to the old ball and the old ball hidden, but, there are a box full of items with this problem and many scenes. We don't want double the crap in the scene. Besides, if somebody decides the replacement objects need to change again, we could have triple the crap in the scene. I know there is a reference file but no thanks.
400) {this.resized=true; this.width=400; this.alt='Click here to open new window';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(this.resized) {window.open('http://www.hut.fi/~joojala2/highend/simpleVectorParentLinkage.png');}" />
okay here goes Imagine trsanslates for simplicity. NOW observe a tranform nodes numaric values are ALLWATYS LOCAL because if they werent then the entire idea of parentting would be moot)
now observe the red arrows wich describe the worldspace cordinates of objects
NOW observe thet the parent obejects space is turned 45 degrees now the translate in that objects space would be the blue arrow. NOW inorder for the combination of parent worldvector plus the blue child likage to describe the same AS the worldsoace vector the NUMBERS mus be different inorder for you to get to the same point. IF they werent then they would ddescribe two different places in space! You undesratnd? infac it wuld be below the worldspace or somewhare way higher depending on wich way you parent.
Still dont know of any reason why you couldnt use part condtyraint (unless you have a object that rotates many times artound some axis every frame. IN thsi case i suggetst o make on extra hirqarchy so tha selfrotation is fixed in one place)... note rendering such thisngs isnt any easier if you didnt have this problem to begin with! Even then parent constraint is the best bet.
Se parent constraint is like parent but with the knowlege of whan to switch!
How can I post a simple scene to show what I mean? Because sometimes, the values are the same, and sometimes they are different depending on the frame it takes place. Thanks for your explanation Jooja. I thought I understand that stuff which is why this scene is so confusing to me.
okay thats actualy kindof tricky bot doable. What you do is you use a parent contraint on a dummy locator thats in teh terget space then bind a objectto that you can now hide the original oblject (note if tahret space is subsequntly to move dont move it yet, or use a dummy space). Also you may wish to bake the animation out. NOw if you need to switch the animation to that animatin moidoi way you can easily do thsi by blending the wo anims together!
now taht io think of it if this parenting is a one time action tehn you could do a extra tarnsfrm in between that countermoves so you end up in teh same psoittion as before without changeing the anim curves!
Good thought. Would the best way to do that be to read the transform before, and after and do the math or is there some way using matrix? I really don't know much about matrix stuff. Thanks for the help.
I must admit I don't really understand where's the problem. If you just need to replace the object then unparent the exsiting shape from the transform node and parent a new shape to it.
Often when explaining hierarchies people tend to simplify things by covering only the translation part which is really straightforward. Issues are mostly caused by rotation and scaling
Suppose we have 3 transform nodes T1, T2, T3 each definig its own local space using respective transformation matrices M1, M2, M3. Now if we parent T2 to T1 and T3 to T2 we get a hierarchy:
world > T1 > T2 > T3
T3's world matrix is therefore defined as
WM3 = M1 * M2 * M3
Have in mind that WM3 accumlates transformations of all transforms that are above it in hierarchy. And we are not talking only about translation of the origins here. Local spaces can be nonuniformly scaled and rotated on all levels above in hierarchy. So if you animate M3 while M1 and M2 have local scales and rotations animated, your local M3 and world WM3 could look quite a bit differnet.
When you have M3 parented into hierarchy you see the results of WM3 transformations. When you unparent it you see the results of M3 transformations only.
Where's the problem?
QUOTE(failure @ 11/16/05, 04:45 PM)
I must admit I don't really understand where's the problem. If you just need to replace the object then unparent the exsiting shape from the transform node and parent a new shape to it.
Often when explaining hierarchies people tend to simplify things by covering only the translation part which is really straightforward. Issues are mostly caused by rotation and scaling
Suppose we have 3 transform nodes T1, T2, T3 each definig its own local space using respective transformation matrices M1, M2, M3. Now if we parent T2 to T1 and T3 to T2 we get a hierarchy:
world > T1 > T2 > T3
T3's world matrix is therefore defined as
WM3 = M1 * M2 * M3
Have in mind that WM3 accumlates transformations of all transforms that are above it in hierarchy. And we are not talking only about translation of the origins here. Local spaces can be nonuniformly scaled and rotated on all levels above in hierarchy. So if you animate M3 while M1 and M2 have local scales and rotations animated, your local M3 and world WM3 could look quite a bit differnet.
When you have M3 parented into hierarchy you see the results of WM3 transformations. When you unparent it you see the results of M3 transformations only.
Where's the problem?
[snapback]219897[/snapback]
That's exactly what is seems like it should be. But occasionally, it doesn't seem to work that way. If you know of a way I could get a simple scene to you which contains two objects exhibiting the problem you would see it. Also, I figured out a work around for the problem for now. I read the value when it is parented, then I unparent, and reparent and there is a new value. I just subtract the differing values and offset the animation curves by this amount and it is all fixed. By the way, there is no problems with the rotation or scale. It is only translate.
In the parenting options there is a setting for absolute or relative. One moves the object. The other doesn't. Is that your problem?
parentting does not move the animation (animation is in local space so whe n you go to the next frame it all vcraps up). Theyve succeded in animating something that should have been parentted to something it isnt, And now the erference is gone bonkers!
I think Jooja understands the problem. I kind of do, except that I can also have times where this problem does not exist, with the same objects. If anyone is wondering what exactly is going on, I can send them the scene sometime.
upload the scene
How do I upload the scene. The help file says the following...
If the admin has enabled it, you will also see a file attachments option, this will allow you to attach a file to be uploaded when making a post. Click the browse button to select a file from your computer to be uploaded. If you upload an image file, it may be shown in the content of the post, all other file types will be linked to.
I don't see anywhere it is possible if the admin has enabled it. Sorry.