Allow an empty virtual model, to which other submodels can be attached
(when no path is specified).
This commit is contained in:
parent
9569c43126
commit
6df9479415
1 changed files with 8 additions and 5 deletions
|
@ -197,16 +197,19 @@ FG3DModel::init (const string &path)
|
||||||
modelpath = modelpath.dir();
|
modelpath = modelpath.dir();
|
||||||
modelpath.append(props.getStringValue("/path"));
|
modelpath.append(props.getStringValue("/path"));
|
||||||
} else {
|
} else {
|
||||||
throw sg_exception("No path for model");
|
if (_model == 0)
|
||||||
|
_model = new ssgBranch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assume that textures are in
|
// Assume that textures are in
|
||||||
// the same location as the XML file.
|
// the same location as the XML file.
|
||||||
ssgTexturePath((char *)xmlpath.dir().c_str());
|
if (_model == 0) {
|
||||||
_model = (ssgBranch *)ssgLoad((char *)modelpath.c_str());
|
ssgTexturePath((char *)xmlpath.dir().c_str());
|
||||||
if (_model == 0)
|
_model = (ssgBranch *)ssgLoad((char *)modelpath.c_str());
|
||||||
throw sg_exception("Failed to load 3D model");
|
if (_model == 0)
|
||||||
|
throw sg_exception("Failed to load 3D model");
|
||||||
|
}
|
||||||
|
|
||||||
// Set up the alignment node
|
// Set up the alignment node
|
||||||
ssgTransform * align = new ssgTransform;
|
ssgTransform * align = new ssgTransform;
|
||||||
|
|
Loading…
Add table
Reference in a new issue