Standard layer attenuation percentage

This section is dedicated to the feature & improvement requests (be sure what you are asking does not exist yet in TVPaint Animation ;) )
User avatar
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Standard layer attenuation percentage

Post by Lukas »

I also did an attempt to get the way I like it;

Code: Select all

//{
tv_readUserString "LayerAttenuation" "State" "NewLayerAttenuationValue"
NewLayerAttenuationValue = result
tv_display "layerattenuation" "value" NewLayerAttenuationValue
//}

//{ SHIFT change value and exit
tv_getModifiers
PARSE result shift ctrl alt
IF CMP(shift,"1")==1
    tv_ReqNum NewLayerAttenuationValue 0 100 "Layer Attenuation %"
    NewLayerAttenuationValue = result
    IF CMP(NewLayerAttenuationValue,"Cancel")
        EXIT
    ELSE
        tv_writeUserString "LayerAttenuation" "State" NewLayerAttenuationValue
        tv_display "layerattenuation" "value" NewLayerAttenuationValue
        EXIT
    END
ELSE
    tv_readUserString "LayerAttenuation" "State" "NewLayerAttenuationValue"
    NewLayerAttenuationValue = result
END
//}

//{
tv_Display
ShowState = result
tv_Display "LayerAttenuation"
PARSE result layerattenuation LayerAttenuationState LayerAttenuationValue
//}

//{ Toggle
IF CMP(LayerAttenuationState,off) || CMP(ShowState,All)
    tv_Display "LayerAttenuation" on
    tv_Display current
ELSE
    tv_Display "LayerAttenuation" off
    tv_Display all
END
//}
I replaced my 'Display all layers or just the current layer' shortcut with this one.

It basically assumes you ALWAYS have layer attenuation enabled, and it remembers the value over ALL projects. You can change the % of it by pressing the button with SHIFT. So if you don't want attenuation, just use 0%.

For some reason there's a bug the first time you press it with shift, but after that it works fine (forever and ever, even on new projects or when you quit). It probably has something to with reading a user string before it exists... But it's only once ever, so I'm fine with it this way. But if someone knows how to fix it, please let me know. :)
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Standard layer attenuation percentage

Post by Svengali »

Lukas wrote: But if someone knows how to fix it, please let me know. :)
tv_ReadUserString

tv_ReadUserString section line default

Reads a character string in the current configuration file. The section argument is the name of the section, and the line argument is the name of the line containing the string to be read. The default argument may be used to specify the string to be returned by default if the search line does not exist. All these arguments must be enclosed in double quotes. The character string is stored in the Result variable. This command may be used to read data stored using tv_WriteUserString in the current configuration file.

The first time you run the script, no attenuation value has been stored yet so you should include a DEFAULT attenuation value to be returned. After that, when you run the script it will read whatever has been stored from the previous tv_WriteUserString and the DEFAULT attenuation value will be always be ignored.

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Standard layer attenuation percentage

Post by Lukas »

Thanks for the help Svengali! I misread that part :) It works exactly like intended now.

- Click the button to hide/show other layers (with layer attenuation value, which will be remembered forever).
- Shift click the button to change layer attenuation percentage.
Attachments
LukasLayerAttenuation.png
LukasLayerAttenuation.png (7.78 KiB) Viewed 15503 times
LukasLayerAttenuation.tvpx
(76 KiB) Downloaded 1052 times
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Standard layer attenuation percentage

Post by schwarzgrau »

Thank you Lukas.
Maybe something for the contents sharing section.
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
User avatar
Lukas
Posts: 526
Joined: 14 Jan 2011, 11:15
Contact:

Re: Standard layer attenuation percentage

Post by Lukas »

schwarzgrau wrote:Thank you Lukas.
Maybe something for the contents sharing section.
Sure, I'll post it there.

edit: Here http://forum.tvpaint.com/viewtopic.php?f=11&t=8330" onclick="window.open(this.href);return false;
  • Lukas Sketch Panel
  • TVPaint Pro 11.7.3
  • MacBook Pro 2018 macOS Ventura 13.4.1 + PC Windows 10
  • Wacom Cintiq 27QHD + Wacom Intuos4
  • YouTube.com/@ClubBaboo
  • YouTube.com/@FrameOrder
User avatar
CartoonMonkey
Posts: 1087
Joined: 01 Jun 2007, 18:47
Location: Portland, Oregon
Contact:

Re: Standard layer attenuation percentage

Post by CartoonMonkey »

Thank you Lukas for this panel! It really should be built into TVPaint by default!
Essential!
Post Reply