PDA

View Full Version : apply path constraint using mapped operation?


anggahenggara
10-13-2009, 06:52 AM
hi there...i wanna to add Path_constraint COntoller and the path itself
like this
Box01 path constraint to Line01
Box02 path constraint to Line02
Box03 path constraint to Line03
and so on, it's a mapped operation.
so i do this...
1.Create array of Box in good order--> called BoxArray (i've done this)
2.Create array of Line in good order--> called LineArray (i've done this)
3.then i create for loop below:


pathCon=path_constraint()
for i=1 to 20 do
(
BoxArray[i].position.controller[3].controller=pathCon
BoxArray[i].position.controller.setActive 3
BoxArray[i].position.controller.path_constraint.controller.path = LineArray [i]
)

all the box has PathContsraint as active controller but the target path is not correct..
all the box has target path :Line20

i don't know whats wrong because i think this simple algorithm can do this correctly

anggahenggara
10-13-2009, 08:38 AM
i found the problem..and solved it.
it's because i make definition
pathCon=Path_constraint()
thanks..

PiXeL_MoNKeY
10-13-2009, 03:51 PM
Yes, you are making an instance of the controller by doing that. This means that everything it is applied to gets the same controller, therefore any changes are applied to all. Another option would be to do something like this:BoxArray[i].position.controller[3].controller=(copy pathCon)This should create a unique copy when applying the path constraint.

-Eric

CGTalk Moderation
10-13-2009, 03:51 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.