Show Keyframe numbers in a text file?

I need a script that when I click on a button it shows me all the translational and rotational key frames of a selected object in a text file.
Is this hard to do?
Thanks for your help..

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

May be not the best solution, but...

(
	curObj = selection[1]
	keys = curObj.position.controller.keys
	objNumKeys = numKeys curObj.position.controller
	keysArr = #()
	for i = 1 to objNumKeys do
	(
		frame = (keys[i].time as string)
		intFrame = (subString frame 1 (frame.count - 1 )) as integer
		append keysArr intFrame
	)	
	format "keysArr: % \n" keysArr
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.