Hi Ulrich

I think you are right in what was going wrong but for some reason the prox node 
does not complain when I delete the file and rewrite it, the key is to delete 
it first. The material-modified models can be saved and reloaded with this code:

 

Code:

void M_model::Update_files(void)
{
    if(_material_changed)
    {
        if(boost::filesystem::exists("../Models/" + _file_name + ".osgb"))
        {
            boost::filesystem::remove("../Models/" + _file_name + ".osgb");
        }
        if(boost::filesystem::exists("../Models/" + _file_name + ".3ds"))
        {
            boost::filesystem::remove("../Models/" + _file_name + ".3ds");
        }
        osgDB::writeNodeFile(*_prox_node,  std::string("../Models/" + 
_file_name + ".3ds"));
        osgDB::writeNodeFile(*_prox_node,  std::string("../Models/" + 
_file_name + ".obj"));
        // osgDB::writeNodeFile(*_prox_node,  std::string("../Models/" + 
_file_name + ".stl"));
    }
}



 

Thanks,

Patrick

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58403#58403





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to