How to find all animation keys


#1

I have many object, class of each object are difference and type of controller each object are difference too: transform controller, visibility track, materials, sound…
I want to find all keys of all object, so, what do i should ?
Thank you ! :slight_smile:


#2

I’m not at my computer, but you can access the sub anim controllers using the numsubs property in a recursive function. The test the controller with supportsKeys.


#3

I took a stab at it. I hope it help you out.


(

	--CREATE A FUNCTION TO FIND CONTROLLERS THAT SUPPORT KEYS
	mapped fn getKeys obj theKeys =
	(			
		for i = 1 to obj.numsubs do
		(
			if obj[i] != undefined do
			(
				for v = 1 to obj[i].numsubs do
				(
					getKeys obj[i][v] theKeys
				)
				
				if obj[i].controller != undefined do
				(
					if obj[i].controller.supportsKeys do
					(
						try
						(
							if obj[i].controller.keys.count > 0 do
							(
								append theKeys obj[i].controller.keys
							)
						)
						catch()
					)
				)
			)
		)
		
		return theKeys
	)
	
	--CREATE AN EMPTY ARRAY
	KeyArray = #()
	
	getKeys objects KeyArray
	
	print KeyArray
)


#4

to find keys you have to find animated subanims… follow the discussion http://forums.cgsociety.org/showthread.php?f=98&t=1020938&highlight=keys


#5

thank you Martinez, your script is useful for me :slight_smile:


#6

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.