<div dir="ltr">Hi Brad,<div>I think your code should work, but instead of disabling the cache you can clone only the parts you need:</div><div>osg::ref_ptr<osg::Node> newNode = dynamic_cast<osg::Node *>(oldNode->clone(osg::CopyOp::DEEP_COPY_NODES));<br></div><div>Assuming the rotating is done on a Transform node, this will let you share all geometry and statesets.</div><div>Laurens.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 8, 2019 at 4:05 AM Brad Colbert <<a href="mailto:bcolbert@rscusa.com">bcolbert@rscusa.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm reading a model multiple times using osgDB::readNodeFile. I'm rotating a part on one of the models but the same part on all of the instances of the model are rotating.<br>
<br>
I've looked at the pointer returned from osgDB::readNodeFile for all of the load calls (for the same model file) and they are all the same. I'm assuming that the model is cached the first time and I'm getting an instance of the cached model for each subsequent call to osgDB::readNodeFile.<br>
<br>
I've tried what I think should disable the caching for this instance (from one of the examples):<br>
<br>
<br>
Code:<br>
// Load the model<br>
osg::ref_ptr<osgDB::Options> options = new osgDB::Options("a=1 b=2 c=3");<br>
options->setObjectCacheHint(osgDB::Options::CACHE_NONE);<br>
osg::Node* model = osgDB::readNodeFile(modelName, options);<br>
<br>
<br>
<br>
<br>
How do I turn this off or get around this?<br>
<br>
OpenSceneGraph Library 3.6.3<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Brad<br>
Code:<br>
<br>
<br>
<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=76884#76884" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76884#76884</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div>