- 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;
+ }
+
+ SGPropertyNode *cond = node->getNode("condition", false);
+ if (cond) {
+ align->setUserData(new SGConditionalRender(sgReadCondition(prop_root, cond)));
+ align->setTravCallback(SSG_CALLBACK_PRETRAV, model_condition_callback);
+ }
+