ciclopez
12-18-2012, 03:15 PM
Hi,
I'm trying to create a command plug-in that scatters particles (nParticles) inside closed geometry, and it's actually working, but the problem is that when I play some frames and return to the first frame of simulation, the particles are deleted.
This is the part of the code where I create the nParticle:
MDagModifier dagMod;
MFnParticleSystem particle;
MObject partTransform = dagMod.createNode("nParticle");
dagMod.doIt();
MFnDagNode dagFn(partTransform);
MObject partShape = dagFn.child(0);
particle.setObject(partShape);
particle.emit(scatteredPoints); // scatteredPoints is a previously calculated MPointArray
What is the correct way of adding particles to an nParticle node, as the "particleFill" command does?
Thanks!
I'm trying to create a command plug-in that scatters particles (nParticles) inside closed geometry, and it's actually working, but the problem is that when I play some frames and return to the first frame of simulation, the particles are deleted.
This is the part of the code where I create the nParticle:
MDagModifier dagMod;
MFnParticleSystem particle;
MObject partTransform = dagMod.createNode("nParticle");
dagMod.doIt();
MFnDagNode dagFn(partTransform);
MObject partShape = dagFn.child(0);
particle.setObject(partShape);
particle.emit(scatteredPoints); // scatteredPoints is a previously calculated MPointArray
What is the correct way of adding particles to an nParticle node, as the "particleFill" command does?
Thanks!
