@@ -44,6 +44,16 @@ ColorAnimPlugin::~ColorAnimPlugin()
4444 {
4545 cover->getObjectsRoot ()->removeChild (brainTransform.get ());
4646 }
47+
48+ if (secondModel.valid () && cover->getObjectsRoot ())
49+ {
50+ cover->getObjectsRoot ()->removeChild (secondModel.get ());
51+ }
52+
53+ if (thirdModel.valid () && cover->getObjectsRoot ())
54+ {
55+ cover->getObjectsRoot ()->removeChild (thirdModel.get ());
56+ }
4757}
4858
4959bool ColorAnimPlugin::init ()
@@ -167,6 +177,40 @@ bool ColorAnimPlugin::init()
167177 updateColors ();
168178 }
169179
180+ // Load second additional model
181+ std::string secondModelPath = coCoviseConfig::getEntry (" value" , " COVER.Plugin.ColorAnim.SecondModel" , " " );
182+ if (!secondModelPath.empty ())
183+ {
184+ fprintf (stderr, " ColorAnimPlugin: Loading second model from %s\n " , secondModelPath.c_str ());
185+ secondModel = osgDB::readNodeFile (secondModelPath);
186+ if (secondModel.valid ())
187+ {
188+ cover->getObjectsRoot ()->addChild (secondModel.get ());
189+ fprintf (stderr, " ColorAnimPlugin: Second model loaded successfully\n " );
190+ }
191+ else
192+ {
193+ fprintf (stderr, " ColorAnimPlugin: Warning - Could not load second model: %s\n " , secondModelPath.c_str ());
194+ }
195+ }
196+
197+ // Load third additional model
198+ std::string thirdModelPath = coCoviseConfig::getEntry (" value" , " COVER.Plugin.ColorAnim.ThirdModel" , " " );
199+ if (!thirdModelPath.empty ())
200+ {
201+ fprintf (stderr, " ColorAnimPlugin: Loading third model from %s\n " , thirdModelPath.c_str ());
202+ thirdModel = osgDB::readNodeFile (thirdModelPath);
203+ if (thirdModel.valid ())
204+ {
205+ cover->getObjectsRoot ()->addChild (thirdModel.get ());
206+ fprintf (stderr, " ColorAnimPlugin: Third model loaded successfully\n " );
207+ }
208+ else
209+ {
210+ fprintf (stderr, " ColorAnimPlugin: Warning - Could not load third model: %s\n " , thirdModelPath.c_str ());
211+ }
212+ }
213+
170214 fprintf (stderr, " ColorAnimPlugin: Initialization complete\n " );
171215 return true ;
172216}
0 commit comments