http://www.blender.org/modules.php?op=m ... 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:",bo.name,"" 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[bo.name]: # 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.
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.