2
0
Эх сурвалжийг харах

Merge pull request #7458 from tschw/VertexColors

Vertex Colors Blender exporter / LineDashedMaterial update (bool -> enum).
Mr.doob 9 жил өмнө
parent
commit
f45f6c7f24

+ 2 - 2
src/materials/LineDashedMaterial.js

@@ -15,7 +15,7 @@
  *  dashSize: <float>,
  *  gapSize: <float>,
  *
- *  vertexColors: <bool>
+ *  vertexColors: THREE.NoColors / THREE.FaceColors / THREE.VertexColors
  *
  *  fog: <bool>
  * }
@@ -35,7 +35,7 @@ THREE.LineDashedMaterial = function ( parameters ) {
 	this.dashSize = 3;
 	this.gapSize = 1;
 
-	this.vertexColors = false;
+	this.vertexColors = THREE.NoColors;
 
 	this.fog = true;
 

+ 4 - 1
utils/exporters/blender/addons/io_three/exporter/material.py

@@ -36,7 +36,10 @@ class Material(base_classes.BaseNode):
             self[constants.EMISSIVE] = utilities.rgb2int(emissive)
 
         vertex_color = api.material.use_vertex_colors(self.node)
-        self[constants.VERTEX_COLORS] = vertex_color
+        if vertex_color:
+            self[constants.VERTEX_COLORS] = constants.VERTEX_COLORS_ON
+        else:
+            self[constants.VERTEX_COLORS] = constants.VERTEX_COLORS_OFF
 
         self[constants.BLENDING] = api.material.blending(self.node)