Extract george script from button Topic is solved

A forum dedicated to George scripting questions
Post Reply
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Extract george script from button

Post by schwarzgrau »

I would like to start coding in george. I thought it would help to look at some scripts from the content sharing section, but I don't know if it's possible to take a look at the script once I installed a custom panel conatining scripts.
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
NathanOtano
Posts: 1208
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: Extract george script from button

Post by NathanOtano »

When you edit your action button, you have two options for scripts :

- The script is embedded in an action, meaning the text is fully accessible and you can modify it directly in tvpaint. To see it click on the embedded george script line, click again on embedded george script on the menu (next to keystrokes and the rest) and you'll have a window where you see the script. Don't use it to code, it's kind of broken. Instead copy the script and work on for exemple the software "notepad ++" or just your OS basic text editor.

- The script was set, you see the name of a .grg file. So it refers to a simple text file containing a script. From my experience if you set a script, you can still modify the file on your computer and when you use the action again it just reads the script at it's current state (that's nice when you're scripting the file, you just have to save to update and test it). When you export your panel, the script is copied inside the panel so you lose your link to the file you edit, but now everybody will be able to use you action without your file.
You can still find this script however! You can either use for exemple winrar to unzip the tvpx file and you'll fin folders with the scripts, or you can go to your confing folders (I moved my default folder but I think it was in the program folders) and you'll find a "george" folder where you'll find all you panels' scripts.

Hope it helps :)
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.
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Extract george script from button

Post by schwarzgrau »

Thank you a lot for this quick introduction Nathan, it's really helpful. Unfortunately I can't 'unzip' a tvpx on a mac it seems (I tried entropy, which is a pretty versatile unarchiver). I guess I have to try it on windows, cause most of the scripts here in the forum are embeded as grg-file into the buttons of a custom panel.
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
NathanOtano
Posts: 1208
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: Extract george script from button

Post by NathanOtano »

When your panel is installed, have you tried to search in the george folder? Seems to me that they are stored here.
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.
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Extract george script from button

Post by schwarzgrau »

Ah good idea, thank you. I didn't know I have a george folder before. In OS X it is in /Users/USERNAME/Library/tvp animation 11 pro/default/George

I thought I could learn enough george to script a multi-layer transform, but while reading in this part of the forum I noticed it's already extremely complex to submit the selected layers to a george script. So I guess it's not something I could write in a week.
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
NathanOtano
Posts: 1208
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: Extract george script from button

Post by NathanOtano »

The problem is more finding a way to transform layers with george, to my knowledge it's not possible. You can do a lot of things with layers and george, except selecting them (for now), and you can only transform layers using shortcuts.

But you can still try to write a george script, use a shortcut, another script etc on a single button with multiple actions. But I found managing transforms with scripts is really difficult.

Depends on what you need
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.
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Extract george script from button

Post by schwarzgrau »

I don't want to actually transform with george. I just want to make a script, which enables you to transform multiple layers and see the result, while transforming (at the moment you can transform multiple layers, but while transforming you only see one layer transforming, but it gets applied to all)

My idea was this
  • USER: Selecting multiple layers and hit the script button
  • SCRIPT: collecting all layer IDs to an array
  • SCRIPT duplicate all selected layers and merge them to one layer
  • SCRIPT hide all original layers
  • SCRIPT choosing transform tool
  • USER: transforming the merged layers and hit enter
  • SCRIPT: unhide all original layers (using the array with the layerIDs) and reapply the transform to them, one by one
  • SCRIPT: delete merged layers.
But it seems even more complicated then I thought to get the beginning, by collecting the layer IDs of all selected layers.
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
NathanOtano
Posts: 1208
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: Extract george script from button

Post by NathanOtano »

Seems doable to me

You can use the tv_layerinfo command to know if a layer is selected : http://wiki.tvpaint.com/index.php?title=Tv_LayerInfo" onclick="window.open(this.href);return false;
Just run the command on all your layers to know which is selected, I think you can do something like what Svengali described here : http://forum.tvpaint.com/viewtopic.php? ... 774#p90759" onclick="window.open(this.href);return false;
Then you use tv_duplicate and tv_layermerge to get the test layer you want, note his ID for later deleting.
And if you stock all your original layer IDs in a user string, you can then unhide them later (because you'll not be able to do all of this in one script I think, so you have to remember it somewhere, you'll have to have two scripts and your transform in the middle)

I joined a button I made some time ago that maybe can help you, it's not george but shortcuts (sometimes it's easier to do, even if most of the time slower) and it does the "duplicate hide and merge thing" you want :) maybe if you add the shortcut for the transform tools and just script something before and after for remembering IDs and deleting/hidding the layers you want, can do the job.
Attachments
OTANO_DupHideMergeSelectedLayers.tvpx
(87 KiB) Downloaded 185 times
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