View Full Version : Moving A Parent Joint In Local Space But Not The Children
04 April 2006, 03:47 AM
Alright I have already part of this solved, but I am just trying to make my script complete.
The quick task I want is to move a parent joint, in both relative and absolute behaviours, but not affect the child joints below it.
Btw, I'm using the move command and moving the joint.rotatePivot and scalePivot which will move the joint without affecting the other joints (like pressing the insert key on the joint)
I already have this working in world space, however I can not get it to move in local space. Even if I set it to localSpace in the move command, it will only move in the joints object space, not local. also when i change the space anything other than world space, the relative and absolute behaviour works only like its on relative no matter which i try to make it move by.
any ideas or suggestions, the xform command does not work on joints pivots so that rules that out.
if i have to just use world space that is ok, but if i can give my script more options for the user, thats all the better
thanks for your help
04 April 2006, 09:02 AM
Strange why the local xform/move commands do not work.
Can you temporarily unparent the children move the parent and then reparent the children?
I know not the most elegant way...
04 April 2006, 06:04 PM
no I which i could unparent it but the problem is the children have animation on them, so if you unparent, move and parent again, the child will jump to a new position because it's position is based on the parent. I need the child joints to not move from there current position.
I know its strange that the localSpace flag on move does not work. I'm trying to thing of other ways that I can do it. But any help would be great.
04 April 2006, 06:08 PM
crap, i was doing some testing and my idea will not work if the child has keys set on it, only works if there are no keys set on the child joints.
Oh well, but any thoughts?
05 May 2006, 11:38 AM
All I can think of are 2 ways:
1. (easy) put an extra group between the parent and its children, as "offset"
2. ( fun ;) ) Write a procedure that takes all keyframe animation and store the keys in world space appl the transformation of the parent and recalculate all keys to the new local space. But that sounds as if there is quite some scripting/coding involved, huh?!
05 May 2006, 09:05 AM
Build some joints
joint -p 0 0 0 ;
joint -p 2 0 0 ;
joint -p 4 0 0 ;
Edit joint2 position without affecting the children
joint -edit -relative -position 2 6 0 -component joint2;
Is that what you're after?
05 May 2006, 07:49 PM
hey Sean, thanks for that idea and it works, however I forgot to mention in the first post, that the child of the joint I want to move has keyframes on them. So if use that code it still moves the child joints because well, their children so they work relative to their parent's position.
I came up with a possible solution, but it involves a bit of work. An idea is to move the parent, then take that position change and reverse in onto the children that have keyframes by creating another animCurve with a key on it as an offiset and then combining the animation curve node with the offset curve so the child joints stays in place.
Im still thinking about how this will work correctly because joint orientation can affect it. So to remedy that, maybe have a dummy object that is in the same spot as the child joint and using those to put the joint back in the right place after the parent moves.
Any other suggestions, but thanks Sean, I didn't about moving the joint using the joint command, thats better than the move command.
05 May 2006, 07:49 PM
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.