Collada: export vertex-color alpha
authorCampbell Barton <ideasman42@gmail.com>
Fri, 29 Sep 2017 08:12:14 +0000 (18:12 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 29 Sep 2017 08:12:14 +0000 (18:12 +1000)
source/blender/collada/GeometryExporter.cpp

index f110f4c3aa0ddf70dd391cccf65b4a6761facd3f..8a9ccbbed51cc454aa6796389c7dc7cd887f3c94 100644 (file)
@@ -718,12 +718,13 @@ void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me)
 
                source.setArrayId(layer_id + ARRAY_ID_SUFFIX);
                source.setAccessorCount(me->totloop);
-               source.setAccessorStride(3);
+               source.setAccessorStride(4);
 
                COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
                param.push_back("R");
                param.push_back("G");
                param.push_back("B");
+               param.push_back("A");
 
                source.prepareToAppendValues();
 
@@ -733,9 +734,10 @@ void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me)
                        MLoopCol *mlc = mloopcol + mpoly->loopstart;
                        for (int j = 0; j < mpoly->totloop; j++, mlc++) {
                                source.appendValues(
-                                       mlc->r / 255.0f,
-                                       mlc->g / 255.0f,
-                                       mlc->b / 255.0f
+                                               mlc->r / 255.0f,
+                                               mlc->g / 255.0f,
+                                               mlc->b / 255.0f,
+                                               mlc->a / 255.0f
                                );
                        }
                }