Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/collada/GeometryExporter.cpp6
-rw-r--r--source/blender/collada/InstanceWriter.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index 9edfbe14a71..332df0318e9 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -28,6 +28,8 @@
*/
+#include <sstream>
+
#include "COLLADASWPrimitves.h"
#include "COLLADASWSource.h"
#include "COLLADASWVertices.h"
@@ -167,7 +169,9 @@ void GeometryExporter::createPolylist(int material_index,
// sets material name
if (ma) {
- polylist.setMaterial(translate_id(id_name(ma)));
+ std::ostringstream ostr;
+ ostr << translate_id(id_name(ma)) << material_index+1;
+ polylist.setMaterial(ostr.str());
}
COLLADASW::InputList &til = polylist.getInputList();
diff --git a/source/blender/collada/InstanceWriter.cpp b/source/blender/collada/InstanceWriter.cpp
index f822db0f39b..a069e72fbbd 100644
--- a/source/blender/collada/InstanceWriter.cpp
+++ b/source/blender/collada/InstanceWriter.cpp
@@ -29,6 +29,7 @@
#include <string>
+#include <sstream>
#include "COLLADASWInstanceMaterial.h"
@@ -52,7 +53,9 @@ void InstanceWriter::add_material_bindings(COLLADASW::BindMaterial& bind_materia
if (ma) {
std::string matid(get_material_id(ma));
matid = translate_id(matid);
- COLLADASW::InstanceMaterial im(matid, COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, matid));
+ std::ostringstream ostr;
+ ostr << translate_id(id_name(ma)) << a+1;
+ COLLADASW::InstanceMaterial im(ostr.str(), COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, matid));
// create <bind_vertex_input> for each uv layer
Mesh *me = (Mesh*)ob->data;