|12 December 2008||#1|
Join Date: Feb 2004
How to get the targets of a Lookat_constraint
How do I select the target(or targets) of a Lookat_Constraint?
Or better yet, how do I understand this section of the help file. I understand .properties when I see them in the help. But the <rules> of methods aren't clear to me. I just don't script enough...
From the Max Help:
Returns the number of target nodes in the target list.
Returns the indexed target node.
Returns the weight of the indexed target if the targetNumber is relevant, 0.0 otherwise.
<boolean>setWeight <index>targetNumber <float>weight
Sets the weight of the indexed node specified by targetNumber. Returns True on success, False otherwise.
<boolean>appendTarget <node>target <float>weight
Appends the specified node to the list and sets its weight to the specified value. Returns True on success, False otherwise.
Deletes the indexed target. Returns True on success, False otherwise.
|12 December 2008||#2|
Join Date: Mar 2002
The <rules> just tell you the type of the arguments (or, if in front of the method, the return value type).
Let's assume you have a Teapot01 with a LookAt Constraint in the Rotation track looking at 3 Spheres.
theObj = $Teapot01 --this is the host object
$Teapot:Teapot01 @ [-53.237698,71.865959,0.000000]
theController = theObj.rotation.controller --this is the rotation (LookAt) Constraint
--Now loop from 1 to the number of targets in the constraint and collect
--each node into an array called theTargets:
theTargets = for i = 1 to theController.getNumTargets() collect theController.getNode i
#($Sphere:Sphere01 @ [-77.946899,-10.454015,0.000000], $Sphere:Sphere02 @ [-43.879711,-0.831173,0.000000], $Sphere:Sphere03 @ [17.187794,69.950142,0.000000])
select theTargets --now all you have to do is select them
|12 December 2008||#3|
Join Date: Feb 2004
I'll be glad when this project is over so I can switch to 2009 and the new script editor and help system. Still on good ol' Max 9 for now.
So here are my meager additions for anyone who is interested.
Last edited by jonahhawk : 12 December 2008 at 09:15 AM.
|12 December 2008||#4|
Join Date: Sep 2003
Thread automatically closed
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.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|