Hi again !
I'm working on some kind of editor in fact, and I've noticed that when you have a StateSet, and a given StateAttribute, if you call stateSet->setAttributeAndModes(attribute,osg::StateAttribute:ON|osg::StateAttribute::...etc,etc.. ) then, (at least for a osg::Fog attribute for example) in the RefAttributePair created, the osg::StateAttribute::ON (or OFF) is not added... My theory is that this ON/OFF setting each time goes in a given assosiated mode (as there is on trace of them in RefAttributePair constructors in StateSet.cpp) : Am I right, or making a big mistake ?? By the way, on a completely different topic, I can now confirm that the boost serialization for OSG files works pretty well :-) I followed your advise Robert and used osgIntrospection to generate the sources... and this generator is a single main.cpp file :-). As a result I have a single library capable of writing text,xml or binary OSG files indifferently (yes, we can even same image data in text and xml files !) Yet the XML format is not easily readable :-( here is a simple stateset section for example : <StateSet class_id="21" tracking_level="1" version="0" object_id="_5"> <Object> <Referenced object_id="_6"> <ThreadSafeRefUnref>1</ThreadSafeRefUnref> </Referenced> <DataVariance>1</DataVariance> <Name></Name> <UserData class_id="-1"></UserData> </Object> <AttributeList class_id="22" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="23" tracking_level="0" version="0"> <first class_id="24" tracking_level="0" version="0"> <first>8</first> <second>0</second> </first> <second class_id="25" tracking_level="0" version="0"> <first class_id="26" tracking_level="0" version="0"> <StateAttribute class_id="27" class_name="osg_Fog" tracking_level="1" version="0" object_id="_7"> <StateAttribute class_id="28" tracking_level="0" version="0"> <Object> <Referenced object_id="_8"> <ThreadSafeRefUnref>1</ThreadSafeRefUnref> </Referenced> <DataVariance>2</DataVariance> <Name></Name> <UserData class_id="-1"></UserData> </Object> <EventCallback class_id="-1"></EventCallback> <UpdateCallback class_id="-1"></UpdateCallback> </StateAttribute> <Color class_id="30" tracking_level="0" version="0"> <x>0</x> <y>0</y> <z>0</z> <w>0</w> </Color> <Density>0.80000001 </Density> <End>11.8</End> <FogCoordinateSource>33874</FogCoordinateSource> <Mode>2048</Mode> <Start>-10.1</Start> </StateAttribute> </first> <second>2</second> </second> </item> </AttributeList> <BinName></BinName> <BinNumber>0</BinNumber> <EventCallback class_id="-1"></EventCallback> <ModeList class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <first>2912</first> <second>3</second> </item> </ModeList> <RenderBinMode>0</RenderBinMode> <RenderingHint>0</RenderingHint> <TextureAttributeList class_id="34" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </TextureAttributeList> <TextureModeList class_id="35" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </TextureModeList> <UniformList class_id="36" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </UniformList> <UpdateCallback class_id="-1"></UpdateCallback> </StateSet> -Main issues left: --> it's useless to save the <ThreadSafeRefUnref>1</ThreadSafeRefUnref> (easily solvable) --> Enumerations don't use labels :-( --> automatically generated STL containers use standard xml tags (item, first, second, count, etc...) :-( Cheers, Manu.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org