Revision: 26214
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26214
Author: kazanbas
Date: 2010-01-23 18:33:40 +0100 (Sat, 23 Jan 2010)
Log Message:
-----------
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.
Revision Links:
--------------
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=721
Modified Paths:
--------------
branches/soc-2009-chingachgook/CMakeLists.txt
branches/soc-2009-chingachgook/config/linux2-config.py
branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
Modified: branches/soc-2009-chingachgook/CMakeLists.txt
===================================================================
--- branches/soc-2009-chingachgook/CMakeLists.txt 2010-01-23 17:26:39 UTC
(rev 26213)
+++ branches/soc-2009-chingachgook/CMakeLists.txt 2010-01-23 17:33:40 UTC
(rev 26214)
@@ -217,7 +217,7 @@
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)
Modified: branches/soc-2009-chingachgook/config/linux2-config.py
===================================================================
--- branches/soc-2009-chingachgook/config/linux2-config.py 2010-01-23
17:26:39 UTC (rev 26213)
+++ branches/soc-2009-chingachgook/config/linux2-config.py 2010-01-23
17:33:40 UTC (rev 26214)
@@ -156,7 +156,7 @@
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'
Modified:
branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
2010-01-23 17:26:39 UTC (rev 26213)
+++ branches/soc-2009-chingachgook/source/blender/collada/DocumentImporter.cpp
2010-01-23 17:33:40 UTC (rev 26214)
@@ -1564,15 +1564,13 @@
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 @@
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 @@
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 @@
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 @@
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 @@
int i = 0;
COLLADAFW::Color col;
- COLLADAFW::Texture ctex;
MTex *mtex = NULL;
TexIndexTextureArrayMap texindex_texarray_map;
@@ -3298,7 +3295,7 @@
}
// 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 @@
}
// 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 @@
}
// 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 @@
}
// 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 @@
}
// 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;
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs