From ed20ce388aaebd6c7dbe14d7d527bbd8be4121b1 Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 17 Mar 2006 19:01:52 +0000 Subject: [PATCH] - better error message when submodel loading failed - use alignmainmodel node in callback (not used anywhere yet) --- simgear/scene/model/model.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index e7db0824..8021b302 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -319,8 +319,15 @@ sgLoad3DModel( const string &fg_root, const string &path, node->getFloatValue("offsets/z-m", 0.0)); align->setTransform(res_matrix); - ssgBranch * kid = sgLoad3DModel( fg_root, node->getStringValue("path"), - prop_root, sim_time_sec, load_panel ); + ssgBranch * kid; + const char * submodel = node->getStringValue("path"); + try { + kid = sgLoad3DModel( fg_root, submodel, prop_root, sim_time_sec, load_panel ); + + } catch (const sg_throwable &t) { + SG_LOG(SG_INPUT, SG_ALERT, "Failed to load submodel: " << t.getFormattedMessage()); + throw; + } align->addKid(kid); align->setName(node->getStringValue("name", "")); model->addKid(align); @@ -340,7 +347,7 @@ sgLoad3DModel( const string &fg_root, const string &path, if (data) { alignmainmodel->setUserData(data); - data->modelLoaded(path, &props, model); + data->modelLoaded(path, &props, alignmainmodel); } // Load animations set ignore_branches;