ScriptSpot

Forum topic · Scripts Wanted

Create keyframes for every frame

By Walrus · 2011-09-28

Description

Hi all,

I was wondering if there's a way to create automatically keyframes for a selected object in the scene, choosing if they're rotation, position, scale and so on. I don't know if a script already exist, but it would be useful for some game engines that requires a constant key on every frame to import correctly the animation.

Thank you all!

Comments (6)

there's how-to for all PRS controllers

Anubis · 2011-09-29

sTime = animationRange.start
eTime = animationRange.end
for obj in selection do (
	for t = sTime to eTime do
		addNewKey obj[3] t
)

Walrus · 2011-10-06

Thank you Anubis, it works great!

Another question: there's a way using your script to create keyframes only for position and/or rotation using your code? I know that it's possible delete the scale controller using Curve editor, but it would be possible create keys for position/rotation only?

Thank you

yeah, of'cuz

Anubis · 2011-10-06

actual modification to do that is really slim.

obj[3] -- whole transform
obj[3][1] -- position only
obj[3][2] -- rotation only
obj[3][2][1] -- X rotation only

I can write a mini tool with interface, if you like, just let me know ;)

Yes!

Walrus · 2011-10-06

Yes, it would be great! :D Eventually it would be possible create a rollout with 4 or 5 buttons where it's possible choose if create all the keys, create only rotation or position keyframe for all objects or only on the selection?

Walrus · 2011-10-07

Thank you Anubis! Really great! :D