osg::Node*
SGModelLib::loadModel(const string &path,
SGPropertyNode *prop_root,
- SGModelData *data)
+ SGModelData *data,
+ bool load2DPanels)
{
osg::ref_ptr<SGReaderWriterXMLOptions> opt = new SGReaderWriterXMLOptions(*(osgDB::Registry::instance()->getOptions()));
opt->setPropRoot(prop_root ? prop_root: static_propRoot.get());
opt->setModelData(data);
- opt->setLoadPanel(static_panelFunc);
+
+ if (load2DPanels) {
+ opt->setLoadPanel(static_panelFunc);
+ }
osg::Node *n = loadFile(path, opt.get());
if (n && n->getName().empty())
// data->modelLoaded() will be called after the model is loaded
static osg::Node* loadModel(const std::string &path,
SGPropertyNode *prop_root = NULL,
- SGModelData *data=0);
+ SGModelData *data=0, bool load2DPanels=false);
// Load a 3D model (any format) through the DatabasePager.
// Most models should be loaded using this function!