THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/10/2011 at 05:51, xxxxxxxx wrote:
Okay, I'll try.... basically, the emitter is a generator object and stores the particle data in an array of my own class, which in turn is subclassed from the SDK Particle class. So it has all the data contained in Particle plus a lot of other stuff specific to my emitter.
Now this data is not stored in a ParticleTag as with the C4D ParticleObject but it is easy to create a ParticleTag and copy the small amount of data to fill that tag across to it. So if PC is looking for that tag to get the particle data it should find it. I've done this but PC seems to ignore it. I find it hard to believe that PC specifically wants a ParticleObject since it works with both the standard emitter and TP.
Here's the code snippet I use in the emitter's Init function to create the tag:
// add a particle tag
VariableTag *vt = op->MakeVariableTag(Tparticle, theOpts.maxParticles); // maxParticles is the maximum number of particles
GePrint("In Init Could not create particle tag.");
GePrint("In Init successfully created a particle tag.");
The GePrints there just confirm that the tag is successfully created. In GetVirtualObjects I copy the required data across, the code is:
// fill the particle tag
VariableTag *vt = (VariableTag* )op->GetTag(Tparticle);
Particle *pc = (Particle* )vt->GetLowlevelDataAddressW();
for(i = 0; i < particleCount; i++)
pc[i].off = pt[i].off;
pc[i].v1 = pt[i].v1;
pc[i].v3 = pt[i].v3;
pc[i].t = pt[i].t;
pc[i].bits = pt[i].bits;
The variable 'pt' is an array of my own particle data class. A quick check with a debugger shows that the tag is successfully retrieved and the data is copied over, so the tag is there and contains the data PC would need. Yet it just doesn't seem to want to play.
Many thanks for taking a look at this. I'm really very grateful.