PDA

View Full Version : Child Particles following Parent Particles? Thinking Particles


MasterDomino
11-13-2009, 06:01 PM
Hello everyone.
I am kind of new to this and I have a little problem here with a Thinking Particle setup.
I am creating some particles that are floating around the scene, but I would like to have some additional children of these very particles which keep the position of their parents.

Then I would like to put a noise on their (children) y-axis, so that they are kind of going up and down while still following their parents.

The problem is that I don't know how to produce particle-children that stay with their parents. In fact I don't even know how to produce children without killing the parents at the same moment. (whenever I change the particles to a new group, the old one dies...)

I cannot work around that by putting a y-axis-noise on the parents themselves, because the parents influence eachother and as soon as I move their y-position they fly all over the place and don't stay in one plane (which would be necessary).

So the only solution I see would be using child particles that follow their parents.

Can anybody help me with that?

Thank you in advance!

MD

Srek
11-14-2009, 11:17 AM
There is no parenting mechanism in TP so you ahave to take care of that by yourself.
Take a look at my TP Spawning Emitter preset to see how you can create new particles from existing ones. What you need additionaly is an integer data field where for each child you store the particle ID (thats the value PPass puts out) of the parent you used to create it.
Parents and children should be in different groups to make this easier.
Then you use PPassAB with the parents and children and use the particle ID to match up children with parents (read the ID stored in the child and compare it to the iteration value of the parents). If they match use the parents position to modify the child with PPosition follow or a similar setup. To get your bobbing movement mayby simply vary the Y value of the follow position with a turbulent noise.
Hope this helps
Björn

MasterDomino
11-16-2009, 11:48 AM
Hi Björn,

thanks a lot for your answer.

I managed to create particles from other particles now, but I am afraid I do not entirely understand how to do the "ID Storing and comparing" part.

How exactly do I connect the ID of the parents with the child particles?
I mean, I know I get the ID value from the "index" output of the P Pass node, but then how do I associate this value with it's child particle?

And what do you mean by "iteration value of the parents". Where do I get this and why do I need this?

Thank you in advance!

MD

Srek
11-16-2009, 01:57 PM
You need to create a connection between two otherwise not related particles. Since TP does not offer a direct solution for this you need to do it by hand.
You need to create a data channel for the particle in which you can stor the ID of a different particle (the one you want it to connect to). The ID can be either the index or the value PPass gives you via the particle output port.
To check if two particles are connected you need to use PPassAB and compare the stored id within one particle with the ID of the second particle. If they are identical you can activate your setup with this value.
You will need to come to terms with quite a bit of internal TP stuff to realy make use of this

Cheers
Björn

MasterDomino
11-17-2009, 02:50 PM
Wow! Sweet, now I got it working.
Thank you very much, Björn! That's great.

I didn't know about custom data channels until now, that's what I was confused about. But now it works like a charm. Runs a bit slow, especially once you add the per particle y-noise, but at least it works!

Thank you again,

MD

MasterDomino
11-17-2009, 05:14 PM
Okay, having a closer look now there are 2 problems remaining.

The first one is caused by my lack of understanding of deeper maths...
The child particles are bopping up and down on the global y-axis now, but I would actually like to have them bop up and down their local y-axis.
I do know the alignment of the parent particles and I do know their position. How do I need to multiply, add, divide or whatnot these two informations to be able to then put the noise on the resulting local y-axis, so I can feed this resulting information into the "follow position" input of the PFollow Node?
(I hope this explanation made sense, if not I could also upload a screenshot of this part of the setup).

The second one is really strange.
The ticks of the child particles show up and behave as desired in the viewport (the y-axis problem aside), also showing the correct color of the group, but when I try to assign a geometry to these particles, the geometry does not show up.
Also, when I change the View Type from ticks to Flakes the ticks disappear, but no flakes are visible. The same with all the other view styles except ticks.
Is this a bug? Or am I doing something wrong? Why does the geometry not show up?
When I assign the geometry to "All", it shows only up for the parents, not for the children.

Thanks in advance!

MD

Srek
11-17-2009, 06:16 PM
The first part can be resolved with some preset xpresso node you can find in the X-Pool. They allow you to easily translate vectors and points from local to global space and vice versa. You will need to create a complete matrix from the particles alignment and position though (the alignment only holds the rotation and scaling, not V0).

The second question is hard to answer without having the scene, maybe there is a problem with the particle scale or the particle group assignment in the geometry objects.
Cheers
Björn

MasterDomino
11-18-2009, 10:58 AM
Thank you Björn,

the y-axis problem is fixed now.
About the other problem I am quite clueless.
It still doesn't render, I don't know why, I couldn't find anything wrong.

I created a test file now that demonstrates the problem. Maybe somebody is able to figure out what's going on. In this testfile only the Box and the Flakes view type do not work. All the other ones work. But the rendering of the geometry itself does still not work.

Would be great if somebody could have a great look at this!

Thank you in advance!

MD

P.S.: The file was created in Cinema 4D 11.5, on OS X, in case that is of any help.

Srek
11-18-2009, 01:09 PM
In the PStorm that creats the children you set particle size to 0
Cheers
Björn

MasterDomino
11-18-2009, 01:21 PM
Oh my gosh...
Sorry, that was really stupid of me.
Thank you for being patient with me and having a look at the file. I really appreciate it!
Still learning all this stuff. I am actually wondering why I put down the size to 0 in the first place...

Thank you again!

MD

Srek
11-18-2009, 02:10 PM
I'm pretty sure you mistook it for the emitter size.
Don't worry about this kind of stuff to much, it happens regularily to me as well ;)
Cheers
Björn

CGTalk Moderation
11-18-2009, 02:10 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.