Notifications
Clear all

[Closed] Can't set keys on a spinner in an attribute holder

 CMM

I’m trying to set keys on a spinner that is located in an attribute holder on an object. Here is what I’m trying:

local spinnerObj = obj.modifiers[1].startPercentage

at time 1 animate on spinnerObj = startVal
at time 200 animate on spinnerObj = startVal + 100

I’ve also tried this (from what I understand is the same thing)

local spinnerObj = obj.modifiers[1].startPercentage

with animate on
(
     At time 1 spinnerObj = startVal
     At time 200 spinnerObj = startVal + 100
)

Neither of these seem to work, I have a feeling I’m calling the spinner itself incorrectly? That is how I set the initial value of the spinner though when the rollout was created.

====================================================================
EDIT:

I ended up running this in the listener window and got the keys set, but the values didn’t change. It just keyed at frames 1 and 200 with a value of 0.

animate on
(
	At time 1 $.modifiers[1].startPercentage = 0
	At time 200 $.modifiers[1].startPercentage = 100
)

1 Reply
 CMM

Well seems like a hack and slash way to do things, but I ended up getting it working using this:

animate on (
At time 1 (custAttributes.get $.modifiers[1] 1)[1].controller.value = 0
At time 200 (custAttributes.get $.modifiers[1] 1)[1].controller.value = 100
(custAttributes.get $.modifiers[1] 1)[1].controller.keys[2].value = 100)

I had to set the keys, go back and edit them after the fact. If anyone knows of why this happened or if there is a better way I’d love to hear it.