[Closed] Realign helper with constraints in its controllerstack
Hello there!
I am having an issue with aligning a helper via script and I am stuck at this point. The helper – let’s call him “A” – is part of a rig. The parent of “A” is linked to another helper “B”. A and B are animated over time and I want to realign A to B at frame 100 as it was at frame 0. So far so good…
However, “A” is position- and orientationConstrained and on top of each controllerStack is another Position XYZ/Euler XYZ for additional movements, which prevents to realign A via script properly.
Here are the scriptlines I use:
-- at frame 0:
Azero = A.transform
Bzero = B.transform
-- at frame 100:
A.transform = (Azero * inverse Bzero) * B.transform
without the constraints this works fine, but thats not what I need. Any Ideas?
Here is a samplefile to download (max2016)
sampleFile max 2016
Cheers,
Martin
However, “A” is position- and orientationConstrained and on top of each controllerStack is another Position XYZ/Euler XYZ for additional movements, which prevents to realign A via script properly.
If you want a object to be constrained to another object’s position and rotation ,
but also able to key frame additional movement on its own, use a link constraint.
Thanks for this idea! I need to blend between two position-/orientationtargets, too, wich is not possible for linkConstraints but finally I found a solution for my issue when using an opened group and constraining this. This keeps the helper still animatable and transform-to-zero works fine, too, now.
… but still I would like to know why this did not work as supposed to be and how to deal with such a setup. Using the alignTool works fine and the constraints dont seem to confuse the alignTool…
you have wrong setup for list controller. the setup has to be:
– constraint
– free
only two controllers are needed in the list for your setup, where the second one is ‘zeroble’
delete objects
d = dummy pos:[0,0,0] boxsize:[10,10,10]
p = point pos:[20,0,0] cross:on size:5
cc = p.position.controller = createinstance position_list
c = cc.available.controller = position_constraint()
cc.setname 1 "Constarint"
c.appendtarget d 100
c = cc.available.controller = position_xyz()
cc.setname 2 "Free Position"
cc.setactive 2
/* align
p.transform = d.transform
*/
/* zero
p.pos.controller[2].value = [0,0,0]
*/