Jump to content

Welcome to INSYDIUM ONLINE

The place to talk about X-Particles and Cycles 4D

cbowyer

Attracting spawned particles to their moving source particles.

Recommended Posts

I am trying to expand on a Cineversity tutorial that came out a couple of weeks ago.

I have an xpEmitter constrained to follow a spline using a force field. At 90 frames I have each particle spawn but I'd like the spawned particles to stick with their respective source particles, forming a shape around each source particle (similar to the way cover target works in the old shape shift x-particles tutorial).

Can't seem to get the cover target approach to work though.

Any suggestions would be welcome!

XP multicolour particles_0001.c4d

Share this post


Link to post
Share on other sites

Thank you for your reply teknow, That is a great tutorial, but its not quite the look I am after. At the moment I am generating a trail of particles behind each source particle.

I'm trying to spawn a "sphere" of particles around each source particle and have each sphere of particles remain centred around its respective  source particle as the source particle moves along the spline.

Share this post


Link to post
Share on other sites

Here's some clumping. Maybe you can tweak this file to get what you want.

Tweaking xpDynamics gives big differences.

Clumping.c4d

Edited by teknow

Share this post


Link to post
Share on other sites

ok, you have to use a little expresso, a couple of nulls  and target instead of cover and separate things for each original particle.

This is how it works:

What expresso does is attach a null to each original particle position while they move that act as a target for spawns.

Now put a stacked question asking for age in range as you did - but in addition for particle index  and do this for every original particle index.

I skipped the actions as you can activate modifiers directly in the question. Each question gets a spawn modifier of it´s own now and each spawn has it´s own emitter - important  - that has a unique group set. Within spawning, I set these emitters to inherit original particles colour so you clearly see which spawns belong to which particle and switched on HUD display for particle index of original particles . But if you want it random as set before, simply uncheck this and you can set any colour setting within any group as you like.  Last step is same number of target modifiers - target is the corresponding null and limited to group spawns  are coming from the particle the null is attached to.  This ensures the spawned particles are trying to follow their origin. Play with attractor forces and spawned particles speed to get the look you want. Another thing to consider, you are doing a continuous spawning that will raise amount of particles around each travelling particle over time to a huge amount ( scene length 1000 frames !)

So I would think about a fixed amount by checking spawn only once in each spawn modifier and set spawn  number to a value you like as a particle cloud around the origins....

 

XP multicolour particles_0001.c4d

  • Like 1

Share this post


Link to post
Share on other sites

just saw if I use spawn once pops particles in, generating over time is much smoother. So here´s how I´d do that - just limit max particles for each spawning emitter . Needs one question to determine amount that goes to every spawning emitter .... id greater than x -> direct action life -> kill particles .

 

 

XP multicolour particles_0001limited spawns.c4d

Edited by Lothar
  • Like 1

Share this post


Link to post
Share on other sites

oh - just read you want them to form specified shapes. No problem, same principle, just use some cover mods in time to reach target mode. You can delete target modifiers if you want, they are not really needed but keep particles in a range while being born and filling the objects ...

XP multicolour particles_0001forming objects.c4d

Edited by Lothar
  • Like 1

Share this post


Link to post
Share on other sites

some more and filling the volume ... just to show what you can do

and if you want to do a shape shift - will work as well, just another target below the corresponding null and follow the tut for every null concerned and perform that shape shift on the appropriate spawning modifiers - that´s where questions and actions for shape shift have to go of course.

 

XP multicolour particles_0001forming objects_volume.c4d

Edited by Lothar
  • Like 1

Share this post


Link to post
Share on other sites

finally last one as I think if you are referring to morph tutorial, this might be rather complex to you.

Now every particle is spawning and forms a cube , keeps this shape for 90 frames and then changes into a new shape. Kept first one as a cube. All this while mother particle is travelling along it´s path.

Note , you can use the unstick from source in every question so you need it only once, only the modifiers need to be duplicated. That I put them as a child is just for my better orientation when switching targets and not necessary at all.

XP multicolour particles_0001 objects morphing.c4d

  • Like 1

Share this post


Link to post
Share on other sites

zefixsacklzementhallelujaglupvareckts  just noticed that it seems to be a new R21 feature that non wired expresso ports are being resetted upon saving or loading. So all the files before won´t work properly unless you add a constant node to all expresso nodes that sets the particle index correctly like this :

 

XP multicolour particles_0001forming objects.c4d

expresso correction_.jpg

Share this post


Link to post
Share on other sites
25 minutes ago, cbowyer said:

Wow, many thanks Lothar. I am going to spend the morning viewing these files.

yes, but don´t forget to add all the constant nodes first within the expesso tags.  Only the file in the last post of mine has set them as a sample.

All open index entries have been resetted to 0 by saving the files I had to learn .... so they have to be fixed by wiring to constant nodes giving the correct values from 0 to 5 within the apropriate expresso tags ...

Edited by Lothar

Share this post


Link to post
Share on other sites
8 hours ago, teknow said:

How did you get the particle index number to display?

Emitter-> Display -> HUD tab -> show particle ID

Just be careful if you have many particles in the scene. It is quite heavy for the viewport them. If you need to know ID of  a specified particle zoom in to it before activating HUD display. And attention - it is ID that is displayed, not index. As long as no particles are killed since emission , Index is just ID -1 If some particles died there is a reindexing process and you can´t say what is index from ID any more as ID never changes, but index does. This way it is wise if you want to access particles by index, take care that they live to end of scene and if you need them to vanish do a group change rather than killing...

pid.jpg

Edited by Lothar
  • Like 1

Share this post


Link to post
Share on other sites

Btw - as you are talking about objects to be formed, you can as well align those objects along travelling path . To do so, go to primary emitter -> extended data -> general data, check use rotation and set rotation mode to tangential, persist orientation. Now within expresso pull out rotation from get data node and wire that to global rotation of null. Aligned 🙂

 

 

XP multicolour particles_0001forming objects_algned.c4d

Edited by Lothar
  • Like 1

Share this post


Link to post
Share on other sites

Lothar, You are a veritable wellspring of knowledge and wisdom! Thanks so much for sharing.

To dissect this message area is like a home study course on Spawning.

Share this post


Link to post
Share on other sites

I see what you mean about requiring the constant. That seems odd that the input doesn't remain persistent after you quit.

Do you think that's an xpresso bug in the Get Particle Data node?

My file is coming along nicely and my knowledge of x-Particles deepening. I wish I could attach a beer to this post!

Share this post


Link to post
Share on other sites
39 minutes ago, cbowyer said:

Do you think that's an xpresso bug in the Get Particle Data node?

 

I filed a bugreport to check this up 🙂

wonder if it is R21 relevant or only bug. Did not happen ever before to me and in a comparison, cinema native setup unwired ports keep their values, but might be a R21 API/SDK  issue as well...

Nevertheless I think I should remember this and never keep open ports with values that are not default ones ...

Share this post


Link to post
Share on other sites

looks like passed - it is working 🙂

I have left in the generator change as well but not sure if this has been intended to be in, maybe an attempt by cbowyer to solve his problem, but did not of course. But could be meant as an optical signal for that emission and shape forming as well. It just does not contribute to the "spawn and spawns follow origin and form shape" problem at all - just to make clear. 😉

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×