diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py index 492a737e23e..9568ccb6458 100644 --- a/tools/export/blender25/io_scene_dae/export_dae.py +++ b/tools/export/blender25/io_scene_dae/export_dae.py @@ -87,6 +87,15 @@ def numarr(a,mult=1.0): s+=" " return s +def numarr_alpha(a,mult=1.0): + s=" " + for x in a: + s+=" "+str(x*mult) + if len(a) == 3: + s+=" 1.0" + s+=" " + return s + def strarr(arr): s=" " for x in arr: @@ -291,25 +300,25 @@ class DaeExporter: if (emission_tex!=None): self.writel(S_FX,6,'') else: - self.writel(S_FX,6,''+numarr(material.diffuse_color,material.emit)+' ') # not totally right but good enough + self.writel(S_FX,6,''+numarr_alpha(material.diffuse_color,material.emit)+' ') # not totally right but good enough self.writel(S_FX,5,'') self.writel(S_FX,5,'') - self.writel(S_FX,6,''+numarr(self.scene.world.ambient_color,material.ambient)+' ') + self.writel(S_FX,6,''+numarr_alpha(self.scene.world.ambient_color,material.ambient)+' ') self.writel(S_FX,5,'') self.writel(S_FX,5,'') if (diffuse_tex!=None): self.writel(S_FX,6,'') else: - self.writel(S_FX,6,''+numarr(material.diffuse_color,material.diffuse_intensity)+'') + self.writel(S_FX,6,''+numarr_alpha(material.diffuse_color,material.diffuse_intensity)+'') self.writel(S_FX,5,'') self.writel(S_FX,5,'') if (specular_tex!=None): self.writel(S_FX,6,'') else: - self.writel(S_FX,6,''+numarr(material.specular_color,material.specular_intensity)+'') + self.writel(S_FX,6,''+numarr_alpha(material.specular_color,material.specular_intensity)+'') self.writel(S_FX,5,'') self.writel(S_FX,5,'') @@ -317,7 +326,7 @@ class DaeExporter: self.writel(S_FX,5,'') self.writel(S_FX,5,'') - self.writel(S_FX,6,''+strarr(material.mirror_color)+'') + self.writel(S_FX,6,''+numarr_alpha(material.mirror_color)+'') self.writel(S_FX,5,'') if (material.use_transparency): @@ -325,10 +334,11 @@ class DaeExporter: self.writel(S_FX,6,''+str(material.alpha)+'') self.writel(S_FX,5,'') - + self.writel(S_FX,5,'') + self.writel(S_FX,6,''+str(material.specular_ior)+'') + self.writel(S_FX,5,'') self.writel(S_FX,4,'') - self.writel(S_FX,4,''+str(material.specular_ior)+'') self.writel(S_FX,4,'') self.writel(S_FX,5,'')