diff --git a/src/osgPlugins/OpenFlight/MaterialPaletteManager.cpp b/src/osgPlugins/OpenFlight/MaterialPaletteManager.cpp index 158b007a6..b44e9c3ac 100644 --- a/src/osgPlugins/OpenFlight/MaterialPaletteManager.cpp +++ b/src/osgPlugins/OpenFlight/MaterialPaletteManager.cpp @@ -77,7 +77,7 @@ MaterialPaletteManager::write( DataOutputStream& dos ) const dos.writeInt16( (int16) MATERIAL_PALETTE_OP ); dos.writeInt16( 84 ); // Length - FIXME: hard-code/FLT version? dos.writeInt32( m.Index ); - dos.writeString( std::string( "" ), 12 ); // Name - FIXME: put a 'real' name here? + dos.writeString( m.Material->getName(), 12 ); dos.writeInt32( 0 ); // Flags dos.writeFloat32(ambient.r() ); dos.writeFloat32(ambient.g() ); diff --git a/src/osgPlugins/OpenFlight/PaletteRecords.cpp b/src/osgPlugins/OpenFlight/PaletteRecords.cpp index 0ed52a8a2..4340bb79d 100644 --- a/src/osgPlugins/OpenFlight/PaletteRecords.cpp +++ b/src/osgPlugins/OpenFlight/PaletteRecords.cpp @@ -192,6 +192,7 @@ protected: float32 alpha = in.readFloat32(); osg::Material* material = new osg::Material; + material->setName(name); material->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(ambient,alpha)); material->setDiffuse (osg::Material::FRONT_AND_BACK,osg::Vec4(diffuse,alpha)); material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(specular,alpha));