PDA

View Full Version : How to use add_path in Path Constraint?


MikeKelley
07-10-2007, 09:17 PM
I'm a little stuck here (too much scripting to learn in one day).

What's a practical example of this syntax?

.path UndefinedClass default: undefined -- node; Path_Constraint

Add Path: is used to add a new spline path that influences the constrained object.

Delete path: is used to remove a path from the target list. Once removing the path target, it will no longer influence the constrained object

I can use:

mybox01.pos.controller.follow = on

to set a Path_Constraint controller's follow, as well as axis or any of the other "simple" properties. But I can't figure out how to add a path to it.

mybox01.pos.controller.path = #add_path:$line01

doesn't work, nor do any of the dozens of variations I've tried. I know I just don't understand this, but please point me in the right direction.

magicm
07-10-2007, 10:28 PM
Mike,

Here's the method for adding paths to a Path Constraint controller:
mybox01.pos.controller.appendTarget $Line01 50
where 50 (default) is the weight to use for the added path.

To remove a path from the controller use:
mybox01.pos.controller.deleteTarget 1
where 1 is the index of the path.

Check out the "Path_Constraint : PositionController" topic in the mxs reference for more information.

Cheers,
Martijn

PiXeL_MoNKeY
07-10-2007, 10:29 PM
mybox01.pos.controller.path = $line01
-- sets the path for the controller to line01
-- replaces the path list with the specified path
.appendtarget <target> <weight> adds a new path to the list.
This is listed in the interface section of the path_constraint help.

mybox01.pos.controller.appendtarget $line02 50
-- adds line02 to the path list with a weight of 50
-Eric

MikeKelley
07-10-2007, 10:40 PM
Thanks guys -- that does work, but the Max 9 Maxscript documentation does not mention a word about "appendtarget" in Path Constraint. Instead it keeps referring to AppendPath or DeletePath, so I'm guessing either the docs got screwed up or I just don't see something obvious.

But the quick response is much appreciated -- now I have my Biped footsteps to path working a treat.

PiXeL_MoNKeY
07-10-2007, 11:04 PM
Check the Path_Constraint interfaces at the bottom of the page. The Add Path and Delete Path in the .path section is wrong.
<boolean>appendTarget target weight

Appends the specified node to the list. The default weight is 50.0. Returns True on success, False otherwise.

<boolean>deleteTarget targetNumber

Delete the indexed target. Returns True on success, False otherwise.
-Eric

CGTalk Moderation
07-10-2007, 11:04 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.