Commits

Anonymous committed 098b5d1

Refactore baking of animation for action and ipos to integrate Material animation

  • Participants
  • Parent commits 0a800fb

Comments (0)

Files changed (6)

File blenderExporter/osg/osgbake.py

+# -*- python-indent: 4; coding: iso-8859-1; mode: python -*-
+#
+# Copyright (C) 2008 Cedric Pinson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Authors:
+#  Cedric Pinson <cedric.pinson@plopbyte.net>
+
+
+import Blender
+from   Blender import Ipo
+from   Blender import BezTriple
+import bpy
+import osglog
+from osg import osgconf
+from osglog import log
+from osgconf import debug
+from osgconf import DEBUG
+
+Vector     = Blender.Mathutils.Vector
+Quaternion = Blender.Mathutils.Quaternion
+Matrix     = Blender.Mathutils.Matrix
+Euler      = Blender.Mathutils.Euler
+
+
+COORDINATE_SYSTEMS = ['local','real']
+COORD_LOCAL = 0
+COORD_REAL = 1
+usrCoord = COORD_LOCAL # what the user wants
+usrDelta = [0,0,0,0,0,0,0,0,0] #order specific - Loc xyz Rot xyz
+R2D = 18/3.1415  # radian to grad
+
+
+def addPoint(time, key, ipos):
+    for i in range(len(ipos)):
+        if ipos[i] is None:
+            continue
+        point = BezTriple.New() #this was new with Blender 2.45 API
+        point.pt = (time, key[i])
+        point.handleTypes = [1,1]
+        ipos[i].append(point)
+    return ipos
+
+def getRangeFromIpo(ipo):
+    first_frame = 1
+    last_frame = 1
+    for channel in ipo:
+        for key in channel.bezierPoints:
+            if key.vec[1][0] > last_frame:
+                last_frame = int(key.vec[1][0])
+    debug("range of ipo %s : %s %s " % (ipo.name, first_frame,last_frame))
+    return (first_frame, last_frame, first_frame)
+
+
+class BakeIpoForObject(object):
+    def __init__(self, *args, **kwargs):
+        self.ipos = kwargs["ipo"]
+        self.object = kwargs["object"]
+        self.config = kwargs.get("config", None)
+        self.result_ipos = None
+
+
+    def getCurves(self, ipo):
+	ipos = [
+            ipo[Ipo.OB_LOCX],
+            ipo[Ipo.OB_LOCY],
+            ipo[Ipo.OB_LOCZ],
+            ipo[Ipo.OB_ROTX], #get the curves in this order
+            ipo[Ipo.OB_ROTY],
+            ipo[Ipo.OB_ROTZ],
+            ipo[Ipo.OB_SCALEX], #get the curves in this order
+            ipo[Ipo.OB_SCALEY],
+            ipo[Ipo.OB_SCALEZ]
+            ]
+	return ipos
+
+    def getLocLocal(self, ob):
+	key = [
+            ob.LocX, 
+            ob.LocY, 
+            ob.LocZ,
+            ob.RotX*R2D, #get the curves in this order
+            ob.RotY*R2D, 
+            ob.RotZ*R2D,
+            ob.SizeX, 
+            ob.SizeY, 
+            ob.SizeZ,
+            ]
+	return key
+
+    def getLocReal(self, ob):
+        obMatrix = ob.matrixWorld #Thank you IdeasMan42
+        loc = obMatrix.translationPart()
+        rot = obMatrix.toEuler()
+        scale = obMatrix.scalePart()
+        key = [
+            loc.x,
+            loc.y,
+            loc.z,
+            rot.x/10,
+            rot.y/10,
+            rot.z/10,
+            scale.x,
+            scale.y,
+            scale.z,
+            ]
+        return key
+
+    def getLocRot(self, ob, space):
+        if space in xrange(len(COORDINATE_SYSTEMS)):
+            if space == COORD_LOCAL:
+                key = self.getLocLocal(ob)
+                return key
+            elif space == COORD_REAL:
+                key = self.getLocReal(ob)
+                return key
+            else: #hey, programmers make mistakes too.
+                debug('Fatal Error: getLoc called with %i' % space)
+        return
+
+    def bakeFrames(self, myipo): #bakes an object in a scene, returning the IPO containing the curves
+        myipoName = myipo.getName()
+        debug('Baking frames for scene %s object %s to ipo %s' % (bpy.data.scenes.active.getName(),self.object.getName(),myipoName))
+        ipos = self.getCurves(myipo)
+            #TODO: Gui setup idea: myOffset
+            # reset action to start at frame 1 or at location
+        myOffset=0 #=1-staframe
+            #loop through frames in the animation. Often, there is rollup and the mocap starts late
+        staframe,endframe,curframe = getRangeFromIpo(self.object.getIpo())
+        for frame in range(staframe, endframe+1):
+                    #tell Blender to advace to frame
+            Blender.Set('curframe',frame) # computes the constrained location of the 'real' objects
+
+                    #using the constrained Loc Rot of the object, set the location of the unconstrained clone. Yea! Clones are FreeMen
+            key = self.getLocRot(self.object,usrCoord) #a key is a set of specifed exact channel values (LocRotScale) for a certain frame
+            key = [a+b for a,b in zip(key, usrDelta)] #offset to the new location
+            myframe= frame+myOffset
+            Blender.Set('curframe',myframe)
+
+            time = Blender.Get('curtime') #for BezTriple
+            ipos = addPoint(time,key,ipos) #add this data at this time to the ipos
+            debug('%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f' % (myipoName, myframe, time, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8]))
+        Blender.Set('curframe',staframe)
+        return myipo
+
+    def getBakedIpos(self):
+
+        # Get the dummy action if it has no users
+        dummy_ipos_name = self.ipos.getName() + "_bake"
+        try:
+            baked = bpy.data.ipos[dummy_ipos_name]
+        except:
+            baked = None
+
+        if not baked:
+            baked = bpy.data.ipos.new(dummy_ipos_name,'Object')
+            baked.fakeUser = False
+        else:
+            baked[Ipo.OB_LOCX] = None
+            baked[Ipo.OB_LOCY] = None
+            baked[Ipo.OB_LOCZ] = None
+            baked[Ipo.OB_ROTX] = None
+            baked[Ipo.OB_ROTY] = None
+            baked[Ipo.OB_ROTZ] = None
+            baked[Ipo.OB_SCALEX] = None
+            baked[Ipo.OB_SCALEY] = None
+            baked[Ipo.OB_SCALEZ] = None
+
+        baked.addCurve('LocX')
+        baked.addCurve('LocY')
+        baked.addCurve('LocZ')
+        baked.addCurve('RotX')
+        baked.addCurve('RotY')
+        baked.addCurve('RotZ')
+        baked.addCurve('ScaleX')
+        baked.addCurve('ScaleY')
+        baked.addCurve('ScaleZ')
+
+        dummy_object = None
+        if self.object is None:
+            log('WARNING Bake ipo %s without object, it means that it will not be possible to bake constraint, use an name ipo that contains the object associated to him, like myipo-MyObject' % self.ipos.name)
+            self.object = bpy.data.scenes.active.objects.new('Empty')
+            dummy_object = self.object
+
+        previous_ipo = self.object.getIpo()
+        self.object.setIpo(self.ipos)
+        self.bakeFrames( baked)
+        self.object.setIpo(previous_ipo)
+
+        if dummy_object:
+            bpy.data.scenes.active.objects.unlink(dummy_object)
+
+        self.result_ipos = baked
+        return self.result_ipos
+
+class BakeAction(object):
+    def __init__(self, *args, **kwargs):
+        self.armature = kwargs["armature"]
+        self.action = kwargs["action"]
+        self.config = kwargs["config"]
+        self.result_action = None
+
+
+    def getBakedAction(self, sample_rate = 25):
+        """
+            Bakes supplied action for supplied armature.
+            Returns baked action.
+        """
+        pose = self.armature.getPose()
+        armature_data = self.armature.getData();
+        pose_bones = pose.bones.values()
+        rest_bones = armature_data.bones
+
+        POSE_XFORM = [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT, Blender.Object.Pose.SIZE ]
+        #POSE_XFORM= [Object.Pose.LOC,Object.Pose.ROT,Object.Pose.SIZE]
+
+        blender_fps = 25
+        if sample_rate > blender_fps:
+            sample_rate = blender_fps
+        step = blender_fps / sample_rate
+
+        startFrame= min(self.action.getFrameNumbers());
+        endFrame= max(self.action.getFrameNumbers());
+
+
+        dummy_action_name = "_" + self.action.name
+        # Get the dummy action if it has no users
+        try:
+            baked_action = bpy.data.actions[dummy_action_name]
+        except:
+            baked_action = None
+
+        if not baked_action:
+            baked_action          = bpy.data.actions.new(dummy_action_name)
+            baked_action.fakeUser = False
+        for channel in baked_action.getChannelNames():
+            baked_action.removeChannel(channel)
+
+        old_quats={}
+        old_locs={}
+        old_sizes={}
+
+        baked_locs={}
+        baked_quats={}
+        baked_sizes={}
+
+        self.action.setActive(self.armature)
+        frames = range(startFrame, endFrame+1, int(step))
+        if frames[-1:] != endFrame :
+            frames.append(endFrame)
+
+        for current_frame in frames:
+
+            Blender.Set('curframe', current_frame)
+            time = Blender.Get('curtime') #for BezTriple
+            debug('%s %i %.3f' % (self.action.name, current_frame, time))
+
+            for i in range(len(pose_bones)):
+
+                bone_name=pose_bones[i].name
+
+                rest_bone=rest_bones[bone_name]
+                matrix = Matrix(pose_bones[i].poseMatrix)
+                rest_matrix= Matrix(rest_bone.matrix['ARMATURESPACE'])
+
+                parent_bone=rest_bone.parent
+
+                if parent_bone:
+                    parent_pose_bone=pose.bones[parent_bone.name]
+                    matrix=matrix * Matrix(parent_pose_bone.poseMatrix).invert()
+                    rest_matrix=rest_matrix * Matrix(parent_bone.matrix['ARMATURESPACE']).invert()
+
+                #print "before\n", matrix
+                #print "before quat\n", pose_bones[i].quat;
+
+                #print "localised pose matrix\n", matrix
+                #print "localised rest matrix\n", rest_matrix
+                matrix=matrix * Matrix(rest_matrix).invert()
+
+
+                old_quats[bone_name] = Quaternion(pose_bones[i].quat);
+                old_locs[bone_name] = Vector(pose_bones[i].loc);
+                old_sizes[bone_name] = Vector(pose_bones[i].size);
+
+                baked_locs[bone_name] = Vector(matrix.translationPart())
+                baked_quats[bone_name] = Quaternion(matrix.toQuat())
+                baked_sizes[bone_name] = Vector(matrix.scalePart())
+
+            baked_action.setActive(self.armature)
+            Blender.Set('curframe', current_frame)
+            for i in range(len(pose_bones)):
+                pose_bones[i].quat = baked_quats[pose_bones[i].name]
+                pose_bones[i].loc = baked_locs[pose_bones[i].name]
+                pose_bones[i].size = baked_sizes[pose_bones[i].name]
+                pose_bones[i].insertKey(self.armature, current_frame, POSE_XFORM)
+
+            self.action.setActive(self.armature)
+            Blender.Set('curframe', current_frame)
+
+            for name, quat in old_quats.iteritems():
+                pose.bones[name].quat=quat
+
+            for name, loc in old_locs.iteritems():
+                pose.bones[name].loc=loc
+
+        pose.update()
+        self.result_action = baked_action
+        return baked_action
+
+class BakeIpoForMaterial(object):
+    def __init__(self, *args, **kwargs):
+        self.ipos = kwargs["ipo"]
+        self.material = kwargs["material"]
+        self.config = kwargs.get("config", None)
+        self.result_ipos = None
+
+    def getCurves(self, ipo):
+	ipos = [
+            ipo[Ipo.MA_R],
+            ipo[Ipo.MA_G],
+            ipo[Ipo.MA_B],
+            ipo[Ipo.MA_ALPHA]
+            ]
+	return ipos
+
+    def getColor(self, mat):
+        key = [
+            mat.R, 
+            mat.G, 
+            mat.B, 
+            mat.alpha
+            ]
+        return key
+
+    def bakeFrames(self, tobake):
+	myipoName = tobake.getName()
+	debug('Baking frames for scene %s material %s to ipo %s' % (bpy.data.scenes.active.getName(),self.material.getName(),myipoName))
+	ipos = self.getCurves(tobake)
+	#TODO: Gui setup idea: myOffset
+	# reset action to start at frame 1 or at location
+	myOffset=0 #=1-staframe
+	#loop through frames in the animation. Often, there is rollup and the mocap starts late
+	staframe,endframe,curframe = getRangeFromIpo(self.material.getIpo())
+	for frame in range(staframe, endframe+1):
+		#tell Blender to advace to frame
+		Blender.Set('curframe',frame) # computes the constrained location of the 'real' objects
+                
+		#using the constrained Loc Rot of the object, set the location of the unconstrained clone. Yea! Clones are FreeMen
+		key = self.getColor(self.material) #a key is a set of specifed exact channel values (LocRotScale) for a certain frame
+		myframe= frame+myOffset
+		Blender.Set('curframe',myframe)
+		
+		time = Blender.Get('curtime') #for BezTriple
+		ipos = addPoint(time, key, ipos) #add this data at this time to the ipos
+		debug('%s %i %.3f %.2f %.2f %.2f %.2f' % (myipoName, myframe, time, key[0], key[1], key[2], key[3]))
+	Blender.Set('curframe',staframe)
+        return tobake
+
+    def getBakedIpos(self):
+        # Get the dummy action if it has no users
+        dummy_ipos_name = self.ipos.getName() + "_bake"
+        try:
+            baked = bpy.data.ipos[dummy_ipos_name]
+        except:
+            baked = None
+
+        if not baked:
+            baked = bpy.data.ipos.new(dummy_ipos_name,'Material')
+            baked.fakeUser = False
+        else:
+            baked[Ipo.MA_R] = None
+            baked[Ipo.MA_G] = None
+            baked[Ipo.MA_B] = None
+            baked[Ipo.MA_ALPHA] = None
+
+        baked.addCurve('R')
+        baked.addCurve('G')
+        baked.addCurve('B')
+        baked.addCurve('Alpha')
+
+        dummy_mat = None
+        if self.material is None:
+            log('WARNING Bake ipo %s without material, it means that it will not be possible to bake constraint, use an name ipo that contains the material associated to him, like myipo-MyMaterial' % self.ipos.name)
+            self.material = bpy.data.materials.new('Material')
+            dummy_mat = self.material
+
+        previous_ipo = self.material.getIpo()
+        self.material.setIpo(self.ipos)
+        self.bakeFrames(baked)
+        self.material.setIpo(previous_ipo)
+
+        if dummy_mat:
+            bpy.data.materials.unlink(dummy_mat)
+
+        self.result_ipo = baked
+        return self.result_ipo

File blenderExporter/osg/osgconf.py

 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # Authors:
-#  Cedric Pinson <mornifle@plopbyte.net>
+#  Cedric Pinson <cedric.pinson@plopbyte.net>
 #  Jeremy Moles <jeremy@emperorlinux.com>
 
 
 import os
 import osglog
 import osgobject
+from osglog import log
+
+DEBUG = False
+def debug(str):
+    if DEBUG:
+        log(str)
 
 class Config(object):
     def __init__(self, map = None):

File blenderExporter/osg/osgdata.py

 import osg
 from osg import osgconf
 import osglog
+from osgbake import BakeIpoForMaterial, BakeIpoForObject, BakeAction
 from osglog import log
 from osgobject import *
+from osgconf import debug
+from osgconf import DEBUG
 
 Vector     = Blender.Mathutils.Vector
 Quaternion = Blender.Mathutils.Quaternion
 Matrix     = Blender.Mathutils.Matrix
 Euler      = Blender.Mathutils.Euler
 
-DEBUG = False
-def debug(str):
-    if DEBUG:
-        log(str)
-
 def getImageFilesFromStateSet(stateset):
     list = []
     if stateset is not None and len(stateset.texture_attributes) > 0:
             return o
     return None
 
-def exportKeyframeSplitRotationTranslationScale(ipo, fps):
-	SUPPORTED_IPOS = (
-		'RotX', 'RotY', 'RotZ',
-		'QuatW', 'QuatX', 'QuatY', 'QuatZ',
-		'LocX', 'LocY', 'LocZ',
-		'ScaleX', 'ScaleY', 'ScaleZ'
-	)
-        
-	channels         = []
-	channel_times    = {'Rotation': set(), 'Translation': set(), 'Scale': set()}
-	channel_names    = {'Rotation': 'rotation', 'Translation': 'position', 'Scale': 'scale'}
-	channel_samplers = {'Rotation': None, 'Translation': None, 'Scale': None}
-	channel_ipos     = {'Rotation': [], 'Translation': [], 'Scale': []}
-
-	duration = 0
-
-	for curve in ipo:
-		if curve.name not in SUPPORTED_IPOS:
-			continue
-
-		elif curve.name[ : 3] == "Rot" or curve.name[ : 4] == "Quat":
-			times = channel_times['Rotation']
-			channel_ipos['Rotation'].append(curve)
-
-		elif curve.name[ : 3] == "Loc":
-			times = channel_times['Translation']
-			channel_ipos['Translation'].append(curve)
-
-		elif curve.name[ : 5] == "Scale":
-			times = channel_times['Scale']
-			channel_ipos['Scale'].append(curve)
-
-		for p in curve.bezierPoints:
-			times.add(p.pt[0])
-
-	for key in channel_times.iterkeys():
-		time = list(channel_times[key])
-		time.sort()
-		channel_times[key] = time
-                
-		if len(time) > 0:
-			channel_samplers[key] = Channel()
-                
-	for key in channel_times.iterkeys():
-		if channel_samplers[key] is None:
-			continue
-
-		#log(key)
-		times = channel_times[key]
-		
-		for time in times:
-			realtime = (time - 1) / fps
-			
-			if realtime > duration:
-				duration = realtime
-
-			trans = Vector()
-			quat  = Quaternion()
-			scale = Vector()
-			rot   = Euler()
-			rtype = None
-
-			# I know this can be cleaned up...
-			for curve in channel_ipos[key]:
-				val       = curve[time]
-				bezPoints = curve.bezierPoints
-				if curve.name == 'LocX':
-					trans[0] = val
-				elif curve.name == 'LocY':
-					trans[1] = val
-				elif curve.name == 'LocZ':
-					trans[2] = val
-				elif curve.name == 'QuatW':
-					quat.w = val
-					rtype  = "Quat"
-				elif curve.name == 'QuatX':
-					quat.x = val
-					rtype  = "Quat"
-				elif curve.name == 'QuatY':
-					quat.y = val
-					rtype  = "Quat"
-				elif curve.name == 'QuatZ':
-					quat.z = val
-					rtype  = "Quat"
-				elif curve.name == 'ScaleX':
-					scale[0] = val
-				elif curve.name == 'ScaleY':
-					scale[1] = val
-				elif curve.name == 'ScaleZ':
-					scale[2] = val
-				elif curve.name == 'RotX':
-					rot.x = val * 10
-					rtype = "Euler"
-				elif curve.name == 'RotY':
-					rot.y = val * 10
-					rtype = "Euler"
-				elif curve.name == 'RotZ':
-					rot.z = val * 10
-					rtype = "Euler"
-				else:
-					continue
-			
-			if key == 'Scale':
-				channel_samplers[key].keys.append((realtime, scale[0], scale[1], scale[2]))
-				channel_samplers[key].type = "Vec3"
-                                channel_samplers[key].setName("scale")
-				
-			elif key == 'Rotation':
-				if rtype == "Quat":
-					quat.normalize()
-                                        channel_samplers[key].keys.append((realtime, quat.x, quat.y, quat.z, quat.w))
-                                        channel_samplers[key].type = "Quat"
-                                        channel_samplers[key].setName("quaternion")
-					
-				elif rtype == "Euler":
-                                        channel_samplers[key].keys.append((realtime, math.radians(rot.x)  , math.radians(rot.y), math.radians(rot.z) ))
-                                        channel_samplers[key].type = "Vec3"
-                                        channel_samplers[key].setName("euler")
-					
-			elif key == 'Translation':
-				channel_samplers[key].keys.append((realtime, trans[0], trans[1], trans[2]))
-				channel_samplers[key].type = "Vec3"
-                                channel_samplers[key].setName("position")
-				
-		channels.append(channel_samplers[key])
-	return channels
-
-
-COORDINATE_SYSTEMS = ['local','real']
-COORD_LOCAL = 0
-COORD_REAL = 1
-usrCoord = COORD_LOCAL # what the user wants
-usrDelta = [0,0,0,0,0,0,0,0,0] #order specific - Loc xyz Rot xyz
-R2D = 18/3.1415  # radian to grad
-########################################
-def getCurves(ipo):
-	ipos = [
-			ipo[Ipo.OB_LOCX],
-			ipo[Ipo.OB_LOCY],
-			ipo[Ipo.OB_LOCZ],
-			ipo[Ipo.OB_ROTX], #get the curves in this order
-			ipo[Ipo.OB_ROTY],
-			ipo[Ipo.OB_ROTZ],
-			ipo[Ipo.OB_SCALEX], #get the curves in this order
-			ipo[Ipo.OB_SCALEY],
-			ipo[Ipo.OB_SCALEZ]
-			]
-	return ipos
-
-########################################
-def getLocLocal(ob):
-	key = [
-			ob.LocX, 
-			ob.LocY, 
-			ob.LocZ,
-			ob.RotX*R2D, #get the curves in this order
-			ob.RotY*R2D, 
-			ob.RotZ*R2D,
-			ob.SizeX, 
-			ob.SizeY, 
-			ob.SizeZ,
-			]
-	return key
-
-########################################
-def getLocReal(ob):
-	obMatrix = ob.matrixWorld #Thank you IdeasMan42
-	loc = obMatrix.translationPart()
-	rot = obMatrix.toEuler()
-	scale = obMatrix.scalePart()
-	key = [
-			loc.x,
-			loc.y,
-			loc.z,
-			rot.x/10,
-			rot.y/10,
-			rot.z/10,
-                        scale.x,
-                        scale.y,
-                        scale.z,
-			]
-	return key
-########################################
-def getLocRot(ob,space):
-	if space in xrange(len(COORDINATE_SYSTEMS)):
-		if space == COORD_LOCAL:
-			key = getLocLocal(ob)
-			return key
-		elif space == COORD_REAL:
-			key = getLocReal(ob)
-			return key
-		else: #hey, programmers make mistakes too.
-			debug('Fatal Error: getLoc called with %i' % space)
-	return
-
-########################################
-def addPoint(time,keyLocRotSize,ipos):
-	for i in range(len(ipos)):
-		point = BezTriple.New() #this was new with Blender 2.45 API
-		point.pt = (time, keyLocRotSize[i])
-		point.handleTypes = [1,1]
-
-		ipos[i].append(point)
-	return ipos
-
-def getRangeFromIpo(ipo):
-    first_frame = 1
-    last_frame = 1
-    for channel in ipo:
-        for key in channel.bezierPoints:
-            if key.vec[1][0] > last_frame:
-                last_frame = int(key.vec[1][0])
-    debug("range of ipo %s : %s %s " % (ipo.name, first_frame,last_frame))
-    return (first_frame, last_frame, first_frame)
-
-########################################
-def bakeFrames(ob,myipo): #bakes an object in a scene, returning the IPO containing the curves
-	myipoName = myipo.getName()
-	debug('Baking frames for scene %s object %s to ipo %s' % (bpy.data.scenes.active.getName(),ob.getName(),myipoName))
-	ipos = getCurves(myipo)
-	#TODO: Gui setup idea: myOffset
-	# reset action to start at frame 1 or at location
-	myOffset=0 #=1-staframe
-	#loop through frames in the animation. Often, there is rollup and the mocap starts late
-	staframe,endframe,curframe = getRangeFromIpo(ob.getIpo())
-	for frame in range(staframe, endframe+1):
-		#tell Blender to advace to frame
-		Blender.Set('curframe',frame) # computes the constrained location of the 'real' objects
-                
-		#using the constrained Loc Rot of the object, set the location of the unconstrained clone. Yea! Clones are FreeMen
-		key = getLocRot(ob,usrCoord) #a key is a set of specifed exact channel values (LocRotScale) for a certain frame
-		key = [a+b for a,b in zip(key, usrDelta)] #offset to the new location
-		myframe= frame+myOffset
-		Blender.Set('curframe',myframe)
-		
-		time = Blender.Get('curtime') #for BezTriple
-		ipos = addPoint(time,key,ipos) #add this data at this time to the ipos
-		debug('%s %i %.3f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f' % (myipoName, myframe, time, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8]))
-	Blender.Set('curframe',staframe)
-	return ipos
-
-
-def getBakedIpos(obj, ori_ipo, anim_fps):
-
-    # Get the dummy action if it has no users
-    dummy_ipos_name = ori_ipo.getName() + "_bake"
-    try:
-        baked = bpy.data.ipos[dummy_ipos_name]
-    except:
-        baked = None
-    
-    if not baked:
-        baked = bpy.data.ipos.new(dummy_ipos_name,'Object')
-        baked.fakeUser = False
-    else:
-        baked[Ipo.OB_LOCX] = None
-        baked[Ipo.OB_LOCY] = None
-        baked[Ipo.OB_LOCZ] = None
-        baked[Ipo.OB_ROTX] = None
-        baked[Ipo.OB_ROTY] = None
-        baked[Ipo.OB_ROTZ] = None
-        baked[Ipo.OB_SCALEX] = None
-        baked[Ipo.OB_SCALEY] = None
-        baked[Ipo.OB_SCALEZ] = None
-
-    baked.addCurve('LocX')
-    baked.addCurve('LocY')
-    baked.addCurve('LocZ')
-    baked.addCurve('RotX')
-    baked.addCurve('RotY')
-    baked.addCurve('RotZ')
-    baked.addCurve('ScaleX')
-    baked.addCurve('ScaleY')
-    baked.addCurve('ScaleZ')
-
-    dummy_object = None
-    if obj is None:
-        log('WARNING Bake ipo %s without object, it means that it will not be possible to bake constraint, use an name ipo that contains the object associated to him, like myipo-MyObject' % ori_ipo.name)
-        obj = bpy.data.scenes.active.objects.new('Empty')
-        dummy_object = obj
-
-    if obj is not None:
-        previous_ipo = obj.getIpo()
-        obj.setIpo(ori_ipo)
-        bakeFrames(obj, baked)
-        obj.setIpo(previous_ipo)
-
-    if dummy_object:
-        bpy.data.scenes.active.objects.unlink(dummy_object)
-        
-    return baked
-
-def getBakedAction(armatureObject, action , sample_rate = 25):
-    """
-        Bakes supplied action for supplied armature.
-        Returns baked action.
-    """
-    pose = armatureObject.getPose()
-    armature_data = armatureObject.getData();
-    pose_bones = pose.bones.values()
-    rest_bones = armature_data.bones
-
-    POSE_XFORM = [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT, Blender.Object.Pose.SIZE ]
-    #POSE_XFORM= [Object.Pose.LOC,Object.Pose.ROT,Object.Pose.SIZE]
- 
-    blender_fps = 25
-    if sample_rate > blender_fps:
-        sample_rate = blender_fps
-    step = blender_fps / sample_rate
-    
-    startFrame= min(action.getFrameNumbers());
-    endFrame= max(action.getFrameNumbers());
- 
-       
-    dummy_action_name = "_" + action.name
-    # Get the dummy action if it has no users
-    try:
-        baked_action = bpy.data.actions[dummy_action_name]
-    except:
-        baked_action = None
-    
-    if not baked_action:
-        baked_action          = bpy.data.actions.new(dummy_action_name)
-        baked_action.fakeUser = False
-    for channel in baked_action.getChannelNames():
-        baked_action.removeChannel(channel)
-    
-    old_quats={}
-    old_locs={}
-    old_sizes={}
-    
-    baked_locs={}
-    baked_quats={}
-    baked_sizes={}
-    
-    action.setActive(armatureObject)
-    frames = range(startFrame, endFrame+1, int(step))
-    if frames[-1:] != endFrame :
-        frames.append(endFrame)
-    for current_frame in frames:
-
-        Blender.Set('curframe', current_frame)
-        for i in range(len(pose_bones)):
-            
-            bone_name=pose_bones[i].name;
-
-            rest_bone=rest_bones[bone_name]
-            matrix = Matrix(pose_bones[i].poseMatrix)
-            rest_matrix= Matrix(rest_bone.matrix['ARMATURESPACE'])
-            
-            parent_bone=rest_bone.parent
-
-            if parent_bone:
-                parent_pose_bone=pose.bones[parent_bone.name]
-                matrix=matrix * Matrix(parent_pose_bone.poseMatrix).invert()
-                rest_matrix=rest_matrix * Matrix(parent_bone.matrix['ARMATURESPACE']).invert()
-            
-            #print "before\n", matrix
-            #print "before quat\n", pose_bones[i].quat;
-                
-            #print "localised pose matrix\n", matrix
-            #print "localised rest matrix\n", rest_matrix
-            matrix=matrix * Matrix(rest_matrix).invert()
-                
-                
-            old_quats[bone_name] = Quaternion(pose_bones[i].quat);
-            old_locs[bone_name] = Vector(pose_bones[i].loc);
-            old_sizes[bone_name] = Vector(pose_bones[i].size);
-            
-            baked_locs[bone_name] = Vector(matrix.translationPart())
-            baked_quats[bone_name] = Quaternion(matrix.toQuat())
-            baked_sizes[bone_name] = Vector(matrix.scalePart())
-
-        baked_action.setActive(armatureObject)
-        Blender.Set('curframe', current_frame)
-        for i in range(len(pose_bones)):
-            pose_bones[i].quat = baked_quats[pose_bones[i].name]
-            pose_bones[i].loc = baked_locs[pose_bones[i].name]
-            pose_bones[i].size = baked_sizes[pose_bones[i].name]
-            pose_bones[i].insertKey(armatureObject, current_frame, POSE_XFORM)
-            
-        action.setActive(armatureObject)
-        Blender.Set('curframe', current_frame)
-
-        for name, quat in old_quats.iteritems():
-            pose.bones[name].quat=quat
-            
-        for name, loc in old_locs.iteritems():
-            pose.bones[name].loc=loc
-            
-        
-    pose.update()
-    return baked_action
-
-def getBakedAction3(ob_arm, action, sample_rate):
-        #print "test ob action enter ", ob_arm.action
-        blender_fps = 25
-	if sample_rate > blender_fps:
-		sample_rate = blender_fps
-
-	step = blender_fps / sample_rate
-
-	frames      = action.getFrameNumbers()
-	start_frame = min(frames)
-	end_frame   = max(frames)
-	'''
-	If you are currently getting IPO's this function can be used to
-	return a list of frame aligned bone dictionary's
-	
-	The data in these can be swaped in for the IPO loc and quat
-	
-	If you want to bake an action, this is not as hard and the ipo hack can be removed.
-	'''
-	
-	# --------------------------------- Dummy Action! Only for this functon
-	backup_action     = ob_arm.action
-	backup_frame      = Blender.Get('curframe')
-	DUMMY_ACTION_NAME = action.name + "_baked"
-
-	# Get the dummy action if it has no users
-	try:
-		new_action = bpy.data.actions[DUMMY_ACTION_NAME]
-	except:
-		new_action = None
-	
-	if not new_action:
-		new_action          = bpy.data.actions.new(DUMMY_ACTION_NAME)
-		new_action.fakeUser = False
-
-	POSE_XFORM = [Blender.Object.Pose.LOC, Blender.Object.Pose.ROT, Blender.Object.Pose.SIZE ]
-	
-	# Each dict a frame
-	bake_data = [{} for i in xrange(1+end_frame-start_frame)]
-	pose          = ob_arm.getPose()
-	armature_data = ob_arm.getData()
-	pose_bones    = pose.bones
-	
-	# --------------------------------- Build a list of arma data for reuse
-	armature_bone_data = []
-	bones_index        = {}
-
-	for bone_name, rest_bone in armature_data.bones.items():
-		pose_bone       = pose_bones[bone_name]
-		rest_matrix     = rest_bone.matrix['ARMATURESPACE']
-		rest_matrix_inv = rest_matrix.copy().invert()
-
-		armature_bone_data.append([len(bones_index), -1, bone_name, rest_bone, rest_matrix, rest_matrix_inv, pose_bone, None])
-		
-		bones_index[bone_name] = len(bones_index)
-	
-	# Set the parent ID's
-	for bone_name, pose_bone in pose_bones.items():
-		parent = pose_bone.parent
-
-		if parent:
-			bone_index   = bones_index[bone_name]
-			parent_index = bones_index[parent.name]
-
-			armature_bone_data[bone_index][1] = parent_index
-	
-	# --------------------------------- Main loop to collect IPO data
-	frame_index = 0
-	
-	for current_frame in xrange(start_frame, end_frame + 1):
-		ob_arm.action = action
-		Blender.Set('curframe', current_frame)
-		ob_arm.action = new_action
-		
-		for index, parent_index, bone_name, rest_bone, rest_matrix, rest_matrix_inv, pose_bone, ipo in armature_bone_data:
-			matrix      = pose_bone.poseMatrix
-			parent_bone = rest_bone.parent
-			
-			if parent_index != -1:
-				parent_pose_matrix     = armature_bone_data[parent_index][6].poseMatrix
-				parent_bone_matrix_inv = armature_bone_data[parent_index][5]
-				matrix                 = matrix * parent_pose_matrix.copy().invert()
-				rest_matrix            = rest_matrix * parent_bone_matrix_inv
-			
-			matrix=matrix * rest_matrix.copy().invert()
-			
-			pose_bone.quat = matrix.toQuat()
-			pose_bone.loc  = matrix.translationPart()
-			pose_bone.size  = matrix.scalePart()
-
-			# create a full new action
-			pose_bone.insertKey(ob_arm, int(frame_index + 1), POSE_XFORM)
-		frame_index += step
-	
-	ob_arm.action = backup_action
-	Blender.Set('curframe', backup_frame)
-
-        # if no action was previously set
-        # then we put the pose in a rest position to avoid bad matrix when exporting
-        # object
-        if ob_arm.action is None:
-                for bone_name, rest_bone in ob_arm.getPose().bones.items():
-                        rest_bone.quat = Quaternion()
-                        rest_bone.loc = Vector(0,0,0)
-                        rest_bone.size = Vector(1,1,1)
-                ob_arm.getPose().update()
-        
-        #print "test ob action leave ", ob_arm.action
-	return new_action
-
 class Export(object):
     def __init__(self, config = None):
         object.__init__(self)
 
         if obj.getIpo():
             anim = None
-            anim = self.createAnimationFromIpo(obj.getIpo(), obj.getName())
+            ipo2animation = BlenderIpoOrActionToAnimation(ipo = obj.getIpo(), config = self.config)
+            anim = ipo2animation.createAnimationFromIpo(obj.getName())
             self.animations[anim.name] = anim
 
             update_callback = UpdateTransform()
                 if action.getName().find("_baked",-len("_baked")) is not -1:
                         continue
                 if isActionLinkedToObject(action, posbones.keys()) is True:
-                    anim = self.createAnimationFromAction(action)
+                    action2animation = BlenderIpoOrActionToAnimation(action = action, config = self.config)
+                    anim = action2animation.createAnimationFromAction()
                     if anim is not None:
                         self.animations[anim.name] = anim
         return skeleton
 
-    def createAnimationFromAction(self, action):
-        # check if it's already a baked action (if yes we skip it)
-        if action.getName().find("_baked",-len("_baked")) is not -1:
-            return None
-
-        action_name = action.getName()
-        armature = findArmatureObjectForAction(action)
-        if armature is not None and self.config.anim_bake.lower() == "force":
-            action = getBakedAction(armature, action, self.config.anim_fps)
-
-        animation = Animation()
-        animation.setName(action_name)
-        for obj_name, ipo in action.getAllChannelIpos().items():
-            # TODO: I'm not sure what's going on here? :)
-            # It means it's an solid object animation.
-            if obj_name == 'Object':
-                log("WARNING dont support Object Action export (%s)" % action_name)
-                return None
-
-            self.convertIpoToAnimation(obj_name, animation, ipo)
-        return animation
-
     def createAnimationsFromList(self, animation_list):
         if DEBUG: debug("create animation from list %s" % (str(animation_list)))
         animations_result = {}
         for anim in animation_list:
             res = None
             if len(list(bpy.data.ipos)) and type(anim) is type(list(bpy.data.ipos)[0]):
-                res = self.createAnimationFromIpo(anim)
+                ipo2animation = BlenderIpoOrActionToAnimation(ipo = anim, config = self.config)
+                res = ipo2animation.createAnimationFromIpo()
+
             elif len(list(bpy.data.actions)) and type(anim) is type(list(bpy.data.actions)[0]):
-                res = self.createAnimationFromAction(anim)
+                action2animation = BlenderIpoOrActionToAnimation(action = anim, config = self.config)
+                res = action2animation.createAnimationFromAction()
             if res is not None:
                 if DEBUG: debug("animation \"%s\" created" % (res.name))
                 self.animations[res.name] = res
             else:
                 log("WARNING can't create animation from %s" % anim)
                 
-        
-
-    def createAnimationFromIpo(self, ipo, name = None):
-        if name is None:
-            name = "unknown"
-        ipos_baked = ipo
-        if self.config.anim_bake.lower() == "force":
-            obj = findObjectForIpo(ipo)
-            ipos_baked = getBakedIpos(obj, ipo, self.config.anim_fps)
-        animation = Animation()
-        animation.setName(ipo.name + "_ipo")
-        self.convertIpoToAnimation(name, animation, ipos_baked)
-        return animation
-
-    def convertIpoToAnimation(self, name, ani, ipo):
-        if not ipo:
-            ipo = []
-        # Or we could call the other "type" here.
-        channels = exportKeyframeSplitRotationTranslationScale(ipo, self.config.anim_fps)
-        for i in channels:
-            i.target = name
-            ani.channels.append(i)
-
-
     def process(self):
         initReferenceCount()
         self.scene_name = bpy.data.scenes.active.name
         self.lights[lightsource.name] = lightsource # will be used to index lightnum at the end
         return lightsource
 
+
 class BlenderLightToLightSource(object):
     def __init__(self, *args, **kwargs):
         self.object = kwargs["lamp"]
         if DEBUG: debug("geometry uvs %s" % (str(uvs)))
         geom.uvs = {}
         if len(mesh.materials) > 0:
-            # support only one material by mesh right now
             mat_source = mesh.materials[index_material]
             if mat_source is not None:
                 m = Material()
     def __init__(self, *args, **kwargs):
         BlenderObjectToGeometry.__init__(self, *args, **kwargs)
         self.geom_type = RigGeometry
+
+
+class BlenderIpoOrActionToAnimation(object):
+
+    def __init__(self, *args, **kwargs):
+        self.ipos = kwargs.get("ipo", None)
+        self.action = kwargs.get("action", None)
+        self.config = kwargs["config"]
+        self.animation = None
+
+    def getTypeOfIpo(self, ipo):
+        try:
+            ipo.curveConsts['MAT_R']
+            return "Material"
+        except:
+            pass
+
+        try:
+            ipo.curveConsts['OB_LOCX']
+            return "Object"
+        except:
+            pass
+        return None
+
+    def createAnimationFromIpo(self, name = None):
+        ipo = self.ipos
+        if name is None:
+            name = "unknown"
+        ipos_baked = ipo
+        if self.config.anim_bake.lower() == "force":
+            ipotype = self.getTypeOfIpo(ipo)
+            if ipotype == "Object":
+                obj = findObjectForIpo(ipo)
+                baker = BakeIpoForObject(object = obj, ipo = ipo, config = None)
+                ipos_baked = baker.getBakedIpos()
+            elif ipotype == "Material":
+                mat = findMaterialForIpo(ipo)
+                baker = BakeIpoForMaterial(material = mat, ipo = ipo, config = None)
+                ipos_baked = baker.getBakedIpos()
+            else:
+                log("WARNING dont know ipo type %s" % ipo.getName())
+        animation = Animation()
+        animation.setName(ipo.name + "_ipo")
+        self.convertIpoToAnimation(name, animation, ipos_baked)
+        self.animation = animation
+        return animation
+
+    def createAnimationFromAction(self):
+        action = self.action
+        # check if it's already a baked action (if yes we skip it)
+        if action.getName().find("_baked",-len("_baked")) is not -1:
+            return None
+
+        action_name = action.getName()
+        armature = findArmatureObjectForAction(action)
+        if armature is not None and self.config.anim_bake.lower() == "force":
+            baker = BakeAction(armature = armature, action = action, config = self.config)
+            action = baker.getBakedAction()
+
+        animation = Animation()
+        animation.setName(action_name)
+        for obj_name, ipo in action.getAllChannelIpos().items():
+            # TODO: I'm not sure what's going on here? :)
+            # It means it's an solid object animation.
+            if obj_name == 'Object':
+                log("WARNING dont support Object Action export (%s)" % action_name)
+                return None
+
+            self.convertIpoToAnimation(obj_name, animation, ipo)
+        self.animation = animation
+        return animation
+
+    def convertIpoToAnimation(self, name, ani, ipo):
+        if not ipo:
+            ipo = []
+        # Or we could call the other "type" here.
+        channels = self.exportKeyframeSplitRotationTranslationScale(ipo, self.config.anim_fps)
+        for i in channels:
+            i.target = name
+            ani.channels.append(i)
+
+    def exportKeyframeSplitRotationTranslationScale(self, ipo, fps):
+        SUPPORTED_IPOS = (
+            'RotX', 'RotY', 'RotZ',
+            'QuatW', 'QuatX', 'QuatY', 'QuatZ',
+            'LocX', 'LocY', 'LocZ',
+            'ScaleX', 'ScaleY', 'ScaleZ'
+            'R', 'G', 'B', 'Alpha'
+            )
+
+        channels         = []
+        channel_times    = {'Rotation': set(), 'Translation': set(), 'Scale': set(), 'Color' : set() }
+        channel_names    = {'Rotation': 'rotation', 'Translation': 'position', 'Scale': 'scale', 'Color' : 'color'}
+        channel_samplers = {'Rotation': None, 'Translation': None, 'Scale': None, 'Color' : None}
+        channel_ipos     = {'Rotation': [], 'Translation': [], 'Scale': [], 'Color': []}
+        duration = 0
+
+        for curve in ipo:
+            if curve.name not in SUPPORTED_IPOS:
+                continue
+
+            elif curve.name[ : 3] == "Rot" or curve.name[ : 4] == "Quat":
+                times = channel_times['Rotation']
+                channel_ipos['Rotation'].append(curve)
+
+            elif curve.name[ : 3] == "Loc":
+                times = channel_times['Translation']
+                channel_ipos['Translation'].append(curve)
+
+            elif curve.name[ : 5] == "Scale":
+                times = channel_times['Scale']
+                channel_ipos['Scale'].append(curve)
+
+            for p in curve.bezierPoints:
+                times.add(p.pt[0])
+
+        for key in channel_times.iterkeys():
+            time = list(channel_times[key])
+            time.sort()
+            channel_times[key] = time
+
+            if len(time) > 0:
+                channel_samplers[key] = Channel()
+
+        for key in channel_times.iterkeys():
+            if channel_samplers[key] is None:
+                continue
+
+            times = channel_times[key]
+
+            for time in times:
+                realtime = (time - 1) / fps
+
+                if realtime > duration:
+                    duration = realtime
+
+                trans = Vector()
+                quat  = Quaternion()
+                scale = Vector()
+                rot   = Euler()
+                rtype = None
+
+                            # I know this can be cleaned up...
+                for curve in channel_ipos[key]:
+                    val       = curve[time]
+                    bezPoints = curve.bezierPoints
+
+                    if curve.name == 'LocX':
+                        trans[0] = val
+                    elif curve.name == 'LocY':
+                        trans[1] = val
+                    elif curve.name == 'LocZ':
+                        trans[2] = val
+                    elif curve.name == 'QuatW':
+                        quat.w = val
+                        rtype  = "Quat"
+                    elif curve.name == 'QuatX':
+                        quat.x = val
+                        rtype  = "Quat"
+                    elif curve.name == 'QuatY':
+                        quat.y = val
+                        rtype  = "Quat"
+                    elif curve.name == 'QuatZ':
+                        quat.z = val
+                        rtype  = "Quat"
+                    elif curve.name == 'ScaleX':
+                        scale[0] = val
+                    elif curve.name == 'ScaleY':
+                        scale[1] = val
+                    elif curve.name == 'ScaleZ':
+                        scale[2] = val
+                    elif curve.name == 'RotX':
+                        rot.x = val * 10
+                        rtype = "Euler"
+                    elif curve.name == 'RotY':
+                        rot.y = val * 10
+                        rtype = "Euler"
+                    elif curve.name == 'RotZ':
+                        rot.z = val * 10
+                        rtype = "Euler"
+                    else:
+                        continue
+
+                if key == 'Scale':
+                    channel_samplers[key].keys.append((realtime, scale[0], scale[1], scale[2]))
+                    channel_samplers[key].type = "Vec3"
+                    channel_samplers[key].setName("scale")
+
+                elif key == 'Rotation':
+                    if rtype == "Quat":
+                        quat.normalize()
+                        channel_samplers[key].keys.append((realtime, quat.x, quat.y, quat.z, quat.w))
+                        channel_samplers[key].type = "Quat"
+                        channel_samplers[key].setName("quaternion")
+
+                    elif rtype == "Euler":
+                        channel_samplers[key].keys.append((realtime, math.radians(rot.x)  , math.radians(rot.y), math.radians(rot.z) ))
+                        channel_samplers[key].type = "Vec3"
+                        channel_samplers[key].setName("euler")
+
+                elif key == 'Translation':
+                    channel_samplers[key].keys.append((realtime, trans[0], trans[1], trans[2]))
+                    channel_samplers[key].type = "Vec3"
+                    channel_samplers[key].setName("position")
+
+            channels.append(channel_samplers[key])
+            #print channel_samplers[key]
+        return channels

File test/test-armature.py.in

 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # Authors:
-#  Cedric Pinson <mornifle@plopbyte.net>
+#  Cedric Pinson <cedric.pinson@plopbyte.net>
 #
 
 """
         print v0, " ", v1
         self.assertEquals(True, v0 != v1)
         text = exporter.root.update_callbacks[0].ascii()
-        result = '$osgAnimation::BasicAnimationManager {\n$#UniqueID uniqid_BasicAnimationManager_38\n$#num_animations 1\n  osgAnimation::Animation {\n    UniqueID uniqid_Animation_11\n    name "Action"\n    num_channels 9\n    Channel {\n      name "quaternion"\n      target "Bone.001"\n      Keyframes "Quat" 100 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 0.00064 0.00000 -0.00000 1.00000\n        key 0.08000 0.00257 0.00000 -0.00000 1.00000\n        key 0.12000 0.00580 0.00000 0.00000 0.99998\n        key 0.16000 0.01035 0.00000 0.00000 0.99995\n        key 0.20000 0.01625 0.00000 -0.00000 0.99987\n        key 0.24000 0.02350 -0.00000 0.00000 0.99972\n        key 0.28000 0.03212 0.00000 -0.00000 0.99948\n        key 0.32000 0.04212 0.00000 0.00000 0.99911\n        key 0.36000 0.05353 0.00000 0.00000 0.99857\n        key 0.40000 0.06633 0.00000 0.00000 0.99780\n        key 0.44000 0.08052 -0.00000 -0.00000 0.99675\n        key 0.48000 0.09610 0.00000 -0.00000 0.99537\n        key 0.52000 0.11304 -0.00000 0.00000 0.99359\n        key 0.56000 0.13131 0.00000 0.00000 0.99134\n        key 0.60000 0.15084 -0.00000 0.00000 0.98856\n        key 0.64000 0.17157 0.00000 0.00000 0.98517\n        key 0.68000 0.19342 0.00000 -0.00000 0.98112\n        key 0.72000 0.21627 0.00000 0.00000 0.97633\n        key 0.76000 0.24000 0.00000 0.00000 0.97077\n        key 0.80000 0.26447 -0.00000 0.00000 0.96439\n        key 0.84000 0.28951 -0.00000 0.00000 0.95717\n        key 0.88000 0.31495 -0.00000 -0.00000 0.94911\n        key 0.92000 0.34061 0.00000 -0.00000 0.94021\n        key 0.96000 0.36628 -0.00000 0.00000 0.93050\n        key 1.00000 0.39179 -0.00000 -0.00000 0.92005\n        key 1.04000 0.41694 0.00000 0.00000 0.90893\n        key 1.08000 0.44155 0.00000 0.00000 0.89723\n        key 1.12000 0.46547 -0.00000 -0.00000 0.88506\n        key 1.16000 0.48855 0.00000 0.00000 0.87254\n        key 1.20000 0.51065 0.00000 -0.00000 0.85979\n        key 1.24000 0.53169 -0.00000 0.00000 0.84694\n        key 1.28000 0.55157 0.00000 0.00000 0.83413\n        key 1.32000 0.57023 0.00000 0.00000 0.82148\n        key 1.36000 0.58765 -0.00000 -0.00000 0.80912\n        key 1.40000 0.60379 0.00000 0.00000 0.79714\n        key 1.44000 0.61866 0.00000 0.00000 0.78566\n        key 1.48000 0.63225 0.00000 -0.00000 0.77476\n        key 1.52000 0.64459 0.00000 0.00000 0.76453\n        key 1.56000 0.65571 -0.00000 -0.00000 0.75501\n        key 1.60000 0.66564 0.00000 -0.00000 0.74627\n        key 1.64000 0.67441 -0.00000 0.00000 0.73836\n        key 1.68000 0.68206 -0.00000 -0.00000 0.73130\n        key 1.72000 0.68863 0.00000 -0.00000 0.72512\n        key 1.76000 0.69414 0.00000 0.00000 0.71984\n        key 1.80000 0.69865 -0.00000 0.00000 0.71546\n        key 1.84000 0.70217 0.00000 -0.00000 0.71201\n        key 1.88000 0.70473 -0.00000 0.00000 0.70947\n        key 1.92000 0.70636 -0.00000 -0.00000 0.70785\n        key 1.96000 0.70707 0.00000 0.00000 0.70714\n        key 2.00000 0.70711 -0.00000 0.00000 0.70711\n        key 2.04000 0.70711 -0.00000 0.00000 0.70711\n        key 2.08000 0.70711 -0.00000 0.00000 0.70711\n        key 2.12000 0.70711 -0.00000 0.00000 0.70711\n        key 2.16000 0.70711 -0.00000 0.00000 0.70711\n        key 2.20000 0.70711 -0.00000 0.00000 0.70711\n        key 2.24000 0.70711 -0.00000 0.00000 0.70711\n        key 2.28000 0.70711 -0.00000 0.00000 0.70711\n        key 2.32000 0.70711 -0.00000 0.00000 0.70711\n        key 2.36000 0.70711 -0.00000 0.00000 0.70711\n        key 2.40000 0.70711 -0.00000 0.00000 0.70711\n        key 2.44000 0.70711 -0.00000 0.00000 0.70711\n        key 2.48000 0.70711 -0.00000 0.00000 0.70711\n        key 2.52000 0.70711 -0.00000 0.00000 0.70711\n        key 2.56000 0.70711 -0.00000 0.00000 0.70711\n        key 2.60000 0.70711 -0.00000 0.00000 0.70711\n        key 2.64000 0.70711 -0.00000 0.00000 0.70711\n        key 2.68000 0.70711 -0.00000 0.00000 0.70711\n        key 2.72000 0.70711 -0.00000 0.00000 0.70711\n        key 2.76000 0.70711 -0.00000 0.00000 0.70711\n        key 2.80000 0.70711 -0.00000 0.00000 0.70711\n        key 2.84000 0.70711 -0.00000 0.00000 0.70711\n        key 2.88000 0.70711 -0.00000 0.00000 0.70711\n        key 2.92000 0.70711 -0.00000 0.00000 0.70711\n        key 2.96000 0.70711 -0.00000 0.00000 0.70711\n        key 3.00000 0.70711 -0.00000 0.00000 0.70711\n        key 3.04000 0.70711 -0.00000 0.00000 0.70711\n        key 3.08000 0.70711 -0.00000 0.00000 0.70711\n        key 3.12000 0.70711 -0.00000 0.00000 0.70711\n        key 3.16000 0.70711 -0.00000 0.00000 0.70711\n        key 3.20000 0.70711 -0.00000 0.00000 0.70711\n        key 3.24000 0.70711 -0.00000 0.00000 0.70711\n        key 3.28000 0.70711 -0.00000 0.00000 0.70711\n        key 3.32000 0.70711 -0.00000 0.00000 0.70711\n        key 3.36000 0.70711 -0.00000 0.00000 0.70711\n        key 3.40000 0.70711 -0.00000 0.00000 0.70711\n        key 3.44000 0.70711 -0.00000 0.00000 0.70711\n        key 3.48000 0.70711 -0.00000 0.00000 0.70711\n        key 3.52000 0.70711 -0.00000 0.00000 0.70711\n        key 3.56000 0.70711 -0.00000 0.00000 0.70711\n        key 3.60000 0.70711 -0.00000 0.00000 0.70711\n        key 3.64000 0.70711 -0.00000 0.00000 0.70711\n        key 3.68000 0.70711 -0.00000 0.00000 0.70711\n        key 3.72000 0.70711 -0.00000 0.00000 0.70711\n        key 3.76000 0.70711 -0.00000 0.00000 0.70711\n        key 3.80000 0.70711 -0.00000 0.00000 0.70711\n        key 3.84000 0.70711 -0.00000 0.00000 0.70711\n        key 3.88000 0.70711 -0.00000 0.00000 0.70711\n        key 3.92000 0.70711 -0.00000 0.00000 0.70711\n        key 3.96000 0.70711 -0.00000 0.00000 0.70711\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone.001"\n      Keyframes "Vec3" 100 {\n        key 0.00000 1.00000 1.00000 1.00000\n        key 0.04000 1.00000 1.00000 1.00000\n        key 0.08000 1.00000 1.00000 1.00000\n        key 0.12000 1.00000 1.00000 1.00000\n        key 0.16000 1.00000 1.00000 1.00000\n        key 0.20000 1.00000 1.00000 1.00000\n        key 0.24000 1.00000 1.00000 1.00000\n        key 0.28000 1.00000 1.00000 1.00000\n        key 0.32000 1.00000 1.00000 1.00000\n        key 0.36000 1.00000 1.00000 1.00000\n        key 0.40000 1.00000 1.00000 1.00000\n        key 0.44000 1.00000 1.00000 1.00000\n        key 0.48000 1.00000 1.00000 1.00000\n        key 0.52000 1.00000 1.00000 1.00000\n        key 0.56000 1.00000 1.00000 1.00000\n        key 0.60000 1.00000 1.00000 1.00000\n        key 0.64000 1.00000 1.00000 1.00000\n        key 0.68000 1.00000 1.00000 1.00000\n        key 0.72000 1.00000 1.00000 1.00000\n        key 0.76000 1.00000 1.00000 1.00000\n        key 0.80000 1.00000 1.00000 1.00000\n        key 0.84000 1.00000 1.00000 1.00000\n        key 0.88000 1.00000 1.00000 1.00000\n        key 0.92000 1.00000 1.00000 1.00000\n        key 0.96000 1.00000 1.00000 1.00000\n        key 1.00000 1.00000 1.00000 1.00000\n        key 1.04000 1.00000 1.00000 1.00000\n        key 1.08000 1.00000 1.00000 1.00000\n        key 1.12000 1.00000 1.00000 1.00000\n        key 1.16000 1.00000 1.00000 1.00000\n        key 1.20000 1.00000 1.00000 1.00000\n        key 1.24000 1.00000 1.00000 1.00000\n        key 1.28000 1.00000 1.00000 1.00000\n        key 1.32000 1.00000 1.00000 1.00000\n        key 1.36000 1.00000 1.00000 1.00000\n        key 1.40000 1.00000 1.00000 1.00000\n        key 1.44000 1.00000 1.00000 1.00000\n        key 1.48000 1.00000 1.00000 1.00000\n        key 1.52000 1.00000 1.00000 1.00000\n        key 1.56000 1.00000 1.00000 1.00000\n        key 1.60000 1.00000 1.00000 1.00000\n        key 1.64000 1.00000 1.00000 1.00000\n        key 1.68000 1.00000 1.00000 1.00000\n        key 1.72000 1.00000 1.00000 1.00000\n        key 1.76000 1.00000 1.00000 1.00000\n        key 1.80000 1.00000 1.00000 1.00000\n        key 1.84000 1.00000 1.00000 1.00000\n        key 1.88000 1.00000 1.00000 1.00000\n        key 1.92000 1.00000 1.00000 1.00000\n        key 1.96000 1.00000 1.00000 1.00000\n        key 2.00000 1.00000 1.00000 1.00000\n        key 2.04000 1.00000 1.00000 1.00000\n        key 2.08000 1.00000 1.00000 1.00000\n        key 2.12000 1.00000 1.00000 1.00000\n        key 2.16000 1.00000 1.00000 1.00000\n        key 2.20000 1.00000 1.00000 1.00000\n        key 2.24000 1.00000 1.00000 1.00000\n        key 2.28000 1.00000 1.00000 1.00000\n        key 2.32000 1.00000 1.00000 1.00000\n        key 2.36000 1.00000 1.00000 1.00000\n        key 2.40000 1.00000 1.00000 1.00000\n        key 2.44000 1.00000 1.00000 1.00000\n        key 2.48000 1.00000 1.00000 1.00000\n        key 2.52000 1.00000 1.00000 1.00000\n        key 2.56000 1.00000 1.00000 1.00000\n        key 2.60000 1.00000 1.00000 1.00000\n        key 2.64000 1.00000 1.00000 1.00000\n        key 2.68000 1.00000 1.00000 1.00000\n        key 2.72000 1.00000 1.00000 1.00000\n        key 2.76000 1.00000 1.00000 1.00000\n        key 2.80000 1.00000 1.00000 1.00000\n        key 2.84000 1.00000 1.00000 1.00000\n        key 2.88000 1.00000 1.00000 1.00000\n        key 2.92000 1.00000 1.00000 1.00000\n        key 2.96000 1.00000 1.00000 1.00000\n        key 3.00000 1.00000 1.00000 1.00000\n        key 3.04000 1.00000 1.00000 1.00000\n        key 3.08000 1.00000 1.00000 1.00000\n        key 3.12000 1.00000 1.00000 1.00000\n        key 3.16000 1.00000 1.00000 1.00000\n        key 3.20000 1.00000 1.00000 1.00000\n        key 3.24000 1.00000 1.00000 1.00000\n        key 3.28000 1.00000 1.00000 1.00000\n        key 3.32000 1.00000 1.00000 1.00000\n        key 3.36000 1.00000 1.00000 1.00000\n        key 3.40000 1.00000 1.00000 1.00000\n        key 3.44000 1.00000 1.00000 1.00000\n        key 3.48000 1.00000 1.00000 1.00000\n        key 3.52000 1.00000 1.00000 1.00000\n        key 3.56000 1.00000 1.00000 1.00000\n        key 3.60000 1.00000 1.00000 1.00000\n        key 3.64000 1.00000 1.00000 1.00000\n        key 3.68000 1.00000 1.00000 1.00000\n        key 3.72000 1.00000 1.00000 1.00000\n        key 3.76000 1.00000 1.00000 1.00000\n        key 3.80000 1.00000 1.00000 1.00000\n        key 3.84000 1.00000 1.00000 1.00000\n        key 3.88000 1.00000 1.00000 1.00000\n        key 3.92000 1.00000 1.00000 1.00000\n        key 3.96000 1.00000 1.00000 1.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone.001"\n      Keyframes "Vec3" 100 {\n        key 0.00000 0.00000 0.00000 0.00000\n        key 0.04000 0.00000 0.00000 0.00000\n        key 0.08000 0.00000 0.00000 0.00000\n        key 0.12000 0.00000 0.00000 0.00000\n        key 0.16000 0.00000 0.00000 0.00000\n        key 0.20000 0.00000 0.00000 0.00000\n        key 0.24000 0.00000 0.00000 0.00000\n        key 0.28000 0.00000 0.00000 0.00000\n        key 0.32000 0.00000 0.00000 0.00000\n        key 0.36000 0.00000 0.00000 0.00000\n        key 0.40000 0.00000 0.00000 0.00000\n        key 0.44000 0.00000 0.00000 0.00000\n        key 0.48000 0.00000 0.00000 0.00000\n        key 0.52000 0.00000 0.00000 0.00000\n        key 0.56000 0.00000 0.00000 0.00000\n        key 0.60000 0.00000 0.00000 0.00000\n        key 0.64000 0.00000 0.00000 0.00000\n        key 0.68000 0.00000 0.00000 0.00000\n        key 0.72000 0.00000 0.00000 0.00000\n        key 0.76000 0.00000 0.00000 0.00000\n        key 0.80000 0.00000 0.00000 0.00000\n        key 0.84000 0.00000 0.00000 0.00000\n        key 0.88000 0.00000 0.00000 0.00000\n        key 0.92000 0.00000 0.00000 0.00000\n        key 0.96000 0.00000 0.00000 0.00000\n        key 1.00000 0.00000 0.00000 0.00000\n        key 1.04000 0.00000 0.00000 0.00000\n        key 1.08000 0.00000 0.00000 0.00000\n        key 1.12000 0.00000 0.00000 0.00000\n        key 1.16000 0.00000 0.00000 0.00000\n        key 1.20000 0.00000 0.00000 0.00000\n        key 1.24000 0.00000 0.00000 0.00000\n        key 1.28000 0.00000 0.00000 0.00000\n        key 1.32000 0.00000 0.00000 0.00000\n        key 1.36000 0.00000 0.00000 0.00000\n        key 1.40000 0.00000 0.00000 0.00000\n        key 1.44000 0.00000 0.00000 0.00000\n        key 1.48000 0.00000 0.00000 0.00000\n        key 1.52000 0.00000 0.00000 0.00000\n        key 1.56000 0.00000 0.00000 0.00000\n        key 1.60000 0.00000 0.00000 0.00000\n        key 1.64000 0.00000 0.00000 0.00000\n        key 1.68000 0.00000 0.00000 0.00000\n        key 1.72000 0.00000 0.00000 0.00000\n        key 1.76000 0.00000 0.00000 0.00000\n        key 1.80000 0.00000 0.00000 0.00000\n        key 1.84000 0.00000 0.00000 0.00000\n        key 1.88000 0.00000 0.00000 0.00000\n        key 1.92000 0.00000 0.00000 0.00000\n        key 1.96000 0.00000 0.00000 0.00000\n        key 2.00000 0.00000 0.00000 0.00000\n        key 2.04000 0.00000 0.00000 0.00000\n        key 2.08000 0.00000 0.00000 0.00000\n        key 2.12000 0.00000 0.00000 0.00000\n        key 2.16000 0.00000 0.00000 0.00000\n        key 2.20000 0.00000 0.00000 0.00000\n        key 2.24000 0.00000 0.00000 0.00000\n        key 2.28000 0.00000 0.00000 0.00000\n        key 2.32000 0.00000 0.00000 0.00000\n        key 2.36000 0.00000 0.00000 0.00000\n        key 2.40000 0.00000 0.00000 0.00000\n        key 2.44000 0.00000 0.00000 0.00000\n        key 2.48000 0.00000 0.00000 0.00000\n        key 2.52000 0.00000 0.00000 0.00000\n        key 2.56000 0.00000 0.00000 0.00000\n        key 2.60000 0.00000 0.00000 0.00000\n        key 2.64000 0.00000 0.00000 0.00000\n        key 2.68000 0.00000 0.00000 0.00000\n        key 2.72000 0.00000 0.00000 0.00000\n        key 2.76000 0.00000 0.00000 0.00000\n        key 2.80000 0.00000 0.00000 0.00000\n        key 2.84000 0.00000 0.00000 0.00000\n        key 2.88000 0.00000 0.00000 0.00000\n        key 2.92000 0.00000 0.00000 0.00000\n        key 2.96000 0.00000 0.00000 0.00000\n        key 3.00000 0.00000 0.00000 0.00000\n        key 3.04000 0.00000 0.00000 0.00000\n        key 3.08000 0.00000 0.00000 0.00000\n        key 3.12000 0.00000 0.00000 0.00000\n        key 3.16000 0.00000 0.00000 0.00000\n        key 3.20000 0.00000 0.00000 0.00000\n        key 3.24000 0.00000 0.00000 0.00000\n        key 3.28000 0.00000 0.00000 0.00000\n        key 3.32000 0.00000 0.00000 0.00000\n        key 3.36000 0.00000 0.00000 0.00000\n        key 3.40000 0.00000 0.00000 0.00000\n        key 3.44000 0.00000 0.00000 0.00000\n        key 3.48000 0.00000 0.00000 0.00000\n        key 3.52000 0.00000 0.00000 0.00000\n        key 3.56000 0.00000 0.00000 0.00000\n        key 3.60000 0.00000 0.00000 0.00000\n        key 3.64000 0.00000 0.00000 0.00000\n        key 3.68000 0.00000 0.00000 0.00000\n        key 3.72000 0.00000 0.00000 0.00000\n        key 3.76000 0.00000 0.00000 0.00000\n        key 3.80000 0.00000 0.00000 0.00000\n        key 3.84000 0.00000 0.00000 0.00000\n        key 3.88000 0.00000 0.00000 0.00000\n        key 3.92000 0.00000 0.00000 0.00000\n        key 3.96000 0.00000 0.00000 0.00000\n      }\n    }\n    Channel {\n      name "quaternion"\n      target "Bone.002"\n      Keyframes "Quat" 100 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 -0.00000 0.00000 -0.00000 1.00000\n        key 0.08000 0.00000 0.00000 -0.00000 1.00000\n        key 0.12000 0.00000 0.00000 -0.00000 1.00000\n        key 0.16000 0.00000 0.00000 -0.00000 1.00000\n        key 0.20000 0.00000 0.00000 0.00000 1.00000\n        key 0.24000 -0.00000 -0.00000 -0.00000 1.00000\n        key 0.28000 -0.00000 -0.00000 -0.00000 1.00000\n        key 0.32000 0.00000 0.00000 0.00000 1.00000\n        key 0.36000 0.00000 0.00000 -0.00000 1.00000\n        key 0.40000 0.00000 -0.00000 0.00000 1.00000\n        key 0.44000 0.00000 0.00000 0.00000 1.00000\n        key 0.48000 0.00000 0.00000 -0.00000 1.00000\n        key 0.52000 0.00000 -0.00000 -0.00000 1.00000\n        key 0.56000 0.00000 0.00000 -0.00000 1.00000\n        key 0.60000 0.00000 0.00000 -0.00000 1.00000\n        key 0.64000 0.00000 0.00000 -0.00000 1.00000\n        key 0.68000 0.00000 0.00000 -0.00000 1.00000\n        key 0.72000 0.00000 0.00000 -0.00000 1.00000\n        key 0.76000 0.00000 -0.00000 0.00000 1.00000\n        key 0.80000 0.00000 -0.00000 -0.00000 1.00000\n        key 0.84000 0.00000 -0.00000 -0.00000 1.00000\n        key 0.88000 0.00000 0.00000 0.00000 1.00000\n        key 0.92000 0.00000 0.00000 -0.00000 1.00000\n        key 0.96000 0.00000 0.00000 -0.00000 1.00000\n        key 1.00000 0.00000 0.00000 -0.00000 1.00000\n        key 1.04000 0.00000 0.00000 0.00000 1.00000\n        key 1.08000 0.00000 -0.00000 0.00000 1.00000\n        key 1.12000 0.00000 -0.00000 0.00000 1.00000\n        key 1.16000 0.00000 0.00000 -0.00000 1.00000\n        key 1.20000 -0.00000 -0.00000 -0.00000 1.00000\n        key 1.24000 0.00000 0.00000 -0.00000 1.00000\n        key 1.28000 0.00000 -0.00000 0.00000 1.00000\n        key 1.32000 0.00000 0.00000 -0.00000 1.00000\n        key 1.36000 0.00000 0.00000 -0.00000 1.00000\n        key 1.40000 0.00000 -0.00000 -0.00000 1.00000\n        key 1.44000 0.00000 -0.00000 -0.00000 1.00000\n        key 1.48000 0.00000 0.00000 0.00000 1.00000\n        key 1.52000 -0.00000 -0.00000 -0.00000 1.00000\n        key 1.56000 0.00000 0.00000 0.00000 1.00000\n        key 1.60000 -0.00000 -0.00000 -0.00000 1.00000\n        key 1.64000 0.00000 0.00000 -0.00000 1.00000\n        key 1.68000 0.00000 -0.00000 0.00000 1.00000\n        key 1.72000 -0.00000 0.00000 0.00000 1.00000\n        key 1.76000 0.00000 -0.00000 0.00000 1.00000\n        key 1.80000 -0.00000 0.00000 -0.00000 1.00000\n        key 1.84000 0.00000 0.00000 0.00000 1.00000\n        key 1.88000 0.00000 0.00000 0.00000 1.00000\n        key 1.92000 0.00000 0.00000 0.00000 1.00000\n        key 1.96000 0.00000 0.00000 0.00000 1.00000\n        key 2.00000 0.00032 0.00000 -0.00000 1.00000\n        key 2.04000 0.00183 0.00000 0.00000 1.00000\n        key 2.08000 0.00461 0.00000 0.00000 0.99999\n        key 2.12000 0.00867 0.00000 -0.00000 0.99996\n        key 2.16000 0.01402 0.00000 -0.00000 0.99990\n        key 2.20000 0.02069 0.00000 0.00000 0.99979\n        key 2.24000 0.02868 0.00000 0.00000 0.99959\n        key 2.28000 0.03802 0.00000 0.00000 0.99928\n        key 2.32000 0.04870 0.00000 0.00000 0.99881\n        key 2.36000 0.06075 0.00000 -0.00000 0.99815\n        key 2.40000 0.07416 0.00000 -0.00000 0.99725\n        key 2.44000 0.08891 0.00000 -0.00000 0.99604\n        key 2.48000 0.10500 0.00000 0.00000 0.99447\n        key 2.52000 0.12240 0.00000 -0.00000 0.99248\n        key 2.56000 0.14105 0.00000 -0.00000 0.99000\n        key 2.60000 0.16091 0.00000 -0.00000 0.98697\n        key 2.64000 0.18189 0.00000 0.00000 0.98332\n        key 2.68000 0.20391 0.00000 -0.00000 0.97899\n        key 2.72000 0.22686 0.00000 -0.00000 0.97393\n        key 2.76000 0.25060 0.00000 0.00000 0.96809\n        key 2.80000 0.27498 0.00000 -0.00000 0.96145\n        key 2.84000 0.29985 0.00000 -0.00000 0.95399\n        key 2.88000 0.32504 0.00000 -0.00000 0.94570\n        key 2.92000 0.35036 0.00000 -0.00000 0.93661\n        key 2.96000 0.37564 0.00000 0.00000 0.92677\n        key 3.00000 0.40068 0.00000 0.00000 0.91622\n        key 3.04000 0.42531 0.00000 0.00000 0.90505\n        key 3.08000 0.44937 0.00000 -0.00000 0.89335\n        key 3.12000 0.47270 0.00000 0.00000 0.88122\n        key 3.16000 0.49518 0.00000 0.00000 0.86879\n        key 3.20000 0.51667 0.00000 -0.00000 0.85618\n        key 3.24000 0.53711 0.00000 0.00000 0.84351\n        key 3.28000 0.55640 0.00000 -0.00000 0.83091\n        key 3.32000 0.57451 0.00000 -0.00000 0.81850\n        key 3.36000 0.59139 0.00000 0.00000 0.80639\n        key 3.40000 0.60703 0.00000 -0.00000 0.79468\n        key 3.44000 0.62143 0.00000 0.00000 0.78347\n        key 3.48000 0.63459 0.00000 -0.00000 0.77285\n        key 3.52000 0.64655 0.00000 -0.00000 0.76287\n        key 3.56000 0.65732 0.00000 -0.00000 0.75361\n        key 3.60000 0.66694 0.00000 -0.00000 0.74511\n        key 3.64000 0.67543 0.00000 -0.00000 0.73742\n        key 3.68000 0.68285 0.00000 -0.00000 0.73056\n        key 3.72000 0.68921 0.00000 -0.00000 0.72456\n        key 3.76000 0.69456 0.00000 -0.00000 0.71943\n        key 3.80000 0.69893 0.00000 -0.00000 0.71519\n        key 3.84000 0.70234 0.00000 0.00000 0.71184\n        key 3.88000 0.70482 0.00000 0.00000 0.70939\n        key 3.92000 0.70639 0.00000 0.00000 0.70782\n        key 3.96000 0.70707 0.00000 0.00000 0.70714\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone.002"\n      Keyframes "Vec3" 100 {\n        key 0.00000 1.00000 1.00000 1.00000\n        key 0.04000 1.00000 1.00000 1.00000\n        key 0.08000 1.00000 1.00000 1.00000\n        key 0.12000 1.00000 1.00000 1.00000\n        key 0.16000 1.00000 1.00000 1.00000\n        key 0.20000 1.00000 1.00000 1.00000\n        key 0.24000 1.00000 1.00000 1.00000\n        key 0.28000 1.00000 1.00000 1.00000\n        key 0.32000 1.00000 1.00000 1.00000\n        key 0.36000 1.00000 1.00000 1.00000\n        key 0.40000 1.00000 1.00000 1.00000\n        key 0.44000 1.00000 1.00000 1.00000\n        key 0.48000 1.00000 1.00000 1.00000\n        key 0.52000 1.00000 1.00000 1.00000\n        key 0.56000 1.00000 1.00000 1.00000\n        key 0.60000 1.00000 1.00000 1.00000\n        key 0.64000 1.00000 1.00000 1.00000\n        key 0.68000 1.00000 1.00000 1.00000\n        key 0.72000 1.00000 1.00000 1.00000\n        key 0.76000 1.00000 1.00000 1.00000\n        key 0.80000 1.00000 1.00000 1.00000\n        key 0.84000 1.00000 1.00000 1.00000\n        key 0.88000 1.00000 1.00000 1.00000\n        key 0.92000 1.00000 1.00000 1.00000\n        key 0.96000 1.00000 1.00000 1.00000\n        key 1.00000 1.00000 1.00000 1.00000\n        key 1.04000 1.00000 1.00000 1.00000\n        key 1.08000 1.00000 1.00000 1.00000\n        key 1.12000 1.00000 1.00000 1.00000\n        key 1.16000 1.00000 1.00000 1.00000\n        key 1.20000 1.00000 1.00000 1.00000\n        key 1.24000 1.00000 1.00000 1.00000\n        key 1.28000 1.00000 1.00000 1.00000\n        key 1.32000 1.00000 1.00000 1.00000\n        key 1.36000 1.00000 1.00000 1.00000\n        key 1.40000 1.00000 1.00000 1.00000\n        key 1.44000 1.00000 1.00000 1.00000\n        key 1.48000 1.00000 1.00000 1.00000\n        key 1.52000 1.00000 1.00000 1.00000\n        key 1.56000 1.00000 1.00000 1.00000\n        key 1.60000 1.00000 1.00000 1.00000\n        key 1.64000 1.00000 1.00000 1.00000\n        key 1.68000 1.00000 1.00000 1.00000\n        key 1.72000 1.00000 1.00000 1.00000\n        key 1.76000 1.00000 1.00000 1.00000\n        key 1.80000 1.00000 1.00000 1.00000\n        key 1.84000 1.00000 1.00000 1.00000\n        key 1.88000 1.00000 1.00000 1.00000\n        key 1.92000 1.00000 1.00000 1.00000\n        key 1.96000 1.00000 1.00000 1.00000\n        key 2.00000 1.00000 1.00000 1.00000\n        key 2.04000 1.00000 1.00000 1.00000\n        key 2.08000 1.00000 1.00000 1.00000\n        key 2.12000 1.00000 1.00000 1.00000\n        key 2.16000 1.00000 1.00000 1.00000\n        key 2.20000 1.00000 1.00000 1.00000\n        key 2.24000 1.00000 1.00000 1.00000\n        key 2.28000 1.00000 1.00000 1.00000\n        key 2.32000 1.00000 1.00000 1.00000\n        key 2.36000 1.00000 1.00000 1.00000\n        key 2.40000 1.00000 1.00000 1.00000\n        key 2.44000 1.00000 1.00000 1.00000\n        key 2.48000 1.00000 1.00000 1.00000\n        key 2.52000 1.00000 1.00000 1.00000\n        key 2.56000 1.00000 1.00000 1.00000\n        key 2.60000 1.00000 1.00000 1.00000\n        key 2.64000 1.00000 1.00000 1.00000\n        key 2.68000 1.00000 1.00000 1.00000\n        key 2.72000 1.00000 1.00000 1.00000\n        key 2.76000 1.00000 1.00000 1.00000\n        key 2.80000 1.00000 1.00000 1.00000\n        key 2.84000 1.00000 1.00000 1.00000\n        key 2.88000 1.00000 1.00000 1.00000\n        key 2.92000 1.00000 1.00000 1.00000\n        key 2.96000 1.00000 1.00000 1.00000\n        key 3.00000 1.00000 1.00000 1.00000\n        key 3.04000 1.00000 1.00000 1.00000\n        key 3.08000 1.00000 1.00000 1.00000\n        key 3.12000 1.00000 1.00000 1.00000\n        key 3.16000 1.00000 1.00000 1.00000\n        key 3.20000 1.00000 1.00000 1.00000\n        key 3.24000 1.00000 1.00000 1.00000\n        key 3.28000 1.00000 1.00000 1.00000\n        key 3.32000 1.00000 1.00000 1.00000\n        key 3.36000 1.00000 1.00000 1.00000\n        key 3.40000 1.00000 1.00000 1.00000\n        key 3.44000 1.00000 1.00000 1.00000\n        key 3.48000 1.00000 1.00000 1.00000\n        key 3.52000 1.00000 1.00000 1.00000\n        key 3.56000 1.00000 1.00000 1.00000\n        key 3.60000 1.00000 1.00000 1.00000\n        key 3.64000 1.00000 1.00000 1.00000\n        key 3.68000 1.00000 1.00000 1.00000\n        key 3.72000 1.00000 1.00000 1.00000\n        key 3.76000 1.00000 1.00000 1.00000\n        key 3.80000 1.00000 1.00000 1.00000\n        key 3.84000 1.00000 1.00000 1.00000\n        key 3.88000 1.00000 1.00000 1.00000\n        key 3.92000 1.00000 1.00000 1.00000\n        key 3.96000 1.00000 1.00000 1.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone.002"\n      Keyframes "Vec3" 100 {\n        key 0.00000 0.00000 0.00000 -0.00000\n        key 0.04000 0.00000 0.00000 -0.00000\n        key 0.08000 0.00000 0.00000 -0.00000\n        key 0.12000 0.00000 0.00000 0.00000\n        key 0.16000 0.00000 0.00000 0.00000\n        key 0.20000 -0.00000 0.00000 -0.00000\n        key 0.24000 0.00000 0.00000 -0.00000\n        key 0.28000 0.00000 0.00000 -0.00000\n        key 0.32000 0.00000 0.00000 -0.00000\n        key 0.36000 0.00000 0.00000 0.00000\n        key 0.40000 -0.00000 -0.00000 0.00000\n        key 0.44000 -0.00000 0.00000 -0.00000\n        key 0.48000 0.00000 0.00000 0.00000\n        key 0.52000 -0.00000 0.00000 0.00000\n        key 0.56000 0.00000 0.00000 0.00000\n        key 0.60000 0.00000 0.00000 -0.00000\n        key 0.64000 -0.00000 0.00000 0.00000\n        key 0.68000 -0.00000 0.00000 0.00000\n        key 0.72000 -0.00000 0.00000 0.00000\n        key 0.76000 0.00000 -0.00000 0.00000\n        key 0.80000 -0.00000 0.00000 0.00000\n        key 0.84000 -0.00000 0.00000 0.00000\n        key 0.88000 0.00000 0.00000 -0.00000\n        key 0.92000 0.00000 0.00000 0.00000\n        key 0.96000 0.00000 0.00000 -0.00000\n        key 1.00000 0.00000 0.00000 -0.00000\n        key 1.04000 -0.00000 0.00000 0.00000\n        key 1.08000 -0.00000 0.00000 0.00000\n        key 1.12000 -0.00000 -0.00000 0.00000\n        key 1.16000 -0.00000 0.00000 0.00000\n        key 1.20000 0.00000 0.00000 0.00000\n        key 1.24000 -0.00000 -0.00000 0.00000\n        key 1.28000 0.00000 0.00000 -0.00000\n        key 1.32000 0.00000 0.00000 -0.00000\n        key 1.36000 -0.00000 0.00000 0.00000\n        key 1.40000 -0.00000 0.00000 0.00000\n        key 1.44000 0.00000 0.00000 -0.00000\n        key 1.48000 -0.00000 0.00000 0.00000\n        key 1.52000 -0.00000 -0.00000 0.00000\n        key 1.56000 -0.00000 0.00000 0.00000\n        key 1.60000 0.00000 0.00000 -0.00000\n        key 1.64000 -0.00000 0.00000 0.00000\n        key 1.68000 0.00000 -0.00000 -0.00000\n        key 1.72000 -0.00000 0.00000 0.00000\n        key 1.76000 0.00000 0.00000 -0.00000\n        key 1.80000 -0.00000 0.00000 0.00000\n        key 1.84000 0.00000 0.00000 -0.00000\n        key 1.88000 -0.00000 0.00000 0.00000\n        key 1.92000 -0.00000 0.00000 0.00000\n        key 1.96000 0.00000 0.00000 -0.00000\n        key 2.00000 0.00000 0.00000 -0.00000\n        key 2.04000 0.00000 0.00000 -0.00000\n        key 2.08000 0.00000 0.00000 -0.00000\n        key 2.12000 0.00000 0.00000 -0.00000\n        key 2.16000 0.00000 0.00000 -0.00000\n        key 2.20000 0.00000 0.00000 -0.00000\n        key 2.24000 0.00000 0.00000 -0.00000\n        key 2.28000 0.00000 0.00000 -0.00000\n        key 2.32000 0.00000 0.00000 -0.00000\n        key 2.36000 0.00000 0.00000 -0.00000\n        key 2.40000 0.00000 0.00000 -0.00000\n        key 2.44000 0.00000 0.00000 -0.00000\n        key 2.48000 0.00000 0.00000 -0.00000\n        key 2.52000 0.00000 0.00000 -0.00000\n        key 2.56000 0.00000 0.00000 -0.00000\n        key 2.60000 0.00000 0.00000 -0.00000\n        key 2.64000 0.00000 0.00000 -0.00000\n        key 2.68000 0.00000 0.00000 -0.00000\n        key 2.72000 0.00000 0.00000 -0.00000\n        key 2.76000 0.00000 0.00000 -0.00000\n        key 2.80000 0.00000 0.00000 -0.00000\n        key 2.84000 0.00000 0.00000 -0.00000\n        key 2.88000 0.00000 0.00000 -0.00000\n        key 2.92000 0.00000 0.00000 -0.00000\n        key 2.96000 0.00000 0.00000 -0.00000\n        key 3.00000 0.00000 0.00000 -0.00000\n        key 3.04000 0.00000 0.00000 -0.00000\n        key 3.08000 0.00000 0.00000 -0.00000\n        key 3.12000 0.00000 0.00000 -0.00000\n        key 3.16000 0.00000 0.00000 -0.00000\n        key 3.20000 0.00000 0.00000 -0.00000\n        key 3.24000 0.00000 0.00000 -0.00000\n        key 3.28000 0.00000 0.00000 -0.00000\n        key 3.32000 0.00000 0.00000 -0.00000\n        key 3.36000 0.00000 0.00000 -0.00000\n        key 3.40000 0.00000 0.00000 -0.00000\n        key 3.44000 0.00000 0.00000 -0.00000\n        key 3.48000 0.00000 0.00000 -0.00000\n        key 3.52000 0.00000 0.00000 -0.00000\n        key 3.56000 0.00000 0.00000 -0.00000\n        key 3.60000 0.00000 0.00000 -0.00000\n        key 3.64000 0.00000 0.00000 -0.00000\n        key 3.68000 0.00000 0.00000 -0.00000\n        key 3.72000 0.00000 0.00000 -0.00000\n        key 3.76000 0.00000 0.00000 -0.00000\n        key 3.80000 0.00000 0.00000 -0.00000\n        key 3.84000 0.00000 0.00000 -0.00000\n        key 3.88000 0.00000 0.00000 -0.00000\n        key 3.92000 0.00000 0.00000 -0.00000\n        key 3.96000 0.00000 0.00000 -0.00000\n      }\n    }\n    Channel {\n      name "quaternion"\n      target "Bone"\n      Keyframes "Quat" 100 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 0.00000 0.00000 0.00000 1.00000\n        key 0.08000 0.00000 0.00000 0.00000 1.00000\n        key 0.12000 0.00000 0.00000 0.00000 1.00000\n        key 0.16000 0.00000 0.00000 0.00000 1.00000\n        key 0.20000 0.00000 0.00000 0.00000 1.00000\n        key 0.24000 0.00000 0.00000 0.00000 1.00000\n        key 0.28000 0.00000 0.00000 0.00000 1.00000\n        key 0.32000 0.00000 0.00000 0.00000 1.00000\n        key 0.36000 0.00000 0.00000 0.00000 1.00000\n        key 0.40000 0.00000 0.00000 0.00000 1.00000\n        key 0.44000 0.00000 0.00000 0.00000 1.00000\n        key 0.48000 0.00000 0.00000 0.00000 1.00000\n        key 0.52000 0.00000 0.00000 0.00000 1.00000\n        key 0.56000 0.00000 0.00000 0.00000 1.00000\n        key 0.60000 0.00000 0.00000 0.00000 1.00000\n        key 0.64000 0.00000 0.00000 0.00000 1.00000\n        key 0.68000 0.00000 0.00000 0.00000 1.00000\n        key 0.72000 0.00000 0.00000 0.00000 1.00000\n        key 0.76000 0.00000 0.00000 0.00000 1.00000\n        key 0.80000 0.00000 0.00000 0.00000 1.00000\n        key 0.84000 0.00000 0.00000 0.00000 1.00000\n        key 0.88000 0.00000 0.00000 0.00000 1.00000\n        key 0.92000 0.00000 0.00000 0.00000 1.00000\n        key 0.96000 0.00000 0.00000 0.00000 1.00000\n        key 1.00000 0.00000 0.00000 0.00000 1.00000\n        key 1.04000 0.00000 0.00000 0.00000 1.00000\n        key 1.08000 0.00000 0.00000 0.00000 1.00000\n        key 1.12000 0.00000 0.00000 0.00000 1.00000\n        key 1.16000 0.00000 0.00000 0.00000 1.00000\n        key 1.20000 0.00000 0.00000 0.00000 1.00000\n        key 1.24000 0.00000 0.00000 0.00000 1.00000\n        key 1.28000 0.00000 0.00000 0.00000 1.00000\n        key 1.32000 0.00000 0.00000 0.00000 1.00000\n        key 1.36000 0.00000 0.00000 0.00000 1.00000\n        key 1.40000 0.00000 0.00000 0.00000 1.00000\n        key 1.44000 0.00000 0.00000 0.00000 1.00000\n        key 1.48000 0.00000 0.00000 0.00000 1.00000\n        key 1.52000 0.00000 0.00000 0.00000 1.00000\n        key 1.56000 0.00000 0.00000 0.00000 1.00000\n        key 1.60000 0.00000 0.00000 0.00000 1.00000\n        key 1.64000 0.00000 0.00000 0.00000 1.00000\n        key 1.68000 0.00000 0.00000 0.00000 1.00000\n        key 1.72000 0.00000 0.00000 0.00000 1.00000\n        key 1.76000 0.00000 0.00000 0.00000 1.00000\n        key 1.80000 0.00000 0.00000 0.00000 1.00000\n        key 1.84000 0.00000 0.00000 0.00000 1.00000\n        key 1.88000 0.00000 0.00000 0.00000 1.00000\n        key 1.92000 0.00000 0.00000 0.00000 1.00000\n        key 1.96000 0.00000 0.00000 0.00000 1.00000\n        key 2.00000 0.00000 0.00000 0.00000 1.00000\n        key 2.04000 0.00000 0.00000 0.00000 1.00000\n        key 2.08000 0.00000 0.00000 0.00000 1.00000\n        key 2.12000 0.00000 0.00000 0.00000 1.00000\n        key 2.16000 0.00000 0.00000 0.00000 1.00000\n        key 2.20000 0.00000 0.00000 0.00000 1.00000\n        key 2.24000 0.00000 0.00000 0.00000 1.00000\n        key 2.28000 0.00000 0.00000 0.00000 1.00000\n        key 2.32000 0.00000 0.00000 0.00000 1.00000\n        key 2.36000 0.00000 0.00000 0.00000 1.00000\n        key 2.40000 0.00000 0.00000 0.00000 1.00000\n        key 2.44000 0.00000 0.00000 0.00000 1.00000\n        key 2.48000 0.00000 0.00000 0.00000 1.00000\n        key 2.52000 0.00000 0.00000 0.00000 1.00000\n        key 2.56000 0.00000 0.00000 0.00000 1.00000\n        key 2.60000 0.00000 0.00000 0.00000 1.00000\n        key 2.64000 0.00000 0.00000 0.00000 1.00000\n        key 2.68000 0.00000 0.00000 0.00000 1.00000\n        key 2.72000 0.00000 0.00000 0.00000 1.00000\n        key 2.76000 0.00000 0.00000 0.00000 1.00000\n        key 2.80000 0.00000 0.00000 0.00000 1.00000\n        key 2.84000 0.00000 0.00000 0.00000 1.00000\n        key 2.88000 0.00000 0.00000 0.00000 1.00000\n        key 2.92000 0.00000 0.00000 0.00000 1.00000\n        key 2.96000 0.00000 0.00000 0.00000 1.00000\n        key 3.00000 0.00000 0.00000 0.00000 1.00000\n        key 3.04000 0.00000 0.00000 0.00000 1.00000\n        key 3.08000 0.00000 0.00000 0.00000 1.00000\n        key 3.12000 0.00000 0.00000 0.00000 1.00000\n        key 3.16000 0.00000 0.00000 0.00000 1.00000\n        key 3.20000 0.00000 0.00000 0.00000 1.00000\n        key 3.24000 0.00000 0.00000 0.00000 1.00000\n        key 3.28000 0.00000 0.00000 0.00000 1.00000\n        key 3.32000 0.00000 0.00000 0.00000 1.00000\n        key 3.36000 0.00000 0.00000 0.00000 1.00000\n        key 3.40000 0.00000 0.00000 0.00000 1.00000\n        key 3.44000 0.00000 0.00000 0.00000 1.00000\n        key 3.48000 0.00000 0.00000 0.00000 1.00000\n        key 3.52000 0.00000 0.00000 0.00000 1.00000\n        key 3.56000 0.00000 0.00000 0.00000 1.00000\n        key 3.60000 0.00000 0.00000 0.00000 1.00000\n        key 3.64000 0.00000 0.00000 0.00000 1.00000\n        key 3.68000 0.00000 0.00000 0.00000 1.00000\n        key 3.72000 0.00000 0.00000 0.00000 1.00000\n        key 3.76000 0.00000 0.00000 0.00000 1.00000\n        key 3.80000 0.00000 0.00000 0.00000 1.00000\n        key 3.84000 0.00000 0.00000 0.00000 1.00000\n        key 3.88000 0.00000 0.00000 0.00000 1.00000\n        key 3.92000 0.00000 0.00000 0.00000 1.00000\n        key 3.96000 0.00000 0.00000 0.00000 1.00000\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone"\n      Keyframes "Vec3" 100 {\n        key 0.00000 1.00000 1.00000 1.00000\n        key 0.04000 1.00000 1.00000 1.00000\n        key 0.08000 1.00000 1.00000 1.00000\n        key 0.12000 1.00000 1.00000 1.00000\n        key 0.16000 1.00000 1.00000 1.00000\n        key 0.20000 1.00000 1.00000 1.00000\n        key 0.24000 1.00000 1.00000 1.00000\n        key 0.28000 1.00000 1.00000 1.00000\n        key 0.32000 1.00000 1.00000 1.00000\n        key 0.36000 1.00000 1.00000 1.00000\n        key 0.40000 1.00000 1.00000 1.00000\n        key 0.44000 1.00000 1.00000 1.00000\n        key 0.48000 1.00000 1.00000 1.00000\n        key 0.52000 1.00000 1.00000 1.00000\n        key 0.56000 1.00000 1.00000 1.00000\n        key 0.60000 1.00000 1.00000 1.00000\n        key 0.64000 1.00000 1.00000 1.00000\n        key 0.68000 1.00000 1.00000 1.00000\n        key 0.72000 1.00000 1.00000 1.00000\n        key 0.76000 1.00000 1.00000 1.00000\n        key 0.80000 1.00000 1.00000 1.00000\n        key 0.84000 1.00000 1.00000 1.00000\n        key 0.88000 1.00000 1.00000 1.00000\n        key 0.92000 1.00000 1.00000 1.00000\n        key 0.96000 1.00000 1.00000 1.00000\n        key 1.00000 1.00000 1.00000 1.00000\n        key 1.04000 1.00000 1.00000 1.00000\n        key 1.08000 1.00000 1.00000 1.00000\n        key 1.12000 1.00000 1.00000 1.00000\n        key 1.16000 1.00000 1.00000 1.00000\n        key 1.20000 1.00000 1.00000 1.00000\n        key 1.24000 1.00000 1.00000 1.00000\n        key 1.28000 1.00000 1.00000 1.00000\n        key 1.32000 1.00000 1.00000 1.00000\n        key 1.36000 1.00000 1.00000 1.00000\n        key 1.40000 1.00000 1.00000 1.00000\n        key 1.44000 1.00000 1.00000 1.00000\n        key 1.48000 1.00000 1.00000 1.00000\n        key 1.52000 1.00000 1.00000 1.00000\n        key 1.56000 1.00000 1.00000 1.00000\n        key 1.60000 1.00000 1.00000 1.00000\n        key 1.64000 1.00000 1.00000 1.00000\n        key 1.68000 1.00000 1.00000 1.00000\n        key 1.72000 1.00000 1.00000 1.00000\n        key 1.76000 1.00000 1.00000 1.00000\n        key 1.80000 1.00000 1.00000 1.00000\n        key 1.84000 1.00000 1.00000 1.00000\n        key 1.88000 1.00000 1.00000 1.00000\n        key 1.92000 1.00000 1.00000 1.00000\n        key 1.96000 1.00000 1.00000 1.00000\n        key 2.00000 1.00000 1.00000 1.00000\n        key 2.04000 1.00000 1.00000 1.00000\n        key 2.08000 1.00000 1.00000 1.00000\n        key 2.12000 1.00000 1.00000 1.00000\n        key 2.16000 1.00000 1.00000 1.00000\n        key 2.20000 1.00000 1.00000 1.00000\n        key 2.24000 1.00000 1.00000 1.00000\n        key 2.28000 1.00000 1.00000 1.00000\n        key 2.32000 1.00000 1.00000 1.00000\n        key 2.36000 1.00000 1.00000 1.00000\n        key 2.40000 1.00000 1.00000 1.00000\n        key 2.44000 1.00000 1.00000 1.00000\n        key 2.48000 1.00000 1.00000 1.00000\n        key 2.52000 1.00000 1.00000 1.00000\n        key 2.56000 1.00000 1.00000 1.00000\n        key 2.60000 1.00000 1.00000 1.00000\n        key 2.64000 1.00000 1.00000 1.00000\n        key 2.68000 1.00000 1.00000 1.00000\n        key 2.72000 1.00000 1.00000 1.00000\n        key 2.76000 1.00000 1.00000 1.00000\n        key 2.80000 1.00000 1.00000 1.00000\n        key 2.84000 1.00000 1.00000 1.00000\n        key 2.88000 1.00000 1.00000 1.00000\n        key 2.92000 1.00000 1.00000 1.00000\n        key 2.96000 1.00000 1.00000 1.00000\n        key 3.00000 1.00000 1.00000 1.00000\n        key 3.04000 1.00000 1.00000 1.00000\n        key 3.08000 1.00000 1.00000 1.00000\n        key 3.12000 1.00000 1.00000 1.00000\n        key 3.16000 1.00000 1.00000 1.00000\n        key 3.20000 1.00000 1.00000 1.00000\n        key 3.24000 1.00000 1.00000 1.00000\n        key 3.28000 1.00000 1.00000 1.00000\n        key 3.32000 1.00000 1.00000 1.00000\n        key 3.36000 1.00000 1.00000 1.00000\n        key 3.40000 1.00000 1.00000 1.00000\n        key 3.44000 1.00000 1.00000 1.00000\n        key 3.48000 1.00000 1.00000 1.00000\n        key 3.52000 1.00000 1.00000 1.00000\n        key 3.56000 1.00000 1.00000 1.00000\n        key 3.60000 1.00000 1.00000 1.00000\n        key 3.64000 1.00000 1.00000 1.00000\n        key 3.68000 1.00000 1.00000 1.00000\n        key 3.72000 1.00000 1.00000 1.00000\n        key 3.76000 1.00000 1.00000 1.00000\n        key 3.80000 1.00000 1.00000 1.00000\n        key 3.84000 1.00000 1.00000 1.00000\n        key 3.88000 1.00000 1.00000 1.00000\n        key 3.92000 1.00000 1.00000 1.00000\n        key 3.96000 1.00000 1.00000 1.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone"\n      Keyframes "Vec3" 100 {\n        key 0.00000 -0.00000 0.00000 0.00000\n        key 0.04000 -0.00000 0.00000 0.00000\n        key 0.08000 -0.00000 0.00000 0.00000\n        key 0.12000 -0.00000 0.00000 0.00000\n        key 0.16000 -0.00000 0.00000 0.00000\n        key 0.20000 -0.00000 0.00000 0.00000\n        key 0.24000 -0.00000 0.00000 0.00000\n        key 0.28000 -0.00000 0.00000 0.00000\n        key 0.32000 -0.00000 0.00000 0.00000\n        key 0.36000 -0.00000 0.00000 0.00000\n        key 0.40000 -0.00000 0.00000 0.00000\n        key 0.44000 -0.00000 0.00000 0.00000\n        key 0.48000 -0.00000 0.00000 0.00000\n        key 0.52000 -0.00000 0.00000 0.00000\n        key 0.56000 -0.00000 0.00000 0.00000\n        key 0.60000 -0.00000 0.00000 0.00000\n        key 0.64000 -0.00000 0.00000 0.00000\n        key 0.68000 -0.00000 0.00000 0.00000\n        key 0.72000 -0.00000 0.00000 0.00000\n        key 0.76000 -0.00000 0.00000 0.00000\n        key 0.80000 -0.00000 0.00000 0.00000\n        key 0.84000 -0.00000 0.00000 0.00000\n        key 0.88000 -0.00000 0.00000 0.00000\n        key 0.92000 -0.00000 0.00000 0.00000\n        key 0.96000 -0.00000 0.00000 0.00000\n        key 1.00000 -0.00000 0.00000 0.00000\n        key 1.04000 -0.00000 0.00000 0.00000\n        key 1.08000 -0.00000 0.00000 0.00000\n        key 1.12000 -0.00000 0.00000 0.00000\n        key 1.16000 -0.00000 0.00000 0.00000\n        key 1.20000 -0.00000 0.00000 0.00000\n        key 1.24000 -0.00000 0.00000 0.00000\n        key 1.28000 -0.00000 0.00000 0.00000\n        key 1.32000 -0.00000 0.00000 0.00000\n        key 1.36000 -0.00000 0.00000 0.00000\n        key 1.40000 -0.00000 0.00000 0.00000\n        key 1.44000 -0.00000 0.00000 0.00000\n        key 1.48000 -0.00000 0.00000 0.00000\n        key 1.52000 -0.00000 0.00000 0.00000\n        key 1.56000 -0.00000 0.00000 0.00000\n        key 1.60000 -0.00000 0.00000 0.00000\n        key 1.64000 -0.00000 0.00000 0.00000\n        key 1.68000 -0.00000 0.00000 0.00000\n        key 1.72000 -0.00000 0.00000 0.00000\n        key 1.76000 -0.00000 0.00000 0.00000\n        key 1.80000 -0.00000 0.00000 0.00000\n        key 1.84000 -0.00000 0.00000 0.00000\n        key 1.88000 -0.00000 0.00000 0.00000\n        key 1.92000 -0.00000 0.00000 0.00000\n        key 1.96000 -0.00000 0.00000 0.00000\n        key 2.00000 -0.00000 0.00000 0.00000\n        key 2.04000 -0.00000 0.00000 0.00000\n        key 2.08000 -0.00000 0.00000 0.00000\n        key 2.12000 -0.00000 0.00000 0.00000\n        key 2.16000 -0.00000 0.00000 0.00000\n        key 2.20000 -0.00000 0.00000 0.00000\n        key 2.24000 -0.00000 0.00000 0.00000\n        key 2.28000 -0.00000 0.00000 0.00000\n        key 2.32000 -0.00000 0.00000 0.00000\n        key 2.36000 -0.00000 0.00000 0.00000\n        key 2.40000 -0.00000 0.00000 0.00000\n        key 2.44000 -0.00000 0.00000 0.00000\n        key 2.48000 -0.00000 0.00000 0.00000\n        key 2.52000 -0.00000 0.00000 0.00000\n        key 2.56000 -0.00000 0.00000 0.00000\n        key 2.60000 -0.00000 0.00000 0.00000\n        key 2.64000 -0.00000 0.00000 0.00000\n        key 2.68000 -0.00000 0.00000 0.00000\n        key 2.72000 -0.00000 0.00000 0.00000\n        key 2.76000 -0.00000 0.00000 0.00000\n        key 2.80000 -0.00000 0.00000 0.00000\n        key 2.84000 -0.00000 0.00000 0.00000\n        key 2.88000 -0.00000 0.00000 0.00000\n        key 2.92000 -0.00000 0.00000 0.00000\n        key 2.96000 -0.00000 0.00000 0.00000\n        key 3.00000 -0.00000 0.00000 0.00000\n        key 3.04000 -0.00000 0.00000 0.00000\n        key 3.08000 -0.00000 0.00000 0.00000\n        key 3.12000 -0.00000 0.00000 0.00000\n        key 3.16000 -0.00000 0.00000 0.00000\n        key 3.20000 -0.00000 0.00000 0.00000\n        key 3.24000 -0.00000 0.00000 0.00000\n        key 3.28000 -0.00000 0.00000 0.00000\n        key 3.32000 -0.00000 0.00000 0.00000\n        key 3.36000 -0.00000 0.00000 0.00000\n        key 3.40000 -0.00000 0.00000 0.00000\n        key 3.44000 -0.00000 0.00000 0.00000\n        key 3.48000 -0.00000 0.00000 0.00000\n        key 3.52000 -0.00000 0.00000 0.00000\n        key 3.56000 -0.00000 0.00000 0.00000\n        key 3.60000 -0.00000 0.00000 0.00000\n        key 3.64000 -0.00000 0.00000 0.00000\n        key 3.68000 -0.00000 0.00000 0.00000\n        key 3.72000 -0.00000 0.00000 0.00000\n        key 3.76000 -0.00000 0.00000 0.00000\n        key 3.80000 -0.00000 0.00000 0.00000\n        key 3.84000 -0.00000 0.00000 0.00000\n        key 3.88000 -0.00000 0.00000 0.00000\n        key 3.92000 -0.00000 0.00000 0.00000\n        key 3.96000 -0.00000 0.00000 0.00000\n      }\n    }\n  }\n$}\n'
+        result = '$osgAnimation::BasicAnimationManager {\n$#UniqueID uniqid_BasicAnimationManager_38\n$#num_animations 1\n  osgAnimation::Animation {\n    UniqueID uniqid_Animation_11\n    name "Action"\n    num_channels 9\n    Channel {\n      name "quaternion"\n      target "Bone.001"\n      Keyframes "Quat" 20 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 0.01962 -0.00000 -0.00000 0.99981\n        key 0.08000 0.08011 -0.00000 -0.00000 0.99679\n        key 0.12000 0.18125 -0.00000 -0.00000 0.98344\n        key 0.16000 0.31294 0.00000 0.00000 0.94977\n        key 0.20000 0.45100 0.00000 -0.00000 0.89252\n        key 0.24000 0.56771 -0.00000 0.00000 0.82323\n        key 0.28000 0.64843 0.00000 -0.00000 0.76128\n        key 0.32000 0.69316 0.00000 -0.00000 0.72078\n        key 0.36000 0.70711 -0.00000 0.00000 0.70711\n        key 0.40000 0.70711 -0.00000 0.00000 0.70711\n        key 0.44000 0.70711 -0.00000 0.00000 0.70711\n        key 0.48000 0.70711 -0.00000 0.00000 0.70711\n        key 0.52000 0.70711 -0.00000 0.00000 0.70711\n        key 0.56000 0.70711 -0.00000 0.00000 0.70711\n        key 0.60000 0.70711 -0.00000 0.00000 0.70711\n        key 0.64000 0.70711 -0.00000 0.00000 0.70711\n        key 0.68000 0.70711 -0.00000 0.00000 0.70711\n        key 0.72000 0.70711 -0.00000 0.00000 0.70711\n        key 0.76000 0.70711 -0.00000 0.00000 0.70711\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone.001"\n      Keyframes "Vec3" 20 {\n        key 0.00000 1.00000 1.00000 0.00000\n        key 0.04000 1.00000 1.00000 0.00000\n        key 0.08000 1.00000 1.00000 0.00000\n        key 0.12000 1.00000 1.00000 0.00000\n        key 0.16000 1.00000 1.00000 0.00000\n        key 0.20000 1.00000 1.00000 0.00000\n        key 0.24000 1.00000 1.00000 0.00000\n        key 0.28000 1.00000 1.00000 0.00000\n        key 0.32000 1.00000 1.00000 0.00000\n        key 0.36000 1.00000 1.00000 0.00000\n        key 0.40000 1.00000 1.00000 0.00000\n        key 0.44000 1.00000 1.00000 0.00000\n        key 0.48000 1.00000 1.00000 0.00000\n        key 0.52000 1.00000 1.00000 0.00000\n        key 0.56000 1.00000 1.00000 0.00000\n        key 0.60000 1.00000 1.00000 0.00000\n        key 0.64000 1.00000 1.00000 0.00000\n        key 0.68000 1.00000 1.00000 0.00000\n        key 0.72000 1.00000 1.00000 0.00000\n        key 0.76000 1.00000 1.00000 0.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone.001"\n      Keyframes "Vec3" 20 {\n        key 0.00000 0.00000 0.00000 0.00000\n        key 0.04000 0.00000 0.00000 0.00000\n        key 0.08000 0.00000 0.00000 0.00000\n        key 0.12000 0.00000 0.00000 0.00000\n        key 0.16000 0.00000 0.00000 0.00000\n        key 0.20000 0.00000 0.00000 0.00000\n        key 0.24000 0.00000 0.00000 0.00000\n        key 0.28000 0.00000 0.00000 0.00000\n        key 0.32000 0.00000 0.00000 0.00000\n        key 0.36000 0.00000 0.00000 0.00000\n        key 0.40000 0.00000 0.00000 0.00000\n        key 0.44000 0.00000 0.00000 0.00000\n        key 0.48000 0.00000 0.00000 0.00000\n        key 0.52000 0.00000 0.00000 0.00000\n        key 0.56000 0.00000 0.00000 0.00000\n        key 0.60000 0.00000 0.00000 0.00000\n        key 0.64000 0.00000 0.00000 0.00000\n        key 0.68000 0.00000 0.00000 0.00000\n        key 0.72000 0.00000 0.00000 0.00000\n        key 0.76000 0.00000 0.00000 0.00000\n      }\n    }\n    Channel {\n      name "quaternion"\n      target "Bone.002"\n      Keyframes "Quat" 20 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 0.00000 0.00000 0.00000 1.00000\n        key 0.08000 -0.00000 0.00000 -0.00000 1.00000\n        key 0.12000 0.00000 0.00000 0.00000 1.00000\n        key 0.16000 -0.00000 0.00000 0.00000 1.00000\n        key 0.20000 0.00000 0.00000 0.00000 1.00000\n        key 0.24000 0.00000 0.00000 0.00000 1.00000\n        key 0.28000 0.00000 -0.00000 -0.00000 1.00000\n        key 0.32000 0.00000 0.00000 -0.00000 1.00000\n        key 0.36000 -0.00000 0.00000 -0.00000 1.00000\n        key 0.40000 0.01579 0.00000 -0.00000 0.99988\n        key 0.44000 0.06441 0.00000 -0.00000 0.99792\n        key 0.48000 0.14647 0.00000 -0.00000 0.98922\n        key 0.52000 0.25720 0.00000 -0.00000 0.96636\n        key 0.56000 0.38238 0.00000 -0.00000 0.92400\n        key 0.60000 0.50096 0.00000 -0.00000 0.86547\n        key 0.64000 0.59562 0.00000 -0.00000 0.80327\n        key 0.68000 0.65997 0.00000 -0.00000 0.75129\n        key 0.72000 0.69583 0.00000 0.00000 0.71821\n        key 0.76000 0.70711 0.00000 0.00000 0.70711\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone.002"\n      Keyframes "Vec3" 20 {\n        key 0.00000 1.00000 1.00000 0.00000\n        key 0.04000 1.00000 1.00000 0.00000\n        key 0.08000 1.00000 1.00000 0.00000\n        key 0.12000 1.00000 1.00000 0.00000\n        key 0.16000 1.00000 1.00000 0.00000\n        key 0.20000 1.00000 1.00000 0.00000\n        key 0.24000 1.00000 1.00000 0.00000\n        key 0.28000 1.00000 1.00000 0.00000\n        key 0.32000 1.00000 1.00000 0.00000\n        key 0.36000 1.00000 1.00000 0.00000\n        key 0.40000 1.00000 1.00000 0.00000\n        key 0.44000 1.00000 1.00000 0.00000\n        key 0.48000 1.00000 1.00000 0.00000\n        key 0.52000 1.00000 1.00000 0.00000\n        key 0.56000 1.00000 1.00000 0.00000\n        key 0.60000 1.00000 1.00000 0.00000\n        key 0.64000 1.00000 1.00000 0.00000\n        key 0.68000 1.00000 1.00000 0.00000\n        key 0.72000 1.00000 1.00000 0.00000\n        key 0.76000 1.00000 1.00000 0.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone.002"\n      Keyframes "Vec3" 20 {\n        key 0.00000 0.00000 0.00000 -0.00000\n        key 0.04000 0.00000 0.00000 -0.00000\n        key 0.08000 -0.00000 -0.00000 0.00000\n        key 0.12000 0.00000 0.00000 -0.00000\n        key 0.16000 0.00000 0.00000 -0.00000\n        key 0.20000 -0.00000 0.00000 0.00000\n        key 0.24000 -0.00000 0.00000 0.00000\n        key 0.28000 0.00000 0.00000 -0.00000\n        key 0.32000 0.00000 0.00000 -0.00000\n        key 0.36000 0.00000 0.00000 -0.00000\n        key 0.40000 0.00000 0.00000 -0.00000\n        key 0.44000 0.00000 0.00000 -0.00000\n        key 0.48000 0.00000 0.00000 -0.00000\n        key 0.52000 0.00000 0.00000 -0.00000\n        key 0.56000 0.00000 0.00000 -0.00000\n        key 0.60000 0.00000 0.00000 -0.00000\n        key 0.64000 0.00000 0.00000 -0.00000\n        key 0.68000 0.00000 0.00000 -0.00000\n        key 0.72000 0.00000 0.00000 -0.00000\n        key 0.76000 0.00000 0.00000 -0.00000\n      }\n    }\n    Channel {\n      name "quaternion"\n      target "Bone"\n      Keyframes "Quat" 20 {\n        key 0.00000 0.00000 0.00000 0.00000 1.00000\n        key 0.04000 0.00000 0.00000 0.00000 1.00000\n        key 0.08000 0.00000 0.00000 0.00000 1.00000\n        key 0.12000 0.00000 0.00000 0.00000 1.00000\n        key 0.16000 0.00000 0.00000 0.00000 1.00000\n        key 0.20000 0.00000 0.00000 0.00000 1.00000\n        key 0.24000 0.00000 0.00000 0.00000 1.00000\n        key 0.28000 0.00000 0.00000 0.00000 1.00000\n        key 0.32000 0.00000 0.00000 0.00000 1.00000\n        key 0.36000 0.00000 0.00000 0.00000 1.00000\n        key 0.40000 0.00000 0.00000 0.00000 1.00000\n        key 0.44000 0.00000 0.00000 0.00000 1.00000\n        key 0.48000 0.00000 0.00000 0.00000 1.00000\n        key 0.52000 0.00000 0.00000 0.00000 1.00000\n        key 0.56000 0.00000 0.00000 0.00000 1.00000\n        key 0.60000 0.00000 0.00000 0.00000 1.00000\n        key 0.64000 0.00000 0.00000 0.00000 1.00000\n        key 0.68000 0.00000 0.00000 0.00000 1.00000\n        key 0.72000 0.00000 0.00000 0.00000 1.00000\n        key 0.76000 0.00000 0.00000 0.00000 1.00000\n      }\n    }\n    Channel {\n      name "scale"\n      target "Bone"\n      Keyframes "Vec3" 20 {\n        key 0.00000 1.00000 1.00000 0.00000\n        key 0.04000 1.00000 1.00000 0.00000\n        key 0.08000 1.00000 1.00000 0.00000\n        key 0.12000 1.00000 1.00000 0.00000\n        key 0.16000 1.00000 1.00000 0.00000\n        key 0.20000 1.00000 1.00000 0.00000\n        key 0.24000 1.00000 1.00000 0.00000\n        key 0.28000 1.00000 1.00000 0.00000\n        key 0.32000 1.00000 1.00000 0.00000\n        key 0.36000 1.00000 1.00000 0.00000\n        key 0.40000 1.00000 1.00000 0.00000\n        key 0.44000 1.00000 1.00000 0.00000\n        key 0.48000 1.00000 1.00000 0.00000\n        key 0.52000 1.00000 1.00000 0.00000\n        key 0.56000 1.00000 1.00000 0.00000\n        key 0.60000 1.00000 1.00000 0.00000\n        key 0.64000 1.00000 1.00000 0.00000\n        key 0.68000 1.00000 1.00000 0.00000\n        key 0.72000 1.00000 1.00000 0.00000\n        key 0.76000 1.00000 1.00000 0.00000\n      }\n    }\n    Channel {\n      name "position"\n      target "Bone"\n      Keyframes "Vec3" 20 {\n        key 0.00000 -0.00000 0.00000 0.00000\n        key 0.04000 -0.00000 0.00000 0.00000\n        key 0.08000 -0.00000 0.00000 0.00000\n        key 0.12000 -0.00000 0.00000 0.00000\n        key 0.16000 -0.00000 0.00000 0.00000\n        key 0.20000 -0.00000 0.00000 0.00000\n        key 0.24000 -0.00000 0.00000 0.00000\n        key 0.28000 -0.00000 0.00000 0.00000\n        key 0.32000 -0.00000 0.00000 0.00000\n        key 0.36000 -0.00000 0.00000 0.00000\n        key 0.40000 -0.00000 0.00000 0.00000\n        key 0.44000 -0.00000 0.00000 0.00000\n        key 0.48000 -0.00000 0.00000 0.00000\n        key 0.52000 -0.00000 0.00000 0.00000\n        key 0.56000 -0.00000 0.00000 0.00000\n        key 0.60000 -0.00000 0.00000 0.00000\n        key 0.64000 -0.00000 0.00000 0.00000\n        key 0.68000 -0.00000 0.00000 0.00000\n        key 0.72000 -0.00000 0.00000 0.00000\n        key 0.76000 -0.00000 0.00000 0.00000\n      }\n    }\n  }\n$}\n'
         self.assertEquals(result, text)
         exporter.write()
 

File test/test-baked_ipo.py.in

 import osg
 from osg.osgobject import *
 from osg.osgdata import *
+from osg.osgbake import *
 
 
 def close(a, b, threshold):
     def testBakedIpo(self):
         sc = bpy.data.scenes["bakeipo"]
         bpy.data.scenes.active = sc
-        ipo = getBakedIpos(bpy.data.objects["Cube2Bake"], bpy.data.ipos["tobake"], 25)
+        baker = BakeIpoForObject(object = bpy.data.objects["Cube2Bake"], ipo = bpy.data.ipos["tobake"])
+        ipo = baker.getBakedIpos()
         self.assertEquals(140, len(ipo[Ipo.OB_LOCX].bezierPoints))
         self.assertEquals(-8.3325824737548828, ipo[Ipo.OB_LOCX].bezierPoints[0].vec[1][1])
         self.assertEquals(5.5204887390136719, ipo[Ipo.OB_LOCX].bezierPoints[-1].vec[1][1])
 
 
+    def testBakedIpoMaterial(self):
+        sc = bpy.data.scenes["bakeipo"]
+        bpy.data.scenes.active = sc
+        baker = BakeIpoForMaterial(material = bpy.data.materials["mattobake"],
+                                   ipo = bpy.data.ipos["mattobake"])
+        ipo = baker.getBakedIpos()
+        self.assertEquals(140, len(ipo[Ipo.MA_R].bezierPoints))
+        self.assertEquals(140, len(ipo[Ipo.MA_ALPHA].bezierPoints))
+        self.assertEquals(1, ipo[Ipo.MA_R].bezierPoints[0].vec[1][1])
+        self.assertEquals(1, ipo[Ipo.MA_ALPHA].bezierPoints[0].vec[1][1])
+        self.assertEquals(0, ipo[Ipo.MA_R].bezierPoints[-1].vec[1][1])
+        self.assertEquals(0.5, ipo[Ipo.MA_ALPHA].bezierPoints[-1].vec[1][1])
+
+
 def Run():
         loader = runner.TestLoader()
         loader.methodPrefix = "test"

File test/test.blend

Binary file modified.