GEORGE : Layer selection Topic is solved

This section is dedicated to the feature & improvement requests (be sure what you are asking does not exist yet in TVPaint Animation ;) )
Post Reply
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

GEORGE : Layer selection

Post by schwarzgrau »

It would be pretty nice, if you could get the information which layers are selected in George. Also it could be pretty handy if you could select multiple layers in it.
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
Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary »

Bumping this request because some tools artists here have requested are entirely impossible without being able to detect multiple selected layers with George.
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano »

Can't you just run on all the layers with tv_layerinfo to check which are selected and put that in a list of variables to interact with? It's less handy that the command you want but such a command would be weird to use. How much variables would you get? How do you code that on your scripts?
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary »

I didn't realise LayerInfo had that info (in fact I didn't realise it could be called on a layer that wasn't the current layer). Thanks for the tip!

I suppose you have a point about how it'd be represented. I forget that George commands can only return simple data structures even though you can make tables/arrays yourself.
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano »

Nice :)

You can also create a function for the whole process in one command :) and share it here hehe
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary »

I have!

I'm sure there's improvements that could be made (like a better way to iterate over layers) but this does the job for me. Here's the function:

Code: Select all

FUNCTION get_selected()
    select_count = 0
    FOR id = 1 to 10000
        tv_LayerInfo id
        PARSE result layerDisplay layerPosition layerOpacity layerName layerType layerStart layerEnd layerPrelighttable layerPostlighttable selected x
        IF (CMP(selected,'1') == 1)
            select_count = select_count + 1
            selected[select_count] = id
        END
    END
    return selected
END
Also some sample usage:

Code: Select all

get_selected()
selected = result

FOR x = 1 to select_count
    tv_warn "ID"selected[x]
END
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: GEORGE : Layer selection

Post by Hironori Takagi »

The layerselection item in tv_layerinfo is not listed on tvpaintwiki, but it is described in the TVPaint 11 Documentation published last year.

https://www.tvpaint.com/doc/tvpaint-ani ... _layerinfo
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano »

Nice thanks :)
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Post Reply