Select Palettes

A forum dedicated to George scripting questions
Post Reply
Gary
Posts: 26
Joined: 12 May 2015, 13:33

Select Palettes

Post by Gary »

Is there a George command that can select a palette that's already been loaded into TVPaint?

My intent is to make a George script that can load a file and the correct palette to work on with it. However when using tv_LoadPalette to import a palette file it creates duplicate entries. So if I was to keep using the script, the palette list would fill up with duplicate palettes.

Is there a command that could attempt to select the palette rather than loading it? Ideally this command could somehow indicate if the palette was not found, and needs to be loaded in from a file.

Alternatively, if I could just detect whether or not the palette is already loaded I could at least avoid loading it in again even if I can't get George to select it.
User avatar
Thierry
Site Admin
Posts: 2780
Joined: 07 Jan 2013, 08:28

Re: Select Palettes

Post by Thierry »

Hello Gary,
Gary wrote:However when using tv_LoadPalette to import a palette file it creates duplicate entries.
Can you give me an example of your utilisation of the command ?
Gary wrote:Alternatively, if I could just detect whether or not the palette is already loaded I could at least avoid loading it in again even if I can't get George to select it.
We'll have a deeper look at the code to confirm it, but I don't think that it's possible to do so yet (I don't think it should be hard to add, but I'll confirm it too).
Gary
Posts: 26
Joined: 12 May 2015, 13:33

Re: Select Palettes

Post by Gary »

So far I was just using it with the commandline, so it's happening if I call

Code: Select all

TVPaint.exe "cmd=tv_LoadPalette C:\Users\gchadwick\Desktop\Palette.pal"
When I checked just now, the same happens if I make a small George script with this command in it:

Code: Select all

tv_LoadPalette "C:\Users\gchadwick\Desktop\Palette.pal"
Thanks for looking into it Thierry!
Post Reply