PDA

View Full Version : simple animate script not working


em3
12-28-2010, 03:59 PM
I have a script that used to work


--(
--Objs = for o in objects collect o
for o in selection do
(
print o.name
myNum = --random 100 200
my2ndNum = myNum+100 --random myNum
myZ = o.pos.z
print myNumz
print o.name
o.visibility = bezier_float() -- Track View: Add Visibility Track
addNewKey o.visibility.controller myNum #select
addNewKey o.visibility.controller my2ndNum #select
o.visibility.controller.keys[1].value = 0
o.visibility.controller.keys[2].value = 1 --<BREAKS HERE
addNewKey o.pos.controller.Z_Position.controller myNum #select
addNewKey o.pos.controller.Z_Position.controller my2ndNum #select
o.pos.Z_Position.controller.keys[1].value = myZ +1000
o.pos.Z_Position.controller.keys[2].value = myZ --<BREAKS HERE
--actionMan.executeAction 0 "40022"
)

gets a "-- Unknown property: "value" in undefined"

It's breaking when I add the second controller key. I am using 3ds max 2011 vanilla. Thanks!

lucpet
12-28-2010, 11:39 PM
I have a script that used to work


for o in selection do
(
print o.name
myNum = --random 100 200
my2ndNum = myNum+100 --random myNum --WHY IS COMMENTED OUT?
myZ = o.pos.z
print myNumz --NEEDS TO BE SET. IT IS UNDEFINED. TYPO MAYBE
print o.name
o.visibility = bezier_float() -- Track View: Add Visibility Track
addNewKey o.visibility.controller myNum #select
addNewKey o.visibility.controller my2ndNum #select
o.visibility.controller.keys[1].value = 0
o.visibility.controller.keys[2].value = 1 --<BREAKS HERE
addNewKey o.pos.controller.Z_Position.controller myNum #select
addNewKey o.pos.controller.Z_Position.controller my2ndNum #select
o.pos.Z_Position.controller.keys[1].value = myZ +1000
o.pos.Z_Position.controller.keys[2].value = myZ --<BREAKS HERE
)

gets a "-- Unknown property: "value" in undefined"

It's breaking when I add the second controller key. I am using 3ds max 2011 vanilla. Thanks!

What are you trying to do with this script?

gruhn
12-29-2010, 03:22 AM
I worry that MyNum hasn't been initialized.
Is the collection zero based? That is, does [2] not exist, only [0] and [1]?

em3
12-29-2010, 04:47 AM
@gruhn - yep, myNum was commented out. What a tardling I am.

@lucpet - the script will animate the z position of a group of object in the order of their proximity to 0,0,0 so that objects nearest that coordinate animate first, farther away animates last.

lucpet
12-30-2010, 06:19 AM
@gruhn - yep, myNum was commented out. What a tardling I am.

@lucpet - the script will animate the z position of a group of object in the order of their proximity to 0,0,0 so that objects nearest that coordinate animate first, farther away animates last.

If you look at the script in my reply you'll see I pointed that out as well as myNim(z) hasn't been initialised or typo, look for --MY COMMENTS IN ALL CAPS

CGTalk Moderation
12-30-2010, 06:19 AM
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.