Any way to constrain a transform to another transform's world matrix?

27 views
Skip to first unread message

botaurus

unread,
Apr 15, 2015, 4:04:23 PM4/15/15
to python_in...@googlegroups.com
I'm wondering if there is a way to essentially put an object in another object's space without parenting them. My rigging components are not parented to each other. I set up the hierarchy relationships with parent constraints. But scale constraints do not constrain their children in their parent's space.
Heres a script of the relationships in a basic form. If you scale the top_sphere, youll notice the bot_sphere does not skew like the mid_sphere. Any help would be much appreciated, thanks! (sorry if this makes no sense)

import maya.cmds as cmds

top_sphere = cmds.polySphere(ch=0)[0]

mid_sphere = cmds.polySphere(ch=0)[0]
cmds.move(5,0,0,mid_sphere)
cmds.rotate(30,0,0,mid_sphere)
mid_sphere_offset = cmds.group(em=1)
#put mid_sphere_offset in top's space with
cmds.parentConstraint(top_sphere, mid_sphere_offset)
cmds.parent(mid_sphere, mid_sphere_offset)
cmds.scaleConstraint(top_sphere, mid_sphere_offset)

bot_sphere = cmds.polySphere(ch=0)[0]
cmds.move(10,0,0,bot_sphere)
cmds.rotate(60,0,0,bot_sphere)
bot_sphere_offset = cmds.group(em=1)
#put bot_sphere_offset in top's space with
cmds.parentConstraint(mid_sphere, bot_sphere_offset)
cmds.parent(bot_sphere, bot_sphere_offset)
cmds.scaleConstraint(mid_sphere, bot_sphere_offset)

botaurus

unread,
May 19, 2015, 8:15:57 PM5/19/15
to python_in...@googlegroups.com
load the matrix nodes plugin and use the decompose matrix node
Reply all
Reply to author
Forward
0 new messages