<div dir="ltr"><div><div><div>Ok :-) .. I will answer it too .....<br><br></div>I am working with older version of osg where the Geometry was still not inherited from Node so I had to apply a special case for Geodes ... Sorry for the noise ;-)<br><br></div>Cheers!<br></div>Nick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 26, 2016 at 5:58 PM, Trajce Nikolov NICK <span dir="ltr"><<a href="mailto:trajce.nikolov.nick@gmail.com" target="_blank">trajce.nikolov.nick@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Community,<br><br></div>this is really simple, but for a reason it is not working on my end. I have simple model with animation (a cube that scales over time). On load I launch a NodeVisitor to collect all the Materials. I can see one Material in the text file but the parser is not hitng it. Here is my Visitor code: Any clue? And thanks a bunch as always!<br><br>struct MaterialFinderVisitor : public osg::NodeVisitor<br>{<br> MaterialFinderVisitor()<br> : osg::NodeVisitor(osg::<wbr>NodeVisitor::TRAVERSE_ALL_<wbr>CHILDREN)<br> { <br> }<br><br> virtual void apply( osg::Node& node )<br> {<br> osg::StateAttribute* attr = node.getOrCreateStateSet()-><wbr>getAttribute(osg::<wbr>StateAttribute::MATERIAL);<br> if (attr)<br> {<br> std::cout << "ATTRIBUTE: " << attr->getName() << std::endl;<br><br> osg::Material* material = dynamic_cast<osg::Material*>(<wbr>attr);<br> if (material && (material->getName() != "@RootMaterial@"))<br> { <br> std::cout << "MATERIAL: " << material->getName() << std::endl; <br> }<br> }<br> traverse(node);<br> }<span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><div><br>-- <br><div data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>