Spreading Fire with Expressions

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  03 March 2013
Spreading Fire with Expressions

I am currently making a tool for my Final Major Project that takes an object in Maya, and spreads fire through said object using Maya fluids. I am currently looking into using emission ramps driven by expressions to spread through the object. What I need to know is, is there a way to drive the ramp without using the likes of time or frame?

The current expression I have driving the spread is:
float $speed = 0.25;
ramp2.colorEntryList[0].position = time*$speed;

This moves the colour on the ramp up until it is full. The problem here is that the spread is based on the current time and may start burning half way through the object. Is there any way of gradually increasing the position without using time or frame, so the fire can start, at for argument sake frame 50.

This might be a trivial question with a stupidly simple answer, but I feel I've stared at it for too long and need some outside input.

Also, if anyone has any better methods to spread fire in Maya I would gladly receive them!

Any help if greatly appreciated!
  03 March 2013
Generally you want to access the variable time at some point in an animating expression, if only to reset your own variables on rewind. I think the simplest thing to do if you want the effect to start at frame 50 is to use an if statement:

float $speed = 0.25;
float $t=0;
float $startFrame = 50;

if( time > $startFrame )
$t = time-$startFrame;

ramp2.colorEntryList[0].position = $t*$speed;

  03 March 2013
Thank you for the reply. I figured something similar in the end, guess I just needed to take a step back, do something else then go back to it! I am currently working on python functions being called with expressions overall making it easier for me to understand work with.

I was wondering if you could possibly help with my latest question:
Constant fluid integrity over varying Voxel Counts Constant fluid size over varying voxel counts

Thanks again, the help was appreciated.
  03 March 2013
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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
Society of Digital Artists

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

All times are GMT. The time now is 10:11 PM.

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