From Javier Taibo, " In current SVN code, when exporting an osgParticle::Particle object to the .osg file format, it crashes if no drawable was set in the particle.

In the attached file (src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp) I have added a check for the existence of the drawable before writing it to the file.
"
This commit is contained in:
Robert Osfield
2010-11-02 11:19:17 +00:00
parent 112c272452
commit 316c1a88a9

View File

@@ -249,12 +249,14 @@ void write_particle(const osgParticle::Particle &P, osgDB::Output &fw)
fw.writeObject(*P.getColorInterpolator());
fw.moveOut();
fw.indent() << "}" << std::endl;
fw.indent() << "drawable {" << std::endl;
fw.moveIn();
fw.writeObject(*P.getDrawable());
fw.moveOut();
fw.indent() << "}" << std::endl;
if ( P.getDrawable() != NULL ) {
fw.indent() << "drawable {" << std::endl;
fw.moveIn();
fw.writeObject(*P.getDrawable());
fw.moveOut();
fw.indent() << "}" << std::endl;
}
fw.moveOut();
fw.indent() << "}" << std::endl;