Merge 2 Particle List

   4121   5   1
User Avatar
Member
10 posts
Joined: 8月 2010
Offline
I have 2 lists of particles which I want to merge.

The method merge of POP_ParticleList doesn't run, I don't know if it's a bug or an error:

This is my code:


particleList->merge(particuleList2);

for (GEO_PrimParticle* part = particleList->iterateInit() ; part ; part = particleList->iterateNext()) {

for (GEO_ParticleVertex* pvtx = part->iterateInit() ; pvtx ; pvtx = pvtx->next) {

GEO_Point* pt = pvtx->getPt();
cout << pt->getPos().x() << “ - ” << pt->getPos().y() << “ - ” << pt->getPos().z() << endl;

}
}
User Avatar
Member
10 posts
Joined: 8月 2010
Offline
Up please.
User Avatar
スタッフ
1081 posts
Joined: 7月 2005
Offline
POP_ParticleList::merge() skips merging any particle primitives that are already in the list. Maybe you have duplicates?
User Avatar
Member
10 posts
Joined: 8月 2010
Offline
My particle lists are distinct and informations stored are different. The result of merge is just the first list (ParticleList in this case) and list isn't extend, so it can't contain ParticleList2 . If I reverse lists, the result will be ParticleList2.
User Avatar
スタッフ
1081 posts
Joined: 7月 2005
Offline
Particle primitives are compared by primitive number, not by pointer, so perhaps you have conflicting primitives from different details in your two lists. In which case, you shouldn't be merging the two lists anyway. Without knowing more about the rest of the code or what you're trying to achieve, I can't comment further.
User Avatar
Member
94 posts
Joined: 12月 2008
Offline
Hi Calysto !!

Are you setting ditinct IDs where you create your particle systems?

Look at the Attributes tab of your particle sources, and set them to different values.

That would avoid what Ondrej suggests being the cause of your troubles…

HTH !
If you can't script/program it, it's no good at all !
  • Quick Links