Hello.I found this topic and am trying to customize it.
http://forum.tvpaint.com/viewtopic.php?f=21&t=6526" onclick="window.open(this.href);return false;
I want to toggle opacity 100% 50% and 25%.
And if layer opacity is not 100%, 50% or 25%, it changes it to 100%.
This works fine
tv_LayerDensity
LayerD = result
IF CMP(LayerD, "100")
tv_LayerDensity 50
ELSE
IF CMP(LayerD, "49")
tv_LayerDensity 25
END
IF CMP(LayerD, "24")
tv_LayerDensity 100
END
END
but, I don't know how to make another Else clause that checks if layer opacity is not 100%,50% and 25%.
What should I do?
I thought this will work, but it didn't. it only changes layer opacity to 100%.
tv_LayerDensity
LayerD = result
IF CMP(LayerD, "100")
tv_LayerDensity 50
ELSE
IF CMP(LayerD, "49")
tv_LayerDensity 25
END
IF CMP(LayerD, "24")
tv_LayerDensity 100
END
tv_LayerDensity 100
END
Layer Opacity toggle
Re: Layer Opacity toggle
Here is some different ways
#1 Using EXIT script command
#2 nesting conditional test correctly in If Else
#3Tjeck first with &&(AND) if density is not 100 49 0r 25
Kind Regards Mads
#1 Using EXIT script command
Code: Select all
tv_LayerDensity
LayerD = result
IF CMP(LayerD, "100")
tv_LayerDensity 50
ELSE
IF CMP(LayerD, "49")
tv_LayerDensity 25
EXIT
END
IF CMP(LayerD, "24")
tv_LayerDensity 100
EXIT
END
tv_LayerDensity 100
END
Code: Select all
tv_LayerDensity
LayerD = result
IF CMP(LayerD, "100")
tv_LayerDensity 50
ELSE
IF CMP(LayerD, "49")
tv_LayerDensity 25
ELSE
IF CMP(LayerD, "24")
tv_LayerDensity 100
ELSE
tv_LayerDensity 100
END
END
END
Code: Select all
tv_LayerDensity
LayerD = result
IF CMP(LayerD, "100") == 0 && CMP(LayerD, "49") == 0 && CMP(LayerD, "24") ==0
tv_LayerDensity 100
ELSE
IF CMP(LayerD, "100")
tv_LayerDensity 50
END
IF CMP(LayerD, "49")
tv_LayerDensity 25
END
IF CMP(LayerD, "24")
tv_LayerDensity 100
END
END
Re: Layer Opacity toggle
All works fine! thank you Mads.
Re: Layer Opacity toggle
Very helpful scripts! Thanks a lot .
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)