PDA

View Full Version : Inheritance Flags and Aligning


martinez
03-05-2012, 08:30 PM
I bumped into this problem recently, but I haven't found a solution that works.

I'm making an animated align tool. (To align FK to IK over the active time range.) Sometimes animators want to disable rotation inheritance while they are working. And that's where this problem pops up.

If I disable inherit rotation on an object I can no longer align by setting the transform. The Align Tool in max still works, but I can't find a way to align with only MaxScript.

In the example below Box02 doesn't align to Box 04. Anyone have any ideas I can do to align an object with inherit rotation turned off?

Thanks in advance by the way!


(
--CREATE SOME TEMP BOXES
delete Objects

Box01 = Box pos:[0,0,0]
Box02 = Box pos:[30,0,0]
Box03 = Box pos:[-30,0,0]
Box04 = Box pos:[-60,0,0]

--PARENT THE BOXES TO THE FIRST BOX
Box02.parent = Box01
Box03.parent = Box01

--TURN OFF INHERIT ROTATION
setInheritanceFlags Box02 #{1..3,7..9}

--NEED TO DRAW THE VIEW OR THE INHERIT FLAGS ARE NOT SET
max views redraw

--ROTATE THE FIRST BOX
rotate Box01 (angleaxis 45 [0,0,1])

--ALIGN THE BOXES
Box03.transform = Box04.transform
Box02.transform = Box04.transform
)

denisT
03-05-2012, 09:32 PM
first of all it's not a good idea to allow animators change inheritance flags during animation. it will break an animation for sure... but if you still want to align your boxes: ;)

Box02.rotation *= Box04.transform.rotation
Box02.pos = Box04.transform.pos

3ak
03-05-2012, 10:15 PM
first of all it's not a good idea to allow animators change inheritance flags during animation. it will break an animation for sure... but if you still want to align your boxes: ;)

Box02.rotation *= Box04.transform.rotation
Box02.pos = Box04.transform.pos

assuming that boxes have the same object-offset matrix)

CGTalk Moderation
03-05-2012, 10:15 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.