Page 1 of 2

how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 10:02
by Peter Wassink
i would like to make a custom panel action that fades out the layer in a fixed number of frames.
i'm looking for a direct 1 click solution without having to set the fxstack fade transistion FX each time.

so for instance a 4 frame fade out would give me this:
fade-out.png
fade-out.png (25.14 KiB) Viewed 14077 times
So you would be on the last frame, click the button and the layer would get reduced capacities of 20 40 60 and 80% for the last 4 frames

i want a similar button for fade in and maybe a 5 frame variant.

i thought this could be done relatively easy using the action menu, so without scripting, just using a few script commands but i'm stuck.
how do you command a 20% opacity reduction?

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 10:37
by Peter Wassink
when i use this command: tv_RectFill x1 y1 x2 y2 [cx cy] [button]

by setting: tv_RectFill 0 0 1920 1080
i get a filled square... yeah!
(its easier then i thought actually, i should have dived into this earlier, its kind of fun.)
but now i want to control its opacity and also erase with it instead of coloring with it.

how do i syntax that?

do i need tv_areainit to first set opacity?

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 11:07
by Peter Wassink
in the tvpaint wiki i don't understand this part:
tv_RectFill x1 y1 x2 y2 [cx cy] [button]

Draws a filled rectangle in the current image in the current layer. The x1 y1 and x2 y2 arguments indicate the positions of the top left and bottom right corners of the rectangle respectively. If color range or opacity mapping is active,
this:
"If color range or opacity mapping is active"
how do i set the opacity for the fill?

and also i'd like to erase with the rectangle, so i guess i'd have to apply it with "button 1"?

but it doesn't seem to work

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 12:05
by slowtiger
I'm lazy, so I cut that layer to have the last frame as a new layer, add an empty frame, now stretch this 2-frame layer to the desired fade length with "interpolate".

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 12:11
by Peter Wassink
slowtiger wrote: 15 Jun 2021, 12:05 I'm lazy, so I cut that layer to have the last frame as a new layer, add an empty frame, now stretch this 2-frame layer to the desired fade length with "interpolate".
Alas, this doesn't work with content on the layer.

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 13:51
by Svengali
I've used a custom FXStack effect that works for both fade in and fade out in 8 frames. I created a button (using the FXStack Bin option) that automatically loads the FX Stack window with the custom FXstack effect.
Then I choose Fadein8 or Fadeout8, and reposition the two keys (which can be adjusted to any length fade), test it, apply it and close the FX Stack window. The Speed Profile is handy if I want the fade in or fade out to have a different pace.
FadeIn-FadeOut.png
FadeIn-FadeOut.png (54.74 KiB) Viewed 14039 times
sven

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 14:08
by slowtiger
Peter, are you sure it doesn't work? It does here all the time!

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 14:58
by Peter Wassink
slowtiger wrote: 15 Jun 2021, 14:08 Peter, are you sure it doesn't work? It does here all the time!
yes, i didn't explain clearly... i need to fade out animated content not a still image.
your method works if you then turn stencil on and clear the bottom layer.
those are all extra steps i was looking to avoid.
but i could try and see if i can get all these steps inside a custompanel action.

i was just hoping someone would tell me something like:
use this command: tv_setthecurrentframeopacitytothispercentage

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 15:05
by Peter Wassink
Yes, i thought about this approach but it would be nice to get rid of this step:
Svengali wrote: 15 Jun 2021, 13:51and reposition the two keys
as well.

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 15:38
by Peter Wassink
trying to built a custom action using Markus approach

i get stuck at trying to stretch the layer:
i think i should use this command: tv_layerstretch

but the wiki does not give me example of how to use it...
script.png
script.png (6.18 KiB) Viewed 14002 times

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 16:37
by slowtiger
Ah! Of course, animated content is different.

I remember a project once where I had to do a lot of fades, all of the same length fortunately. So I created a frame filled with colour, extended this to make a fade, then later placed this at the right frame and used as a mask on the animated layer, selected frames, hit delete - done.

Speaking in general, being able to script fades would be really nice. I'm thinking of the old technique of animating with multiple crossfades. There was a diagram for this somewhere in the net ... think of Frédéric Back.

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 19:26
by D.T. Nethery
slowtiger wrote: 15 Jun 2021, 16:37

Speaking in general, being able to script fades would be really nice. I'm thinking of the old technique of animating with multiple crossfades. There was a diagram for this somewhere in the net ... think of Frédéric Back.
This ? -- https://one1more2time3.wordpress.com/?s=dissolves

Re: how would you do this? a one click fade out button.

Posted: 15 Jun 2021, 21:11
by slowtiger
Yes, exactly! (I was searching the wrong blogs.)

Re: how would you do this? a one click fade out button.

Posted: 16 Jun 2021, 10:33
by Xavier
As for me, I would rather add a new layer that darkens with the fade. Easier to do than to modify the actual layer.

Re: how would you do this? a one click fade out button.

Posted: 16 Jun 2021, 12:24
by Peter Wassink
Xavier wrote: 16 Jun 2021, 10:33 As for me, I would rather add a new layer that darkens with the fade. Easier to do than to modify the actual layer.
Well yes, but i need to crossfade. So there is no way other then to gradually erase the current layer.

i would love for it to be possible to have a new type of layer, like Photoshop's layer-fx
Where you could create a fade layer with for instance erase blend mode that would only act upon a specific layer/group (or folder... in the future)
this could allow a crossfade to be non-destructive!