Changeset View
Changeset View
Standalone View
Standalone View
source/blender/collada/GeometryExporter.cpp
| Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | for (int a = 0; a < totlayer_mcol; a++) { | ||||
| char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPCOL, a); | char *layer_name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPCOL, a); | ||||
| std::string layer_id = makeVertexColorSourceId(geom_id, layer_name); | std::string layer_id = makeVertexColorSourceId(geom_id, layer_name); | ||||
| source.setId(layer_id); | source.setId(layer_id); | ||||
| source.setNodeName(layer_name); | source.setNodeName(layer_name); | ||||
| source.setArrayId(layer_id + ARRAY_ID_SUFFIX); | source.setArrayId(layer_id + ARRAY_ID_SUFFIX); | ||||
| source.setAccessorCount(me->totloop); | source.setAccessorCount(me->totloop); | ||||
| source.setAccessorStride(3); | source.setAccessorStride(4); | ||||
| COLLADASW::SourceBase::ParameterNameList ¶m = source.getParameterNameList(); | COLLADASW::SourceBase::ParameterNameList ¶m = source.getParameterNameList(); | ||||
| param.push_back("R"); | param.push_back("R"); | ||||
| param.push_back("G"); | param.push_back("G"); | ||||
| param.push_back("B"); | param.push_back("B"); | ||||
| param.push_back("A"); | |||||
| source.prepareToAppendValues(); | source.prepareToAppendValues(); | ||||
| MPoly *mpoly; | MPoly *mpoly; | ||||
| int i; | int i; | ||||
| for (i = 0, mpoly = me->mpoly; i < me->totpoly; i++, mpoly++) { | for (i = 0, mpoly = me->mpoly; i < me->totpoly; i++, mpoly++) { | ||||
| MLoopCol *mlc = mloopcol + mpoly->loopstart; | MLoopCol *mlc = mloopcol + mpoly->loopstart; | ||||
| for (int j = 0; j < mpoly->totloop; j++, mlc++) { | for (int j = 0; j < mpoly->totloop; j++, mlc++) { | ||||
| source.appendValues( | source.appendValues( | ||||
| mlc->r / 255.0f, | mlc->r / 255.0f, | ||||
| mlc->g / 255.0f, | mlc->g / 255.0f, | ||||
| mlc->b / 255.0f | mlc->b / 255.0f, | ||||
| mlc->a / 255.0f | |||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||
| source.finish(); | source.finish(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines | |||||