I wrote a very simple script wich is making a progressive fade out on a layer (alpha value getting down slowly automaticaly). It's working correctly, but I have to restart the module every time I want to use it.
the easiest way to built this module is to modify the crossfader(master) module :
go to the PeriodicalEvent bloc then change every occurences of:
Code: Select all
modul8.getValue ('ctrl_master_crossfader_slider',0)
to
Code: Select all
modul8.setValue ('ctrl_layer_alpha',pos,0)
the result should be:
Code: Select all
if run :
if sec > 0 :
pos = modul8.getValue ('ctrl_layer_alpha',0)
inc = (elapsed / sec) * dir
pos += inc
if pos > 1 : pos = 1; run = 0
elif pos < 0 : pos = 0 ; run = 0
elif dir == 1 : pos = 1 ; run = 0
else : pos = 0 ; run = 0
modul8.setValue ('ctrl_layer_alpha',pos,0)
then go back to the visual editor and change caption for <<A and >>B buttons to 0% and 100% for instance.
this module is great coz you can set a fading time in seconds
caution!! the default fade time in the module is set to 0seconds so if you want to set a minimum time for your default fading time, go to the script in the init block then change
to
3 seconds here for instance
when you change you'll notice that the new default fading time value doesn't match displayed values. You gotta add this script at the end of the script in the init block:
Code: Select all
module.setValue ('secFader',0,sec)
module.setValue ('sec',0,sec)
a last important thing is to go back to the visual part and check the
layer contextual chekbox (or else your fade process will stop when you focus on another layer)
i just uploaded the module if you want to see changes and check you did everything right go to the public library and check for the Alpha time fader(alpha) module
enjoy Python!
