From 8140035ea8e0bd9a853ad1bc2bbfc8f07d4aac89 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 7 Jun 2002 11:32:18 +0000 Subject: [PATCH] Fixed a couple of problems with the NodeKit support. --- src/osgDB/Registry.cpp | 2 ++ src/osgParticle/IO_ModularEmitter.cpp | 6 +++--- src/osgParticle/IO_ParticleProcessor.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 874932dca..495ad6bde 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -151,6 +151,8 @@ void Registry::addDotOsgWrapper(DotOsgWrapper* wrapper) std::string libraryName = proto->libraryName(); std::string compositeName = libraryName + "::" + name; + _objectWrapperMap[compositeName] = wrapper; + if (wrapper->getReadWriteMode()==DotOsgWrapper::READ_AND_WRITE) _classNameWrapperMap[proto->className()] = wrapper; if (dynamic_cast(proto)) diff --git a/src/osgParticle/IO_ModularEmitter.cpp b/src/osgParticle/IO_ModularEmitter.cpp index 0fd0f0496..37ea46707 100644 --- a/src/osgParticle/IO_ModularEmitter.cpp +++ b/src/osgParticle/IO_ModularEmitter.cpp @@ -54,9 +54,9 @@ bool ModularEmitter_writeLocalData(const osg::Object &obj, osgDB::Output &fw) { const osgParticle::ModularEmitter &myobj = static_cast(obj); - fw.writeObject(*myobj.getCounter()); - fw.writeObject(*myobj.getPlacer()); - fw.writeObject(*myobj.getShooter()); + if (myobj.getCounter()) fw.writeObject(*myobj.getCounter()); + if (myobj.getPlacer()) fw.writeObject(*myobj.getPlacer()); + if (myobj.getShooter()) fw.writeObject(*myobj.getShooter()); return true; } diff --git a/src/osgParticle/IO_ParticleProcessor.cpp b/src/osgParticle/IO_ParticleProcessor.cpp index f349e66f7..bc6a60fb3 100644 --- a/src/osgParticle/IO_ParticleProcessor.cpp +++ b/src/osgParticle/IO_ParticleProcessor.cpp @@ -70,7 +70,7 @@ bool ParticleProcessor_writeLocalData(const osg::Object &obj, osgDB::Output &fw) { const osgParticle::ParticleProcessor &myobj = static_cast(obj); - fw.writeObject(*myobj.getParticleSystem()); + if (myobj.getParticleSystem()) fw.writeObject(*myobj.getParticleSystem()); fw.indent() << "enabled "; if (myobj.isEnabled())