particle emitter expression

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2009   #1
particle emitter expression

hi,
i know very little about scripting and need a little help and have been trying to learn more but i am stuck on something that seems like it should be pretty simple. i just want to be able to emit a number of particles every 5-10 frames or so to give a looping effect of smoke puffing out of a chimney. i could keyframe it but i think it would be possible and easier to script it, i'm just not sure how. so i was wondering if anyone might be able to help me out. thanks a lot.

jeff
 
Old 10 October 2009   #2
For something that simple, just keyframe the emitter going on aand off once, then in the graph editor select the animation keys and set the keys to post cycle>infinity from one of the drop down menus.

Chris
 
Old 10 October 2009   #3
that's is perfect. that's just what i needed. i knew it was something simple like that. thanks a lot man.
 
Old 10 October 2009   #4
Yep... for an effect like that, keyframing the emitter is the way to go..

Also, remember that expressions get evaluated every frame, for something simple like this you would probably wont even notice anything, but the more expressions used and the more complexe these get.. the more slower your sim would be.

if you want to use expressions anyway, try this:
if (frame %10)
   emitter1.rate = 0;
   else 
   emitter1.rate =100;


That would set the emitter rate to 100 every 10th frame.. while on the other frames the rate is 0... hope that helps

Last edited by TheRispo : 10 October 2009 at 01:46 AM.
 
Old 10 October 2009   #5
Using Risco's expression, you can add some randomisation to it.


int $randRate = rand(50,100);
if (frame %10)
    emitter1.rate = 0;
    else 
    emitter1.rate = $randRate;



Originally Posted by TheRispo:
if you want to use expressions anyway, try this:
if (frame %10)
    emitter1.rate = 0;
    else 
    emitter1.rate =100;


That would set the emitter rate to 100 every 10th frame.. while on the other frames the rate is 0... hope that helps
 
Old 10 October 2009   #6
if you want a more natural emission. Maybe try noise

emitter.rate = (noise(time * 2) + 1) * 50;

change the 2 to speed up or slow down the rate change
the 50 is just a multiplier on the total rate
__________________
pauljewell.com
 
Old 10 October 2009   #7
or even


 float $rate = 10;
 emitter.rate = abs((sin(time*2))*$rate);
 
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 10 October 2009   #8
Originally Posted by apoc519: if you want a more natural emission. Maybe try noise

emitter.rate = (noise(time * 2) + 1) * 50;

change the 2 to speed up or slow down the rate change
the 50 is just a multiplier on the total rate


instead of offsetting with the "+1", you can use abs() which will return the absolute value.

emitter.rate = abs(noise(time * 2)) * 50;




~Ilan
__________________
my amazing tumblr
 
Old 10 October 2009   #9
Originally Posted by Wick3dParticle: instead of offsetting with the "+1", you can use abs() which will return the absolute value.

emitter.rate = abs(noise(time * 2)) * 50;




~Ilan


you dont always want to use abs on sin or noise because it will break the tangents. open up graph editor and enable view/show results to see the actual curve that is generated.
__________________
From Russia, with love @ stooch.tv
 
Old 10 October 2009   #10
Originally Posted by stooch: you dont always want to use abs on sin or noise because it will break the tangents. open up graph editor and enable view/show results to see the actual curve that is generated.


No doubt, that you don't want to use it all the time. But we are discussing smoke emission from a chimney. If I were animating an object's position using noise, I would consider the sharp tangents; but that isn't quite the case here.

~Ilan
__________________
my amazing tumblr
 
Old 10 October 2009   #11
Originally Posted by stooch: you dont always want to use abs on sin or noise because it will break the tangents. open up graph editor and enable view/show results to see the actual curve that is generated.


Thats handy to know.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 10 October 2009   #12
Originally Posted by Wick3dParticle: No doubt, that you don't want to use it all the time. But we are discussing smoke emission from a chimney. If I were animating an object's position using noise, I would consider the sharp tangents; but that isn't quite the case here.

~Ilan


I dont care what you use it for, just posting a tip that might be useful for someone if they were not aware of the effects on tangents.
__________________
From Russia, with love @ stooch.tv
 
Old 10 October 2009   #13
Originally Posted by stooch: I dont care what you use it for, just posting a tip that might be useful for someone if they were not aware of the effects on tangents.


awesome, thank you.
__________________
my amazing tumblr
 
Old 10 October 2009   #14
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:57 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.