From 720207219633d8fa37d5afdbc011b0d8bc09aaba Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 14 May 2016 22:38:49 +0200 Subject: [PATCH] Freeze particle systems on construction if the AutoPlay flag is missing --- components/nifosg/nifloader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index b5311953e3..324c7796d0 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -995,6 +995,14 @@ namespace NifOsg osg::ref_ptr callback(new ParticleSystemController(partctrl)); setupParticleController(partctrl, callback, particleflags); partsys->setUpdateCallback(callback); + + if (!(particleflags & Nif::NiNode::ParticleFlag_AutoPlay)) + { + partsys->setFrozen(true); + // HACK: particle system will not render in Frozen state if there was no update + osg::NodeVisitor nv; + partsys->update(0.0, nv); + } } // affectors must be attached *after* the emitter in the scene graph for correct update order