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: 1062
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

GEORGE : Layer selection

Post by schwarzgrau » 16 Oct 2016, 14:01

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.
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq 22HD
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq Companion 2
SCHWARZGRAU.COM

Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary » 14 May 2019, 10:23

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: 944
Joined: 01 Apr 2014, 07:07
Location: Paris, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano » 14 May 2019, 10:35

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?
Storyboard, animation and design work : http://nathanotano.tumblr.com/
As I'm highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios. Please don't hesitate to contact me!

Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary » 14 May 2019, 10:59

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: 944
Joined: 01 Apr 2014, 07:07
Location: Paris, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano » 14 May 2019, 13:05

Nice :)

You can also create a function for the whole process in one command :) and share it here hehe
Storyboard, animation and design work : http://nathanotano.tumblr.com/
As I'm highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios. Please don't hesitate to contact me!

Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: GEORGE : Layer selection

Post by Gary » 14 May 2019, 16:03

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: 67
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: GEORGE : Layer selection

Post by Hironori Takagi » 15 May 2019, 04:09

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.0.9, Windows10 Pro, DELL Precision M3800 / Mac OS 10.15, Apple Mac Pro(Late 2013)

User avatar
NathanOtano
Posts: 944
Joined: 01 Apr 2014, 07:07
Location: Paris, France
Contact:

Re: GEORGE : Layer selection

Post by NathanOtano » 17 May 2019, 18:22

Nice thanks :)
Storyboard, animation and design work : http://nathanotano.tumblr.com/
As I'm highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios. Please don't hesitate to contact me!

Post Reply