light on/off


#1

l want light flashing on/off with expression on time how to do that …l am a big zero on expression thx again


#2

To make a light blink every frame you could do this:

if ((time%2)==0){
spotLightShape1.intensity=0;
}

else {
spotLightShape1.intensity=1;
}

or better yet:

spotLightShape1.intensity=time%2;

I am not exactly sure if time is in frames or not. Regardless, this is basicly what you do. You might be able to get more control if you use the trax editor and create a clip.

Good luck whatever you decide to do.

ww


#3

if you want it blinking emplehs solution works (the short second one only if it has to blink each frame which i dont guess :slight_smile:

with the (time%x) you can enter any number for x and it will go on only every x frame…

if you want the light to flicker like random bright/dark i suggest using a fractal teture for it, because that works without scripting like a charm:

  • connect the out red color value from the fractal2D to your intensity
  • now animate the fractal by entering:
    =time
    into the field where you animate the texture. if you want it faster enter =time*x and for slower =time/x where x is the speed increase/decrease you want
  • now see the change.

good thing:
you can now use all the parameters that the fractal hast to tweak your result

if you want brighter light or dimmer: change the color gain value from the fractal… default is white whic means you have values between 0 and 1… you can change it to anything…

note:
that can be used to randomly move objects as well… just connect the out colorR value to translateY from an object and se what happens

cheers

alexx

edit: and just to mention…
if you want it regularely to turn on and off… just create a stepped keyframe animation and repeat it post infinity… :slight_smile: sometimes so easy


#4

thx empleh but its not exactly what l want is more light in a christmas tree when they flash on/off the one you send me is more she go to intensity 2 and after she return to 0 to return to 2l want more a random light
ths and l hope l am clear


#5

if you tweak the fractal values to black and white only with no gray you well get your random blinking as well…


#6

thx alexx


#7

not sure if is this what u want…
is random… is blinking … is badly easy

pointLightShape1.intensity =rand(0.4,2)


#8

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.