PDA

View Full Version : Help with simple limking script


avolution
01-16-2009, 03:55 PM
I am a scripting newbie but I love scripting stuff

Here is a a script that will take omni lights
and move them to the position of the point hepler
and then link them to the point helper with the point helper
as the parent and the omni lights as children
problem is i can't get the link part to work
searched the maxscript help but could not find

here is my listener script so far

foo=$point* as array
doo=$omni* as array
for i in 1 to foo.count do
doo[i].pos=foo[i].pos
doo[i].parent =foo[i]--this line is bad

i am probably one word off success but i need a little guidance!

legie
01-16-2009, 04:18 PM
Try it like this:

foo=$point* as array
doo=$omni* as array

for i in 1 to foo.count do (
doo[i].pos=foo[i].pos
doo[i].parent =foo[i]
)


(I added () to the for-loop)
Without parenthesis only the next line is part of the loop (in your case only "doo[i].pos=foo[i].pos"). Then you get then an error because max doesn't know what the "i" in "doo[i].parent =foo[i]" is.

Hope that helps.

CGTalk Moderation
01-16-2009, 04:18 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.