Page 1 of 1

Request: Blender NLA module... addition of GetBakedFrames()

Posted: Tue Mar 15, 2005 3:23 am
by dandeloreon1984
as i've gone over the blender nla module, as shown in this thread: ... 5030#35030

i know that the animator has to bake his/her keys every time they use some exporters, like the ogre exporter does... but most animators don't want extra steps in the proccess, and i don't want to haft to evaluate all the curves separately... so i'll make the simple script that most will use below... and please do note i don't know what all it is going to take but it is something that will make many animation exporting easy.

Code: Select all

Example script showing off how the requested Feature.
import Blender
from Blender import Registry, Types

for obj in Blender.Object.GetSelected():
	if obj.getType() == "Armature":
		Therig = obj.getData()
		for bo in Therig.bones:
			print "Bonename:",,""
			SkeletalAnimations = Blender.Armature.NLA.GetActions()
			# the function Key() is in there, but undocumented... but it returns the list of actions.
			for SkelAnimKey in SkeletalAnimations.Keys():
				# now here is where the whole script changes course.
				BakedFrames = SkeletalAnimations[SkelAnimKey].GetBakedFrames()
				for Frame in BakedFrames[]:
					# the Baked Keys function returns the frames as keys for each frame... so it'll neeed to be accesed like this.
					print "\tLocation is   :", Frame.loc
					print "\tquaternion is :",  Frame.quat
					print "\tsize is:", Frame.size
					# it'll be a complete bakeing of the frame, and it's temporary.
i do know it'll take a lot of work, but in the end the coding and access to the ipo has less errors.

the GetBakedFrames() function is just a proposal of shortening the proccess of evaluating frames, considering the proccess of evaluating the whole ipo is long and drawn out for the coder, and the animator because the animator needs to know to bake his/her animation.