From 4436e39be51e5b2431c5d420b45c350ba4c03162 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Sep 2010 19:10:52 +0000 Subject: [PATCH] Bit more detailed debug info --- pandatool/src/daeegg/daeToEggConverter.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pandatool/src/daeegg/daeToEggConverter.cxx b/pandatool/src/daeegg/daeToEggConverter.cxx index f7dff8a46f..5ef93b4a7e 100755 --- a/pandatool/src/daeegg/daeToEggConverter.cxx +++ b/pandatool/src/daeegg/daeToEggConverter.cxx @@ -317,19 +317,29 @@ void DAEToEggConverter::process_instance(PT(EggGroup) parent, const FCDEntityIns void DAEToEggConverter::process_mesh(PT(EggGroup) parent, const FCDGeometryMesh* mesh, PT(DaeMaterials) materials) { nassertv(mesh != NULL); daeegg_cat.debug() << "Processing mesh with id " << FROM_FSTRING(mesh->GetDaeId()) << endl; + // Create the egg stuff to hold this mesh PT(EggGroup) mesh_group = new EggGroup(FROM_FSTRING(mesh->GetDaeId())); parent->add_child(mesh_group); PT(EggVertexPool) mesh_pool = new EggVertexPool(FROM_FSTRING(mesh->GetDaeId())); mesh_group->add_child(mesh_pool); _vertex_pools[FROM_FSTRING(mesh->GetDaeId())] = mesh_pool; + // First retrieve the vertex source - if (mesh->GetSourceCount() == 0) return; - const FCDGeometrySource* vsource = mesh->FindSourceByType(FUDaeGeometryInput::POSITION); - if (vsource == NULL) return; + if (mesh->GetSourceCount() == 0) { + daeegg_cat.debug() << "Mesh with id " << FROM_FSTRING(mesh->GetDaeId()) << " has no sources" << endl; + return; + } + const FCDGeometrySource* vsource = mesh->FindSourceByType(FUDaeGeometryInput::POSITION); + if (vsource == NULL) { + daeegg_cat.debug() << "Mesh with id " << FROM_FSTRING(mesh->GetDaeId()) << " has no source for POSITION data" << endl; + return; + } + // Loop through the polygon groups and add them daeegg_cat.spam() << "Mesh with id " << FROM_FSTRING(mesh->GetDaeId()) << " has " << mesh->GetPolygonsCount() << " polygon groups" << endl; if (mesh->GetPolygonsCount() == 0) return; + // This is an array of pointers, I know. But since they are refcounted, I don't have a better idea. PT(EggGroup) *primitive_holders = new PT(EggGroup) [mesh->GetPolygonsCount()]; for (size_t gr = 0; gr < mesh->GetPolygonsCount(); ++gr) {