PDA

View Full Version : morpher keys


JokerMartini
10-06-2011, 05:29 PM
I'm trying to add a key switching on and off every morpher. 1 per frame.
I'm not sure how to access each morphs key values....



WM3_MC_BuildFromNode $Teapot001.modifiers[1] 1 $Teapot002
WM3_MC_BuildFromNode $Teapot001.modifiers[1] 2 $Teapot002
WM3_MC_Rebuild $Teapot001.modifiers[1] 1

fn fnKeysCreator theTime val = -- Add Visibility Key
(
for Obj in selection do
(
--if classOf Obj.modifiers[1].controller != bezier_float do (Obj.modifiers[1].controller = bezier_float())
morpherTrack = Obj.modifiers[1]
newKey = addNewKey morpherTrack theTime --#select
getKeyIndex morpherTrack. theTime
-- newKey.value = 5.0
)
)

fnKeysCreator currentTime 100.0

lo
10-06-2011, 06:57 PM
you can access the morpher's channels controllers using the subanim indexing 1-100

morpherControllers = for i = 1 to 100 collect obj.morpher[i].controller

jonlauf
10-06-2011, 06:58 PM
The controller with the keys is on the actual morph track so you'll have to loop thru all the available tracks (i think there are 100), verify it has data, then set the keys. I'm not in front of max right now, but to get the controller keys on the first track of a morpher it would be $.morpher[1].keys or $.modifiers[1][1].keys if the morpher was the first modifier in the stack

edit: or what lo said

CGTalk Moderation
10-06-2011, 06:58 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.