George access to custom panel actions

A forum dedicated to George scripting questions
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: George access to custom panel actions

Post by Animationriver »

spyderheart wrote: 15 Jan 2018, 15:20 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
Misunderstanding, but it's ok. Forgive me if I was not clear. :D
I do not mean someone specific. Most likely, I dream about video tutorials on creating scripts from the creators of TVPaint development. Maybe this is possible in the near future from the Elodie. At least basic skills in one lesson. :D
  And then what did you do I did not understand)) ah)) sorry, opened and .. all ..))) sorry) :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
spyderheart
Posts: 124
Joined: 22 Jan 2013, 03:11

Re: George access to custom panel actions

Post by spyderheart »

Misunderstanding, but it's ok. Forgive me if I was not clear. :D
I do not mean someone specific. Most likely, I dream about video tutorials on creating scripts from the creators of TVPaint development. Maybe this is possible in the near future from the Elodie. At least basic skills in one lesson. :D
And then what did you do I did not understand)) ah)) sorry, opened and .. all ..))) sorry) :D
No worries. Thank you for clarifying!

David
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: 14 Jan 2018, 18:59 ... 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?
Many tools have an associated command, and if you give the parameter "backup", the result will be all the parameters of the tool.
Then you can save that string to the preferences
And after, just load that string and use the command again with the result to have the tool.

Something like that:

Code: Select all

tv_penbrush "backup"
PARSE result tool
tv_writeuserstring ... tool

...

tv_readuserstring ...
PARSE result tool
tv_penbrush tool
TVPaint Team
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: George access to custom panel actions

Post by Svengali »

Mike wrote: 16 Jan 2018, 08:23
spyderheart wrote: 14 Jan 2018, 18:59 ... 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?
Many tools have an associated command, and if you give the parameter "backup", the result will be all the parameters of the tool.
Then you can save that string to the preferences
And after, just load that string and use the command again with the result to have the tool.

Something like that:

Code: Select all

tv_penbrush "backup"
PARSE result tool
tv_writeuserstring ... tool

...

tv_readuserstring ...
PARSE result tool
tv_penbrush tool
But, in the case of brushes I think you must also manage the storage and retrieval of the cutbrush or the animbrush used by the brush.

1. test if tool is a brush
2. if it is, check number of frames
3. if one frame, store the cutbrush
4. if more than one frame, store the animbrush
5. also store all the brush parameters in a string as you suggest

1. retrieve the stored brush parameters
2. check the number of frames
3. if one frame, retrieve cutbrush
4. if more than one frame, retrieve the animbrush

You must separately store and retrieve APen, BPen, Smoothing, and Paper

It would be SO much easier if GEORGE had ONE COMMAND especially for brushes that would:
Store the brush parameters, the cutbrush or animbrush, the APen, BPen, Smoothing and Paper all at once. [feature request?]

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 »

It would be SO much easier if GEORGE had ONE COMMAND especially for brushes that would:
Store the brush parameters, the cutbrush or animbrush, the APen, BPen, Smoothing and Paper all at once. [feature request?]
Agreed!
Even a "get" and "set" pair of procedures that does all this reliably would be amazing. I think it would be pretty widely useful. But yes how nice a single command would be!
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 »

Svengali wrote: 16 Jan 2018, 16:17 It would be SO much easier if GEORGE had ONE COMMAND especially for brushes that would:
Store the brush parameters, the cutbrush or animbrush, the APen, BPen, Smoothing and Paper all at once. [feature request?]
Independently of having 1 command for all, the main problem is (begins) when you want to store binary data (aka image(s)): where, who create/delete, how to access, ...
It can't be stored inside the config (text) file, and when you need to manage additional 'attached' files: who access, who delete, is this file still useful, ...
It's not a simple problem to choose the 'right' way and answer to all questions/problem
TVPaint Team
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: George access to custom panel actions

Post by Svengali »

Mike wrote: 17 Jan 2018, 09:05 Independently of having 1 command for all, the main problem is (begins) when you want to store binary data (aka image(s)): where, who create/delete, how to access, ...
It can't be stored inside the config (text) file, and when you need to manage additional 'attached' files: who access, who delete, is this file still useful, ...
It's not a simple problem to choose the 'right' way and answer to all questions/problem
Mike, of course you are right.
Being able to reliably store and retrieve ALL settings and data for any tool including brushes is a problem that crops up over and over, in so many situations because you always want to be able to continue where you were before you pressed the button.

It's something each script-writer has to solve for themselves I guess.

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 »

What if this magic tv_getAndSaveEVERYTHING command simply mimic way right clicking an action and choosing Grab Current Tool works?

When you do this you get the commands inside the action:

Custom Brush:
ColorA: ...
ColorB: ...
Command: tv_paper...

if the return value of tv_getAndSaveEVERYTHING were just the string arguments needed to call these 4 commands from inside a the script would that do the trick? It would basically just be bypassing the interface button we currently use. So while it doesn't allow us to "push" an existing button using a script (the original thread topic) it would allow us to mimic a hypothetical button's behaviour from behind the scenes.

This way the answers to Mike's legitimate concerns above would mirror how these problems are already solved with Right Click > "Grab Current Tool".

To load the tool again maybe there could be a command like tv_action "code" - where "code" is a string that could completely define an action's command list (NOT the identifier of an existing action). Calling tv_action insde a script would be equivalent to pausing the script, pushing an action button, and resuming the script. As if the button were embedded in your script.

There is plenty I am overlooking I'm sure. I don't presume to know the answer but I do presume there is one so - just brainstorming...
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 »

I've started to tackle the problem of storing and retrieving all settings necessary to define a brush or tool. As our discussion has revealed everything is pretty much straightforward except that there is no way to "store" the external brush or animbrush images (using quotes because we are in fact only trying to reference something that already exists - not store it) .
I have a proposal for a george command that would still be very useful without creating the risks and ambiguities pointed out by Mike:

tv_brushFile [file]

- If [file] argument is provided it attempts to load the brush or anim frames stored in that file. Result is "1" if sucessful, "0" if not.
- If no argument provided, it returns the file path of the most recently loaded brush or anim (likely in the "Brushes" folder in the user's config folder). Note that it can only provide you with a file path that already exists OR set the current brush to a file that already exists - meaning the images have already been properly stored using the normal TVPaint interface. There is no opportunity to create or write a new file with this command, so it deals exclusively with tools that have already been saved.


So to remember and restore a custom brush:

Code: Select all

tv_restorebrush backup
brush = result
tv_brushFile //returns the path of the last brush loaded from disk
brushanim = result 

...

tv_restorebrush brush 
tv_brushFile brushanim //sets the brush back to the file path stored above
I believe that with this command - or even building it into tv_brushrestore (since it is the missing piece) we'd have all we need for a full brush "get and set" procedure.
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 »

I've gone with tv_savebrushanim and tv_loadbrushanim - at least for use on my own system for now...

But there is one more obstacle to the complete brush storage problem:
Is there a way to access the current parameters of the "Custom" drawing mode so that they can be stored and then later called back using tv_custommode?
I've tried "tv_custommode backup" but that only sets the drawing mode to custom and returns nothing.

At some point I'll start a new thread with the goal of consolidating a foolproof method for store and load of any brush via scripting...
David
--------------------------------------------------------
TVPaint 11.7 Standard
System: 64GB RAM // 3 TB SSD // Core i7 8700K // NVIDIA GTX 1080// Windows 10 Home
Post Reply