From: david Date: Wed, 19 Jun 2002 03:25:40 +0000 (+0000) Subject: Allow an empty virtual model, to which other submodels can be attached X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6df9479415141f4170bd60d18c3c07503b1dc018;p=flightgear.git Allow an empty virtual model, to which other submodels can be attached (when no path is specified). --- diff --git a/src/Model/model.cxx b/src/Model/model.cxx index 3f1078cff..a61b23199 100644 --- a/src/Model/model.cxx +++ b/src/Model/model.cxx @@ -197,16 +197,19 @@ FG3DModel::init (const string &path) modelpath = modelpath.dir(); modelpath.append(props.getStringValue("/path")); } else { - throw sg_exception("No path for model"); + if (_model == 0) + _model = new ssgBranch; } } // Assume that textures are in // the same location as the XML file. - ssgTexturePath((char *)xmlpath.dir().c_str()); - _model = (ssgBranch *)ssgLoad((char *)modelpath.c_str()); - if (_model == 0) - throw sg_exception("Failed to load 3D model"); + if (_model == 0) { + ssgTexturePath((char *)xmlpath.dir().c_str()); + _model = (ssgBranch *)ssgLoad((char *)modelpath.c_str()); + if (_model == 0) + throw sg_exception("Failed to load 3D model"); + } // Set up the alignment node ssgTransform * align = new ssgTransform;