View Full Version : inherit scale between 2 objects?


shenmue
08 August 2008, 04:24 PM
Hi

I have searched around the forum and in maya help,but I donīt know how to inherit just the scale between to objects.Letīs say that I have 2 boxes parented.Well,when I scale the parent,the child is scaled too.At least the childīs shape,because the scale of the child remains 1 1 1...so what is happening there?

thx

Impus
08 August 2008, 01:48 AM
The scale, in fact all transforms, _IS_ being inherited.

Lets take a real simple example:

Lets say you have two group objects (which are just transforms without shapes):

nullA and nullB

group -empty -name "nullA";
group -empty -name "nullB";


Now lets parent nullB to nullA

parent nullB nullA;


Now lets scale up nullA to {10.0, 10.0, 10.0}

setAttr "nullA.scale" 10.0 10.0 10.0;


If you look at the scale of nullB it will still be {1.0, 1.0, 1.0}. As this is the 'difference' in scale between it's parent and itself. Think of it like a multiplication, the scale on any object is it's scale multiplied by it's parents.
So object nullB scale = {1.0, 1.0, 1.0} * {10.0, 10.0, 10.0} = {10.0, 10.0, 10.0}

Therefore if you unparent nullB from nullA it's scale will be set to {10.0, 10.0, 10.0} to compensate for the missing parent scale.

parent -w nullB;
print (getAttr("nullB.scale"));



Again this applies to all transforms but with the scale it's a multiplication and the rotation/translation it's an addition.

shenmue
08 August 2008, 07:06 AM
I understand,thanks.But if I create an expresion dividing the childs scale for compensating the parent multiplication scale,Iīll mess the rotation...So,what can I do?

Impus
08 August 2008, 07:10 AM
I understand,thanks.But if I create an expresion dividing the childs scale for compensating the parent multiplication scale,Iīll mess the rotation...So,what can I do?

I think you need to paste some examples of what you are doing. Also try and explain exactly what you are trying to achieve and maybe people can help you find the easiest way to get there.

Robert Bateman
08 August 2008, 09:55 AM
I understand,thanks.But if I create an expresion dividing the childs scale for compensating the parent multiplication scale,Iīll mess the rotation...So,what can I do?

maybe don't parent them, and use a point+orient constraint to mimic the parenting. Alternatively, you could use the parent constraint which doesn't modify the childs scale. Thirdly, if it's a joint, then the segment scale compensate *may* be the flag you are looking for.

shenmue
08 August 2008, 02:45 PM
Ok guys,sorry for not explaning exactly what is all that about.The thing is that I am doing an fk/ik arm (or leg,or spine,or anything).The fk chain is made of polyCubes parented.So I need to be able to scale the arm polyCube,without afecting the foreArm polyCube.
I used to rig 3d max,and there,I can just diplay the bone joint as a bouncing box,thing that we canīt do in maya ,right?Is it a bad idea to use polyCubes for fk chains?I donīt like to use circle curves for that.I find more handy a box.

thx again

Robert Bateman
08 August 2008, 04:55 PM
Are you using maya joints here or are you parenting cubes directly?

shenmue
08 August 2008, 05:49 PM
I have a chain of joints(skin joints) and a chain of cubes(fk controlers).The chain of joints is oriented contrained and scale constrained to the cubes chain.
That means that the chain of cubes are controling the chain of joints.

Just create 2 cube and make the parent and child.When you scale the parent,the child does to(because of what Impus explained before).I am starting to feel that I am asking something weird.

shenmue
08 August 2008, 08:15 PM
.Alternatively, you could use the parent constraint which doesn't modify the childs scale.
Ok,this is it.Thanks.
So the diference between direct parenting and parenting contraint is only that the childīs scale isnīt modified?

Robert Bateman
08 August 2008, 09:44 AM
Ok,this is it.Thanks.
So the diference between direct parenting and parenting contraint is only that the childīs scale isnīt modified?

more or less, though maya has a few of ways of dealing with scale in a hierarchy. So a transform node can have an independent scale pivot; a joint can inherit the scaling (when segment scale compensate is turned off), or the child joints can have the inverse parent scaling applied (when segment scale compensate is turned on).

Parent constraints *may* be what you are after, but then again it depends if you want the boxes to act as selection handles for the joints. If you do, then it might be a case of doing something nasty with a selection based script job. Doing that is probably a bit nasty though...

shenmue
08 August 2008, 03:47 PM
Ok,thanks Robert.I understand it better now.

CGTalk Moderation
08 August 2008, 03:47 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.


1