Browse Source

remove emissive if it is BasicMaterial

yomotsu 9 years ago
parent
commit
5550061cf4
1 changed files with 6 additions and 1 deletions
  1. 6 1
      utils/exporters/blender/addons/io_three/exporter/api/mesh.py

+ 6 - 1
utils/exporters/blender/addons/io_three/exporter/api/mesh.py

@@ -535,7 +535,6 @@ def materials(mesh, options):
 
 
         logger.info("Compiling attributes for %s", mat.name)
         logger.info("Compiling attributes for %s", mat.name)
         attributes = {
         attributes = {
-            constants.COLOR_EMISSIVE: material.emissive_color(mat),
             constants.SHADING: material.shading(mat),
             constants.SHADING: material.shading(mat),
             constants.OPACITY: material.opacity(mat),
             constants.OPACITY: material.opacity(mat),
             constants.TRANSPARENT: material.transparent(mat),
             constants.TRANSPARENT: material.transparent(mat),
@@ -557,6 +556,12 @@ def materials(mesh, options):
             colors = material.diffuse_color(mat)
             colors = material.diffuse_color(mat)
             attributes[constants.COLOR_DIFFUSE] = colors
             attributes[constants.COLOR_DIFFUSE] = colors
 
 
+        if attributes[constants.SHADING] != constants.BASIC:
+            logger.info("Adding emissive attributes")
+            attributes.update({
+                constants.COLOR_EMISSIVE: material.emissive_color(mat),
+            })
+
         if attributes[constants.SHADING] == constants.PHONG:
         if attributes[constants.SHADING] == constants.PHONG:
             logger.info("Adding specular attributes")
             logger.info("Adding specular attributes")
             attributes.update({
             attributes.update({