George access to custom panel actions

A forum dedicated to George scripting questions
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

George access to custom panel actions

Post by spyderheart »

Hi All,
Is there is any George access to specific actions of a specific custom palette. For example say I want to create a dynamic menu using tv_listRequest where the menu is made up of all the actions of a palette where I store various brushes. It could be a very nice and fast tool-switching method for when you want to keep your screen clear of palettes. I could then map a shortcut to the george script and it whenever i hit that key I would have all the brushes of the chosen palette at the tip of my pen to be selected.
Any advice? I'm not seeing any relevant commands on the george wiki.
Perhaps there is a way to read the info from the config folder?

Thanks!
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: George access to custom panel actions

Post by Svengali »

One simple way to manage brushes assigned to buttons in a custom panel, without having to create a GEORGE script, is this:

1. Name your custom brush buttons panel something like MyBrushes.
2. Create one extra button in your MyBrushes Panel and name it ToggleBrushes.
3. In the ToggleBrushes button, set a command line using the bottom option, Tool Bar which when selected brings up a list of custom panels where you can select Toggle MyBrushes panel.
4. Save the button.
5. Finally, open the Configure Keyboard Shortcuts window and choose the shortcut key you want to use. Then in the right hand list find MyBrushes and assign the ToggleBrushes subcommand to your shortcut key, click OK.

Position the MyBrushes panel center screen and close it.

Now, when you hit the shortcut key, the MyBrushes panel will Toggle open. Choose your brush and either click on the ToggleBrushes button or hit the shortcut key to Toggle the panel closed again.

EXTRA NOTE:
Notice that you can create buttons to do all kinds of processes, MULTI-COMMAND processes, then store those buttons in a custom panel called Hidden. Each of these buttons can be assigned to their own shortcut key. You can leave the Hidden custom panel closed, only open it to add more custom buttons.

This technique is a bit like creating multi-step macros.

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
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Thanks @Svengali !
That is definitely a good alternative for a quick solution. However I am specifically trying to make use of the following aspects of tv_listRequest:
-The menu pops up exactly where the pen is
-You can hold down a key, the menu pops up, you hover over the option you want, let go of the key - selection was made! This means there was a single key press compared with key followed by click followed by key

I really like this slick "in and out", seamless way of calling various brushes or actions and keeping the interface clean.

Actually it's funny it should be you that replied. A while back I found your script LayerFinderPlus which I modified to make it lighter and only use the features I was interested in (just picking a layer quickly). So I've gotten to thinking that it would be great to select brushes that way too. Of course George has access to all the layer info in realtime making it much easier for layers. My question is how to make a similar menu that compiles all the brushes (or more generally - all the actions) of a custom palette.

I think this could also be a great built in feature. Say you could tell TVPaint "this palette is a pop up palette". Then the toggle hotkey for that palette would display it at your pen tip and you could select the option simply by hovering over it (sure, or click it... ) and letting go of the key. It could also arrange itself to be more like a radial menu.
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: George access to custom panel actions

Post by Svengali »

Hi David,
I see what you're trying to do - nice idea!

I don't know of a GEORGE command that can explicitly call a specific button in a specific custom panel (though that would be a welcome addition to some script writers). A slower, more labor intensive way to do it would be to explicitly store all tool info to individual files (in the case of custom brushes and animbrushes you would also have to store the graphics as well) or as User-Strings in the Config.ini file, or as lines in your script, then have your ListRequest test the user's choice and call a specific reload and a call to the tv_cmd Tool command of the tool info (and reload of the appropriate custom brush or animbrush file).

If you get it working please post a tvpx of it, I'd like to check it out. :D

You might take a look at a three button toolset I posted several years ago... could be helpful in working through your solution:

ToolHelp Custom Panel Button Set

In the interim, you could take what I suggested above and cut it down to TWO actions: A key press to open the MyBrush Panel and a stylus tap on the brush button of choice, by having each brush button include as its last command, a Close MyBrush Panel...

In another recent post in the GEORGE forum I was asking for a GEORGE command that would open a Custom Panel (like the Tool Bar button command). And such a GEORGE command could be even more useful if it would offer a parameter that would force the named custom panel to open at the cursor position... :roll:

I can dream, can't I?

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
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Thanks for pointing me to ToolHelp. I'll have some fun experimenting.

If I had unlimited time on my hands I might try to create a script that stores brush info in the userstring and then builds a menu based on that to use with tv_listRequest... but what I do have on my hands is a wacom tablet - and I've realized the radial menus that can be customized come very close to what I want (probably obvious to many who are reading). I've just connected the various wedges to my "Current Brushes" panel through the shortcuts. Then I can change the brushes on the fly using "Grab Brush" - Very adaptable to switching needs such as moving from sketching to inking.

If ever I do create a script that allows hover selection it will certainly show up here :)
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: George access to custom panel actions

Post by Mike »

Just to confirm there is no way to call an action of a custom panel via another action in the (or another) custom panel.
(When you edit an action, and go to "Set Keystroke", you already can NOT access to another action of a custom panel (like in the shortcut panel))

One of the reasons is to avoid creating a mini black hole:
A(ction) 1 calls A2 calls A3 calls A1 calls ... calls ... infinite loop -> boom!
TVPaint Team
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

That's an excellent point and no doubt the exact reason for the limitation. However I can't help but feel an infinite loop would be easy enough to detect upon confirmation of the action (when you click "ok").
Access to other custom actions in the keystroke list would be really useful for creating more adaptable configurations.

Might as well update here on my ongoing quest :)

My "on the fly" brush panel (where I use "grab tool" to store my 5 most used tools at any given time) has 5 brushes named A,B,C,D, and E. I also have a wacom radial menu that connects to these through their assigned shortcuts (ctrl+shift+A, ctrl+shift+B, ...etc) but let's leave that aside for now. To really make my custom actions useful I've also embedded a short george script that looks for a layer with the same name as the action and selects the layer if it finds one. So with a single click I can change the brush and automatically go to the layer where I want that brush to live.
This is all well and good until I want to change the brush stored in the action. Right click > Grab Tool will get rid of the embedded script that sets the layer. I have to open up the action and re-insert the george script, and possibly edit a variable to make sure it searches for the correct name. I don't really mind this but I'd like to create something more flexible, shareable, and more easily tweaked to one's own preferences.

Solution? Well, if we could trigger other actions via george AND george could see information about the button that called it (Action name, comment, panel name...), I could store the brushes in A,B,C,D,E and the create 5 more actions that are used to trigger the tool change and the layer selection.
One of the actions might be called "A_Sky". Then embedded george scripts inside of the action will know to look in the same panel for an action called "A" and then set the layer to "Sky" if it can). The tool and layer can always be edited simply by changing the name of the trigger action without needing to re-insert or edit george commands.

So i guess the request boils down to:
-Access to other custom actions (with caution about infinite loops)
-Built in variables that allow george to see the action name, comment, and panel name of the button that called it.

Also just want to say I know this is not high priority stuff. Just want to get these thoughts on record in case there is an overhaul of george and custom actions one day.
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: George access to custom panel actions

Post by Mike »

If in your action, you have 1 command for the tool and the other for your script:
_ edit the action
_ click on the first command (tool) to display the popup
_ select "Grab current tool"
It will replace the tool inside your action without having to set again your george script (it will do the same thing as "Grab tool" by right-clicking on the action)

//---

If you want to make customizable the layer name (or anything else), you can:
_ make 5 actions for your current 5 tools/scripts
_ below each one, you can make 5 actions which will configure the previous script (throught the config file) to manage layer name, ...
[A1] [A2] [A3] [A4] [A5]
[C1] [C2] [C3] [C4] [C5]

The C1 action will:
_ ask for needed info to the user (layer name for example)
_ store it inside config file with tv_writeuserstring command

When you click on A1:
_ the tool will be selected
_ then the script will get the needed value with tv_readuserstring command
_ process the value

You can store only the layer name, or add another parameters, or even make 1 config action per parameter.
TVPaint Team
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Nice solution. Thank you!
I think that would almost achieve what I'm after.

There is one glitch:
There are two methods of grabbing the current tool instantaneously:
A: right click the action and select "Grab Current Tool"
B: right click the action, select "Edit" and set a command to "Grab Current Tool"

Am I right in thinking that method B leaves out anything that depends on and inserted George command, while method A grabs everything? This would affect the use of paper, and tv_customMode (to erase only one color) for example. A and B give you different results for the same "Current Tool" when these are present, and I think A is the one we want - but it wipes out the other george script we need.

When choosing a command from inside the edit window, would it be possible to have one that behaves just as method A does, except instead of overwriting the entire action with the list of commands needed to replicate the brush, it inserts those same commands at that position in the list (instead of the one line that says " Tool: ") ? Any other commands in the list (such as the layer-seeking george script) would remain unaffected.

I think with that option we'd have it all :)
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: George access to custom panel actions

Post by Mike »

spyderheart wrote: 10 Jan 2018, 17:34 When choosing a command from inside the edit window, would it be possible to have one that behaves just as method A does, except instead of overwriting the entire action with the list of commands needed to replicate the brush, it inserts those same commands at that position in the list (instead of the one line that says " Tool: ") ? Any other commands in the list (such as the layer-seeking george script) would remain unaffected.
It seems easy ... but for your case :) when there is the same number of line to replace at the same position.
But on my side, I can't think like that, and in the code, moreover, each command line is totally independent of each other (there is absolutely no relation between each command).
_ the "Edit" option on the action button manage ALL commands inside
_ the options of each command manage only the command itself

A little explication why I will say 'no' for this way :) but I don't say that nothing can be done/think ... one day :)
TVPaint Team
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Thanks for the explanation.

I've made something that at least makes it as easy as possible to re-apply the missing script after right click > grab tool wipes it out. Also, you never need to edit or type anything to change your settings so that's a bonus too.

The custom panel is posted here: viewtopic.php?f=11&t=11183

Thanks to Mike and Svengali for their advice!
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Just thinking this could be pushed further if there was some code that would store just about any tool including paper and anim dependencies in the user string. That would eliminate the need to restore the layer connection (copy-paste embedded george) every time you change the tool.

Anyone know of anything like that? I see some tv_getX / tv_setX commands along with tv_brushInfo on the george wiki... Has anyone already put together some code that can save and store the entire tool in the user string and then code to reload it?

D
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: George access to custom panel actions

Post by Animationriver »

I can not understand one thing ... :D
Why do not you just make a video about such scripts. Why did you write all this ... It's just terrible ..
10 minutes and you're done ...
But you complicate what you need very many users.
I am sorry.
But scripts are very important!
Where are the video lessons about the scripts? :D
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: George access to custom panel actions

Post by Svengali »

Animationriver wrote: 15 Jan 2018, 14:30 I can not understand one thing ... :D
Why do not you just make a video about such scripts. Why did you write all this ... It's just terrible ..
10 minutes and you're done ...
But you complicate what you need very many users.
I am sorry.
But scripts are very important!
Where are the video lessons about the scripts? :D
I think you are misunderstanding the purpose of a thread like this. Spyderheart is asking a technical question and speculating about an idea he is thinking about, not presenting a finished product. He is inquiring if there are other forum users who have thought about similar things and if they might share their own experience or knowledge about the subject.

It is the kind of discussion that may lead to a conceptual break through and finally a new tool or plugin. He opens the topic with some questions about scripting in GEORGE, then tries to describe what he imagines to be a tool for brush management and how it might work. What he proposes is actually a very interesting idea that could lead to some new, innovative TVPaint functionality.

A video at this point might be premature or impossible.

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
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Animationriver,
Are you referring to the tool (TOOLS X LAYERS) I posted in another topic : viewtopic.php?f=11&t=11183&p=106641#p106641?
That thread does link back here but this is not a "how to" for that script, as Svengali has pointed out. I apologize if that was not clear.

On the other hand, you might be talking about to the text-based help that is embedded in the script panel? I can see how a video tutorial would be helpful for users of TOOLS X LAYERS or any other tool - but do you see how calling the thing I've made and offered for free "just terrible" doesn't really convince me to put more time into it on your behalf?

In the meantime, if you have a specific question about how to use the script I'd be happy to answer it over on the thread where it's posted.

Thanks for the interest regardless ;)
David
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
Post Reply