From 71cb7459413160b47a47bbf0d45171ff0905a6c3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 27 Jan 2011 19:39:06 +0000 Subject: Commit to cope with API changes in OpenCOLLADA (latest for Windows right now r827). --- source/blender/collada/GeometryExporter.cpp | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source/blender/collada/GeometryExporter.cpp') diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index 7b5b5397955..73ad6f475de 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -92,9 +92,9 @@ void GeometryExporter::operator()(Object *ob) // COLLADASW::Vertices verts(mSW); - verts.setId(getIdBySemantics(geom_id, COLLADASW::VERTEX)); + verts.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::VERTEX)); COLLADASW::InputList &input_list = verts.getInputList(); - COLLADASW::Input input(COLLADASW::POSITION, getUrlBySemantics(geom_id, COLLADASW::POSITION)); + COLLADASW::Input input(COLLADASW::InputSemantic::POSITION, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::POSITION)); input_list.push_back(input); verts.add(); @@ -168,10 +168,10 @@ void GeometryExporter::createPolylist(int material_index, COLLADASW::InputList &til = polylist.getInputList(); // creates in for vertices - COLLADASW::Input input1(COLLADASW::VERTEX, getUrlBySemantics(geom_id, COLLADASW::VERTEX), 0); + COLLADASW::Input input1(COLLADASW::InputSemantic::VERTEX, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::VERTEX), 0); // creates in for normals - COLLADASW::Input input2(COLLADASW::NORMAL, getUrlBySemantics(geom_id, COLLADASW::NORMAL), 1); + COLLADASW::Input input2(COLLADASW::InputSemantic::NORMAL, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL), 1); til.push_back(input1); til.push_back(input2); @@ -181,7 +181,7 @@ void GeometryExporter::createPolylist(int material_index, for (i = 0; i < num_layers; i++) { // char *name = CustomData_get_layer_name(&me->fdata, CD_MTFACE, i); - COLLADASW::Input input3(COLLADASW::TEXCOORD, + COLLADASW::Input input3(COLLADASW::InputSemantic::TEXCOORD, makeUrl(makeTexcoordSourceId(geom_id, i)), 2, // offset always 2, this is only until we have optimized UV sets i // set number equals UV layer index @@ -190,7 +190,7 @@ void GeometryExporter::createPolylist(int material_index, } if (has_color) { - COLLADASW::Input input4(COLLADASW::COLOR, getUrlBySemantics(geom_id, COLLADASW::COLOR), has_uvs ? 3 : 2); + COLLADASW::Input input4(COLLADASW::InputSemantic::COLOR, getUrlBySemantics(geom_id, COLLADASW::InputSemantic::COLOR), has_uvs ? 3 : 2); til.push_back(input4); } @@ -240,8 +240,8 @@ void GeometryExporter::createVertsSource(std::string geom_id, Mesh *me) MVert *verts = me->mvert; COLLADASW::FloatSourceF source(mSW); - source.setId(getIdBySemantics(geom_id, COLLADASW::POSITION)); - source.setArrayId(getIdBySemantics(geom_id, COLLADASW::POSITION) + + source.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::POSITION)); + source.setArrayId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::POSITION) + ARRAY_ID_SUFFIX); source.setAccessorCount(totverts); source.setAccessorStride(3); @@ -274,8 +274,8 @@ void GeometryExporter::createVertexColorSource(std::string geom_id, Mesh *me) totcolor += f->v4 ? 4 : 3; COLLADASW::FloatSourceF source(mSW); - source.setId(getIdBySemantics(geom_id, COLLADASW::COLOR)); - source.setArrayId(getIdBySemantics(geom_id, COLLADASW::COLOR) + ARRAY_ID_SUFFIX); + source.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::COLOR)); + source.setArrayId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::COLOR) + ARRAY_ID_SUFFIX); source.setAccessorCount(totcolor); source.setAccessorStride(3); @@ -302,7 +302,7 @@ std::string GeometryExporter::makeTexcoordSourceId(std::string& geom_id, int lay { char suffix[20]; sprintf(suffix, "-%d", layer_index); - return getIdBySemantics(geom_id, COLLADASW::TEXCOORD) + suffix; + return getIdBySemantics(geom_id, COLLADASW::InputSemantic::TEXCOORD) + suffix; } //creates for texcoords @@ -373,8 +373,8 @@ void GeometryExporter::createNormalsSource(std::string geom_id, Mesh *me, std::v #endif COLLADASW::FloatSourceF source(mSW); - source.setId(getIdBySemantics(geom_id, COLLADASW::NORMAL)); - source.setArrayId(getIdBySemantics(geom_id, COLLADASW::NORMAL) + + source.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL)); + source.setArrayId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL) + ARRAY_ID_SUFFIX); source.setAccessorCount((unsigned long)nor.size()); source.setAccessorStride(3); @@ -444,12 +444,12 @@ void GeometryExporter::create_normals(std::vector &nor, std::vector