Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Understanding Particle Emission Rate for Coding a Plugin

Engaged ,
Nov 09, 2021 Nov 09, 2021

Hi gang;

 

I am coding a particle plugin using the SDK and I am having difficulty understanding how particle emission rate is done such as that used in the Particle Playground plugin, CC Particle World and CC Particle World 2.

 

Specifically, I want to know how they are able to specify an emission rate and then keyframe it to 0, but have the exisiting particles continue to live.

 

I know this depends greatly on how you've set up your system but it would seem to me you'd have to add up all the exisiting particles emitted from every frame up until the emission is keyframed to 0.

 

Anyway, any suggestions or tips would be highly appreciated!

 

Thanks,

-Richard

TOPICS
SDK
248
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2021 Nov 09, 2021

Not sure what specifically are asking, but particles simply have a pre-determined evaluation/ life cycle. How you compare that against your own time code is entirely up to you. All that is required is for the particle to somehow carry this attribute and have a way of being checked individually based on its internal ID or hash.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 09, 2021 Nov 09, 2021

Hi Mylenium!

 

Thanks for your reply. Let me see if I can give a simple example.

 

Let's say I make a comp with 100 frames. I emit 1 particle per frame and I have a total of 100 particles so if I let it run, it will emit one particle per frame.

 

Now at frame 50, I will keyframe my emission rate from 1 to 0. Unfortunately, this will also affect all the previous particles that have been emitted so if there's 50 onscreen, they will all disappear. This is the part I don't understand how the integrated particle plugins do it.

 

I am using a frame-based approach so I believe I don't need arrays (from my undestanding).

 

I guess it's the keyframing part that affects it in a way I am unsure how to approach. To check if the emission rate changes over time, it sounds like I have to check the (possibly keyframed) emission rate at every frame from 0 to the current frame, and add them together to get the current total so far. It sounds like I am overcomplicating thing though?

 

Does this make sense?

 

Richard

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 09, 2021 Nov 09, 2021
LATEST

I guess it's the keyframing part that affects it in a way I am unsure how to approach. To check if the emission rate changes over time, it sounds like I have to check the (possibly keyframed) emission rate at every frame from 0 to the current frame, and add them together to get the current total so far. It sounds like I am overcomplicating thing though?



Hi Richard

 

That's correct, you need to do this because the plugin is a simulation and values need to be tracked over time. Caching the particle data as it's generated in sequence data will help with performance, rather than naively recalculating all the previous data every single frame. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines