From 347216a3acd5dc70760fbb5f5ebfe735b12593ae Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 29 Dec 2008 15:45:17 +0000 Subject: [PATCH] Fix couple of stuff --- pandatool/src/daeegg/daeMaterials.cxx | 6 +++++- pandatool/src/daeegg/daeToEggConverter.cxx | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandatool/src/daeegg/daeMaterials.cxx b/pandatool/src/daeegg/daeMaterials.cxx index 53573ea558..20a402056c 100755 --- a/pandatool/src/daeegg/daeMaterials.cxx +++ b/pandatool/src/daeegg/daeMaterials.cxx @@ -54,7 +54,7 @@ void DaeMaterials::add_material_instance(const FCDMaterialInstance* instance) { nassertv(instance != NULL); const string semantic (FROM_FSTRING(instance->GetSemantic())); if (_materials.count(semantic) > 0) { - daeegg_cat.warning() << "Ignoring duplicate material with semantic" << semantic << endl; + daeegg_cat.warning() << "Ignoring duplicate material with semantic " << semantic << endl; return; } _materials[semantic] = new DaeMaterial(); @@ -63,7 +63,11 @@ void DaeMaterials::add_material_instance(const FCDMaterialInstance* instance) { for (size_t vib = 0; vib < instance->GetVertexInputBindingCount(); ++vib) { const FCDMaterialInstanceBindVertexInput* mivib = instance->GetVertexInputBinding(vib); assert(mivib != NULL); +#if FCOLLADA_VERSION >= 0x00030005 _materials[semantic]->_uvsets[mivib->inputSet] = *mivib->semantic; +#else + _materials[semantic]->_uvsets[mivib->inputSet] = FROM_FSTRING(mivib->semantic); +#endif } // Handle the material stuff diff --git a/pandatool/src/daeegg/daeToEggConverter.cxx b/pandatool/src/daeegg/daeToEggConverter.cxx index a614f4c70e..b0d53a12d8 100755 --- a/pandatool/src/daeegg/daeToEggConverter.cxx +++ b/pandatool/src/daeegg/daeToEggConverter.cxx @@ -36,7 +36,6 @@ #include "FCDocument/FCDGeometry.h" #include "FCDocument/FCDGeometryInstance.h" #include "FCDocument/FCDGeometryPolygons.h" -#include "FCDocument/FCDGeometryPolygonsInput.h" #include "FCDocument/FCDGeometrySource.h" #include "FCDocument/FCDSkinController.h" #include "FCDocument/FCDController.h" @@ -46,6 +45,9 @@ #include "FCDocument/FCDExtra.h" #include "FCDocument/FCDEffect.h" #include "FCDocument/FCDEffectStandard.h" +#if FCOLLADA_VERSION >= 0x00030005 + #include "FCDocument/FCDGeometryPolygonsInput.h" +#endif //////////////////////////////////////////////////////////////////// // Function: DAEToEggConverter::Constructor @@ -136,13 +138,15 @@ convert_file(const Filename &filename) { // Read the file FCollada::Initialize(); _document = FCollada::LoadDocument(filename.to_os_specific().c_str()); - if(_document == NULL) { + if (_document == NULL) { daeegg_cat.error() << "Failed to load document: " << _error_handler.GetErrorString() << endl; FCollada::Release(); return false; } // Make sure the file uses consistent coordinate system and length - FCDocumentTools::StandardizeUpAxisAndLength(_document); + if (_document->GetAsset() != NULL) { + FCDocumentTools::StandardizeUpAxisAndLength(_document); + } _table = new EggTable(); _table->set_table_type(EggTable::TT_table);