Notifications
Clear all

[Closed] morpher keys

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

2 Replies
 lo1

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

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