forked from bartvdbraak/blender
Fix [#26475] <instance_material> wrong in COLLADA export.
reported by Juan Linietsky fix by Imran Syed (freakabcd) Use material index suffixed to material name to create symbolic name.
This commit is contained in:
parent
60b94886c8
commit
de89e78589
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user