[osg-users] Accessing StateSets

2011-04-12 Thread Ethan Kerzner
Hi, I am trying to access the material stored in a stateset. Is this possible? My approach is below- the first line returns a null pointer. Code: osg::StateAttribute* sa = myGeode.getOrCreateStateSet()-getAttribute(osg::StateAttribute::MATERIAL); osg::Material* mat =

Re: [osg-users] Accessing StateSets

2011-04-12 Thread Robert Osfield
Hi Ethan, You code segment looks OK, and if the the getAttribute is returning a NULL then the most likley reason is that there in no osg::Material attached to that particular StateSet. It's perfectly normals for StateSet to not contain an osg::Material, so returning NULL is nothing out of the