0
votes

I made a short video (1min and a half) so it can be clear what I need. http://www.dailymotion.com/video/x61u197

in this video I added link constraint to a sphere, then link sphere to a point (point is animated), and then I Align the sphere, so at the end I have result that sphere is moving together with a point.

I have a script for first part of the action

$Sphere001.controller = link_constraint()
 $Sphere001.controller.addTarget $Point001

until I need to align it to a point - as in screenshot below, that part I dont know hot to solve in maxscript. https://imgur.com/QuzYW0w

Macro recorder is not covering that part. Also I tried many scripts from forums but they didn't worked for this. in documentation I couldnt find any help so far. So I would appreciate if you can help to make a script commands to align an object, just like it is in the video?

EDIT This is closest I get to translate that align command to a script:

$s.transform = (transMatrix [0,0,0]) * $p.transform

in this case it moves to exact position as point, but it transform rotation also, but I want only position

tried this but is not working

$s.pos = (transMatrix [0,0,0]) * $p.pos
1

1 Answers

0
votes

Why are you using a link constraint in the first place when you could simply match the positions and parent the sphere to the helper?

Either way, the Link Constraint stores the initial offset as part of it's subcontrollers. A simple $Sphere001.pos = [0,0,0] will remove that positional offset and cause the sphere to coincide with the point helper.