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:
authorArystanbek Dyussenov <arystan.d@gmail.com>2010-01-23 20:33:40 +0300
committerArystanbek Dyussenov <arystan.d@gmail.com>2010-01-23 20:33:40 +0300
commit669533437778339e293c8b2bfefa32166a6cc708 (patch)
tree1d4c50f018764967ce86469aeb1b8e91755810dc
parentea1b97a184d54e9c6fa52a89d57d671395eb6483 (diff)
COLLADA branch: patch for importer from Sergey I. Sharybin to build against OpenCollada at revision 721. Thanks Sergey!
People who want to build this branch will need update their OpenCollada. On Linux OpenCollada builds without patching. As usual I updated the build doc: http://wiki.blender.org/index.php/User:Kazanbas/Building_Collada_Branch#Building_the_COLLADA_GSoC_branch A small change will be necessary in cmake and scons options on Mac and Windows: OpenCollada's libBuffer was renamed to libbuffer.
-rw-r--r--CMakeLists.txt2
-rw-r--r--config/linux2-config.py2
-rw-r--r--source/blender/collada/DocumentImporter.cpp29
3 files changed, 15 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5bce899c5f..077b5125de9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,7 +217,7 @@ IF(UNIX AND NOT APPLE)
IF (WITH_OPENCOLLADA)
SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
- SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa Buffer)
+ SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer)
SET(OPENCOLLADA_INC ${OPENCOLLADA})
SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
SET(PCRE_LIBPATH ${PCRE}/lib)
diff --git a/config/linux2-config.py b/config/linux2-config.py
index fe07d6dd307..cf79a6a870f 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -156,7 +156,7 @@ BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = '/usr'
-BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre Buffer ftoa'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
BF_PCRE = ''
BF_PCRE_LIB = 'pcre'
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 26e95c378a6..ad8edccbf89 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -1564,15 +1564,13 @@ public:
return NULL;
}
- MTex *assign_textures_to_uvlayer(COLLADAFW::InstanceGeometry::TextureCoordinateBinding &ctexture,
+ MTex *assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture,
Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
MTex *color_texture)
{
-
- COLLADAFW::TextureMapId texture_index = ctexture.textureMapId;
-
- char *uvname = CustomData_get_layer_name(&me->fdata, CD_MTFACE, ctexture.setIndex);
-
+ COLLADAFW::TextureMapId texture_index = ctexture.getTextureMapId();
+ char *uvname = CustomData_get_layer_name(&me->fdata, CD_MTFACE, ctexture.getSetIndex());
+
if (texindex_texarray_map.find(texture_index) == texindex_texarray_map.end()) {
fprintf(stderr, "Cannot find texture array by texture index.\n");
@@ -1595,7 +1593,7 @@ public:
return color_texture;
}
- MTFace *assign_material_to_geom(COLLADAFW::InstanceGeometry::MaterialBinding cmaterial,
+ MTFace *assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
Object *ob, const COLLADAFW::UniqueId *geom_uid,
MTex **color_texture, char *layername, MTFace *texture_face,
@@ -1614,7 +1612,7 @@ public:
Material *ma = uid_material_map[ma_uid];
assign_material(ob, ma, ob->totcol + 1);
- COLLADAFW::InstanceGeometry::TextureCoordinateBindingArray& tex_array =
+ COLLADAFW::TextureCoordinateBindingArray& tex_array =
cmaterial.getTextureCoordinateBindingArray();
TexIndexTextureArrayMap texindex_texarray_map = material_texture_mapping_map[ma];
unsigned int i;
@@ -1714,7 +1712,7 @@ public:
MTFace *texture_face = NULL;
MTex *color_texture = NULL;
- COLLADAFW::InstanceGeometry::MaterialBindingArray& mat_array =
+ COLLADAFW::MaterialBindingArray& mat_array =
geom->getMaterialBindings();
// loop through geom's materials
@@ -3130,7 +3128,7 @@ public:
ob = create_lamp_object(lamp[0], ob, sce);
}
else if (controller.getCount() != 0) {
- COLLADAFW::InstanceController *geom = (COLLADAFW::InstanceController*)controller[0];
+ COLLADAFW::InstanceGeometry *geom = (COLLADAFW::InstanceGeometry*)controller[0];
ob = mesh_importer.create_mesh_object(node, geom, true, uid_material_map, material_texture_mapping_map);
}
// XXX instance_node is not supported yet
@@ -3284,7 +3282,6 @@ public:
int i = 0;
COLLADAFW::Color col;
- COLLADAFW::Texture ctex;
MTex *mtex = NULL;
TexIndexTextureArrayMap texindex_texarray_map;
@@ -3298,7 +3295,7 @@ public:
}
// texture
else if (ef->getDiffuse().isTexture()) {
- ctex = ef->getDiffuse().getTexture();
+ COLLADAFW::Texture ctex = ef->getDiffuse().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
mtex->mapto = MAP_COL;
@@ -3316,7 +3313,7 @@ public:
}
// texture
else if (ef->getAmbient().isTexture()) {
- ctex = ef->getAmbient().getTexture();
+ COLLADAFW::Texture ctex = ef->getAmbient().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
mtex->mapto = MAP_AMB;
@@ -3333,7 +3330,7 @@ public:
}
// texture
else if (ef->getSpecular().isTexture()) {
- ctex = ef->getSpecular().getTexture();
+ COLLADAFW::Texture ctex = ef->getSpecular().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
mtex->mapto = MAP_SPEC;
@@ -3350,7 +3347,7 @@ public:
}
// texture
else if (ef->getReflective().isTexture()) {
- ctex = ef->getReflective().getTexture();
+ COLLADAFW::Texture ctex = ef->getReflective().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
mtex->mapto = MAP_REF;
@@ -3365,7 +3362,7 @@ public:
}
// texture
else if (ef->getEmission().isTexture()) {
- ctex = ef->getEmission().getTexture();
+ COLLADAFW::Texture ctex = ef->getEmission().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
mtex->mapto = MAP_EMIT;