diff --git a/include/osgSim/MultiSwitch b/include/osgSim/MultiSwitch index 6c3b108e1..f1a14c284 100644 --- a/include/osgSim/MultiSwitch +++ b/include/osgSim/MultiSwitch @@ -66,7 +66,7 @@ class SG_EXPORT MultiSwitch : public osg::Group void setActiveSwitchSet(unsigned int switchSet) { _activeSwitchSet = switchSet; } /** Get which of the available switch set lists to use.*/ - unsigned int getActiveSwitchSet(unsigned int switchSet) { return _activeSwitchSet; } + unsigned int getActiveSwitchSet() const { return _activeSwitchSet; } typedef std::vector ValueList; typedef std::vector SwitchSetList; diff --git a/src/osgPlugins/osgSim/IO_MultiSwitch.cpp b/src/osgPlugins/osgSim/IO_MultiSwitch.cpp index 7212716f4..7af34df99 100644 --- a/src/osgPlugins/osgSim/IO_MultiSwitch.cpp +++ b/src/osgPlugins/osgSim/IO_MultiSwitch.cpp @@ -52,6 +52,16 @@ bool MultiSwitch_readLocalData(Object& obj, Input& fr) } } + if (fr.matchSequence("ActiveSwitchSet %i")) + { + unsigned int switchSet; + fr[1].getUInt(switchSet); + fr+=2; + + sw.setActiveSwitchSet(switchSet); + } + + if (fr.matchSequence("ValueList %i {")) { int entry = fr[0].getNoNestedBrackets(); @@ -91,6 +101,8 @@ bool MultiSwitch_writeLocalData(const Object& obj, Output& fw) fw.indent()<<"NewChildDefaultValue "<