Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  accessing BluePrint parameters via script
#1
Hello,

On ObiFluid, I would like to access and change the Blueprint parameters via script, and also even change the Blueprint assigned to an emitter as well. 

Can you please give a simple example ? 

thnk you.
Reply
#2
(10-11-2023, 12:47 PM)CosmosST Wrote: Hello,

On ObiFluid, I would like to access and change the Blueprint parameters via script, and also even change the Blueprint assigned to an emitter as well. 

Can you please give a simple example ? 

thnk you.

Hi,

To change blueprint parameters you just do:

Code:
blueprint.surfaceTension = newSurfaceTension;

Same with all other parameters. Note that changing blueprint parameters will only affect particles emitted after the change. Existing particles will not have their parameters affected.


To change the emitter's blueprint you just do:

Code:
emitter.blueprint = yourBlueprint;

Note this will reset the emitter because blueprints might have a different capacity: all existing particles will be destroyed, a new particle pool will be created (its size determined by the new blueprint capacity), and emission will start over again.

To change the properties of existing particles at runtime, you do that directly on a per particle basis using the Particles API.

kind regards,
Reply
#3
Thank you !
Reply