The OpenFlight loader keeps a local cache of external reference models to
avoid loading the same model multiple times. If your OpenFlight model has
multiple external references to the same model, the internal representation
as an OSG scene graph will be that the subtree for that model will be
multiply parented. Thus, there is only one switch, and changing its state
affects all instances of that model.
 
The OpenFlight loader options are enumerated in ReaderWriterFLT.cpp. One of
the options is "keepExternalReferences", which causes external references to
remain unloaded, as ProxyNodes. You could then write your own NodeVisitor to
traverse your loaded top-level mode, and when a ProxyNode is encountered,
load it explicitly. This would cause your internal OSG scene graph to have a
separate (identical) subtree for each external reference, regardless of
whether it's the same model or not. That would be one possible fix.
 
As another possible fix, why not add a new loader option to the OpenFlight
loader that disables use of the local cache? I'd prefer to see you implement
it this way, as I imagine others might require the same functionality in the
future.
 
Hope that helps,
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
 



  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wilson, Stuart H
(UK)
Sent: Wednesday, November 29, 2006 2:14 AM
To: [email protected]
Subject: [osg-users] External Reference Problem


Hi there, 
 
Can anyone help me out with an OSG problem I'm experiencing? 
 
I have a model in OpenFlight format that contains multiple 
external references that reference the same model. 
 
The external reference model has a switch bead that is 
exercised by my application. 
 
When I change the switch state of one of the externally 
referenced models, using the setSingleChildOn method, the 
state of ALL the models changes! (This also happens when 
updating DOF nodes). 
 
Can anyone suggest how I can get round this problem?  I'm
guessing it's a loader option that I haven't managed to find?
(Creating separate instances of each of the external 
reference models is not a feasible solution!) 
 
Thanks in advance for any help.
 
Stuart
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
        

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to