Share

Setting explosion start and end times for Fire_Effect

The start and end spinners in the Explosion Setup dialog for Fire-Effect effectively install keyframes and set times and values for them in the controller for phase. You can achieve the same effect by manually constructing a phase controller and its keyframes. In the following example, the start and end times are set at 20 and 75:

EXAMPLE

   c = fire_effect density:20 outer_color:red
   -- to set up a new phase controller like the setup dialog does:
   -- make and set the controller
   pc = bezier_float ()
   c.phase.controller = pc
   -- add key 1 at 20 & set properties
   k = addNewKey pc 20
   k.value = 0
   k.inTangentType = #slow
   k.outTangentType = #fast
   -- add key 2 at 75 & set
   k = addNewKey pc 75
   k.value = 300
   k.inTangentType = #slow
   k.outTangentType = #fast
   -- or, to change times if the keys are already there:
   c.phase.keys[1].time = 20
   c.phase.keys[2].time = 75

Was this information helpful?