summaryrefslogtreecommitdiff
path: root/tools/export/blender25
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-08-01 22:10:38 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-08-01 22:10:38 -0300
commit678948068bbde7f12a9c5f28a467b6cf4d127851 (patch)
tree75572f3a5cc6089a6ca3046e9307d0a7c0b72c51 /tools/export/blender25
parent9ff6d55822647c87eef392147ea15641d0922d47 (diff)
Small Issues & Maintenance
-=-=-=-=-=-=-=-=-=-=-=-=-= -Begin work on Navigation Meshes (simple pathfinding for now, will improve soon) -More doc on theme overriding -Upgraded OpenSSL to version without bugs -Misc bugfixes
Diffstat (limited to 'tools/export/blender25')
-rw-r--r--tools/export/blender25/io_scene_dae/export_dae.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py
index 1a0cb37a17..15ec77cf8f 100644
--- a/tools/export/blender25/io_scene_dae/export_dae.py
+++ b/tools/export/blender25/io_scene_dae/export_dae.py
@@ -1030,7 +1030,7 @@ class DaeExporter:
return [anim_id]
- def export_animation(self,start,end):
+ def export_animation(self,start,end,allowed=None):
#Blender -> Collada frames needs a little work
#Collada starts from 0, blender usually from 1
@@ -1047,7 +1047,7 @@ class DaeExporter:
# Change frames first, export objects last
# This improves performance enormously
- print("anim from: "+str(start)+" to "+str(end))
+ print("anim from: "+str(start)+" to "+str(end)+" allowed: "+str(allowed))
for t in range(start,end+1):
self.scene.frame_set(t)
key = t * frame_len - frame_sub
@@ -1057,6 +1057,8 @@ class DaeExporter:
if (not node in self.valid_nodes):
continue
+ if (allowed!=None and not (node in allowed)):
+ continue
if (node.type=="MESH" and node.parent and node.parent.type=="ARMATURE"):
continue #In Collada, nodes that have skin modifier must not export animation, animate the skin instead.
@@ -1080,6 +1082,7 @@ class DaeExporter:
bone_name=self.skeleton_info[node]["bone_ids"][bone]
if (not (bone_name in xform_cache)):
+ print("has bone: "+bone_name)
xform_cache[bone_name]=[]
posebone = node.pose.bones[bone.name]
@@ -1113,12 +1116,33 @@ class DaeExporter:
for x in bpy.data.actions[:]:
if x in self.action_constraints:
continue
+
+ bones=[]
+ #find bones used
+ for p in x.fcurves:
+ dp = str(p.data_path)
+ base = "pose.bones[\""
+ if (dp.find(base)==0):
+ dp=dp[len(base):]
+ if (dp.find('"')!=-1):
+ dp=dp[:dp.find('"')]
+ if (not dp in bones):
+ bones.append(dp)
+
+ allowed_skeletons=[]
for y in self.skeletons:
if (y.animation_data):
+ for z in y.pose.bones:
+ if (z.bone.name in bones):
+ if (not y in allowed_skeletons):
+ allowed_skeletons.append(y)
y.animation_data.action=x;
- tcn = self.export_animation(int(x.frame_range[0]),int(x.frame_range[1]))
+
+ print(str(x))
+
+ tcn = self.export_animation(int(x.frame_range[0]),int(x.frame_range[1]),allowed_skeletons)
framelen=(1.0/self.scene.render.fps)
start = x.frame_range[0]*framelen
end = x.frame_range[1]*framelen