From 6df9479415141f4170bd60d18c3c07503b1dc018 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 19 Jun 2002 03:25:40 +0000 Subject: [PATCH] Allow an empty virtual model, to which other submodels can be attached (when no path is specified). --- src/Model/model.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; -- 2.39.5