diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-02 07:22:17 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-02 07:22:17 -0300 |
commit | 1572238adb5b68e18cf20ec73b2f437736e21152 (patch) | |
tree | 4cf50ac1dd8d6253f4991ae5cb0b735841e9c661 /tools/export | |
parent | ebd743f7c215d65c877874cdf58b22437757fbc6 (diff) |
merging okam changes
Diffstat (limited to 'tools/export')
-rw-r--r-- | tools/export/blender25/io_scene_dae/export_dae.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py index 5e5febfb1f..020ab6ca08 100644 --- a/tools/export/blender25/io_scene_dae/export_dae.py +++ b/tools/export/blender25/io_scene_dae/export_dae.py @@ -208,13 +208,16 @@ class DaeExporter: imgid = self.new_id("image") + + print("FOR: "+imgpath) - if (not os.path.isfile(imgpath)): - if imgpath.endswith((".bmp",".rgb",".png",".jpeg",".jpg",".jp2",".tga",".cin",".dpx",".exr",".hdr",".tif")): - imgpath="images/"+os.path.basename(imgpath) - else: - imgpath="images/"+image.name+".png" - +# if (not os.path.isfile(imgpath)): +# print("NOT FILE?") +# if imgpath.endswith((".bmp",".rgb",".png",".jpeg",".jpg",".jp2",".tga",".cin",".dpx",".exr",".hdr",".tif")): +# imgpath="images/"+os.path.basename(imgpath) +# else: +# imgpath="images/"+image.name+".png" + self.writel(S_IMGS,1,'<image id="'+imgid+'" name="'+image.name+'">') self.writel(S_IMGS,2,'<init_from>'+imgpath+'</init_from>"/>') self.writel(S_IMGS,1,'</image>') @@ -529,8 +532,8 @@ class DaeExporter: if (not (f.material_index in surface_indices)): surface_indices[f.material_index]=[] - print("Type: "+str(type(f.material_index))) - print("IDX: "+str(f.material_index)+"/"+str(len(mesh.materials))) + #print("Type: "+str(type(f.material_index))) + #print("IDX: "+str(f.material_index)+"/"+str(len(mesh.materials))) try: #Bizarre blender behavior i don't understand, so catching exception @@ -914,14 +917,14 @@ class DaeExporter: if (node.data.shape_keys!=None): sk = node.data.shape_keys if (sk.animation_data): - print("HAS ANIM") - print("DRIVERS: "+str(len(sk.animation_data.drivers))) + #print("HAS ANIM") + #print("DRIVERS: "+str(len(sk.animation_data.drivers))) for d in sk.animation_data.drivers: if (d.driver): for v in d.driver.variables: for t in v.targets: if (t.id!=None and t.id.name in self.scene.objects): - print("LINKING "+str(node)+" WITH "+str(t.id.name)) + #print("LINKING "+str(node)+" WITH "+str(t.id.name)) self.armature_for_morph[node]=self.scene.objects[t.id.name] @@ -1234,7 +1237,7 @@ class DaeExporter: il+=1 self.writel(S_NODES,il,'<matrix sid="transform">'+strmtx(node.matrix_local)+'</matrix>') - print("NODE TYPE: "+node.type+" NAME: "+node.name) + #print("NODE TYPE: "+node.type+" NAME: "+node.name) if (node.type=="MESH"): self.export_mesh_node(node,il) elif (node.type=="CURVE"): @@ -1258,7 +1261,7 @@ class DaeExporter: return False if (self.config["use_active_layers"]): valid=False - print("NAME: "+node.name) + #print("NAME: "+node.name) for i in range(20): if (node.layers[i] and self.scene.layers[i]): valid=True @@ -1408,7 +1411,7 @@ class DaeExporter: # Change frames first, export objects last # This improves performance enormously - print("anim from: "+str(start)+" to "+str(end)+" allowed: "+str(allowed)) + #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 @@ -1462,7 +1465,7 @@ class DaeExporter: bone_name=self.skeleton_info[node]["bone_ids"][bone] if (not (bone_name in xform_cache)): - print("has bone: "+bone_name) + #print("has bone: "+bone_name) xform_cache[bone_name]=[] posebone = node.pose.bones[bone.name] @@ -1548,15 +1551,15 @@ class DaeExporter: bone.matrix_basis = Matrix() - print("allowed skeletons "+str(allowed_skeletons)) + #print("allowed skeletons "+str(allowed_skeletons)) - print(str(x)) + #print(str(x)) tcn = self.export_animation(int(x.frame_range[0]),int(x.frame_range[1]+0.5),allowed_skeletons) framelen=(1.0/self.scene.render.fps) start = x.frame_range[0]*framelen end = x.frame_range[1]*framelen - print("Export anim: "+x.name) + #print("Export anim: "+x.name) self.writel(S_ANIM_CLIPS,1,'<animation_clip name="'+x.name+'" start="'+str(start)+'" end="'+str(end)+'">') for z in tcn: self.writel(S_ANIM_CLIPS,2,'<instance_animation url="#'+z+'"/>') |