- better error message when submodel loading failed
- use alignmainmodel node in callback (not used anywhere yet)
This commit is contained in:
@@ -319,8 +319,15 @@ sgLoad3DModel( const string &fg_root, const string &path,
|
|||||||
node->getFloatValue("offsets/z-m", 0.0));
|
node->getFloatValue("offsets/z-m", 0.0));
|
||||||
align->setTransform(res_matrix);
|
align->setTransform(res_matrix);
|
||||||
|
|
||||||
ssgBranch * kid = sgLoad3DModel( fg_root, node->getStringValue("path"),
|
ssgBranch * kid;
|
||||||
prop_root, sim_time_sec, load_panel );
|
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->addKid(kid);
|
||||||
align->setName(node->getStringValue("name", ""));
|
align->setName(node->getStringValue("name", ""));
|
||||||
model->addKid(align);
|
model->addKid(align);
|
||||||
@@ -340,7 +347,7 @@ sgLoad3DModel( const string &fg_root, const string &path,
|
|||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
alignmainmodel->setUserData(data);
|
alignmainmodel->setUserData(data);
|
||||||
data->modelLoaded(path, &props, model);
|
data->modelLoaded(path, &props, alignmainmodel);
|
||||||
}
|
}
|
||||||
// Load animations
|
// Load animations
|
||||||
set<ssgBranch *> ignore_branches;
|
set<ssgBranch *> ignore_branches;
|
||||||
|
|||||||
Reference in New Issue
Block a user