Switching between Mode Instance/Frame

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Joost
Posts: 439
Joined: 24 Nov 2011, 13:16

Switching between Mode Instance/Frame

Post by Joost »

Hi!

Is there a way to make a keyboard shortcut to toggle between (only) "Mode Instance" and "Mode Frame" On the Light Table?

If not, it's a feature request from me. (And I never use the other two modes, so it would be nice to exclude these from the toggle. Or just a keyboard shortcut to go to "Mode Instance" and "Mode Frame" would also work for me)


Thanks!

Joost
Mac OS 13.4.1 , Mac Studio 2023, 32GB RAM, Wacom Cintiq 27 QHD (no touch), Wacom Driver 6.4.2-4.
TVP Pro 11.7.1
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Switching between Mode Instance/Frame

Post by Peter Wassink »

+1!

it seems there is something possible in george: "tv_lighttablemode ["value" iIndex iOpacity] ... ["interval" "instance"|"image"|"bookmark"|"imagemark"] ["imagemarkcolor" iIndex]...."

but i don't know how to create a script for that so a shortcut would be great for us non programmers.
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Cardin
Posts: 134
Joined: 06 Sep 2010, 17:59

Re: Switching between Mode Instance/Frame

Post by Cardin »

Using the command Peter listed, I created a button that toggles the light table mode between image and instance(frame).

-install custom button
-click the 'x' to close the button's window so that it is no longer visible.
-the button is now installed and is listed in your shortcuts menu to be assigned a key.

Here's the code from the embedded script in case you just want to create the button for yourself. Not much of a programmer myself but it seems to work when I tested it...

Code: Select all

tv_lighttablemode 
parse result  interval interval_value  remaining

IF ( CMP( interval_value, "bookmark" ) == 1 || CMP( interval_value, "imagemark" ) == 1 )
tv_lighttablemode interval "image"
EXIT
END

IF ( CMP( interval_value, "image") == 1)
tv_lighttablemode interval "instance"
EXIT
END

IF ( CMP( interval_value, "instance") == 1)
tv_lighttablemode interval "image"
EXIT
END
Attachments
light table mode toggle image_instance.tvpx
(54.5 KiB) Downloaded 196 times
TVPaint 12.0.0 Pro
System - CPU: i9-13900K, RAM: 128GB, GPU: Intel Arc A770 16GB, OS: Win 11 Pro 23H2 Build 22631.3447
Wacom Cintiq 4K (Driver 6.4.6-1 April 23, 2024)
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Switching between Mode Instance/Frame

Post by Peter Wassink »

That works like a charm,
Thank you very much Cardin!!!
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Cardin
Posts: 134
Joined: 06 Sep 2010, 17:59

Re: Switching between Mode Instance/Frame

Post by Cardin »

Peter Wassink wrote: 19 Dec 2023, 21:33 That works like a charm,
Thank you very much Cardin!!!
You're welcome, Peter!
Glad it's helpful :)
TVPaint 12.0.0 Pro
System - CPU: i9-13900K, RAM: 128GB, GPU: Intel Arc A770 16GB, OS: Win 11 Pro 23H2 Build 22631.3447
Wacom Cintiq 4K (Driver 6.4.6-1 April 23, 2024)
User avatar
Joost
Posts: 439
Joined: 24 Nov 2011, 13:16

Re: Switching between Mode Instance/Frame

Post by Joost »

That is exactly what I was looking for! Thanks a lot Cardin!
This will save me a lot of time :)

(Maybe TVPaint can implement this in the future?)
Mac OS 13.4.1 , Mac Studio 2023, 32GB RAM, Wacom Cintiq 27 QHD (no touch), Wacom Driver 6.4.2-4.
TVP Pro 11.7.1
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Switching between Mode Instance/Frame

Post by Peter Wassink »

Cardin wrote: 19 Dec 2023, 22:10
Peter Wassink wrote: 19 Dec 2023, 21:33 That works like a charm,
Thank you very much Cardin!!!
You're welcome, Peter!
Glad it's helpful :)
something weird.
yesterday the script worked but now no longer?!

i closed tvpaint yesterday ...accidently without saving my config .
so today i loaded your custom panel and assigned a key again.

but now it toggles between Image and instance...?
instead of between instance and imagemark


Would you care to explain how this script works, or what i could be doing wrong..?
it looks simple enough.
but for instance... i don't get why it says [ tv_lighttablemode interval "image" ] , instead of [ tv_lighttablemode interval "image mark" ]
( i tried changing it but that broke it :( )
it kind of makes sense from the script that it now it toggles between image and instance ...
yet it really did switch to image mark yesterday!? i'm confused now.


Also Dev team could you please remove the lighttable option "mode frame"/ "image"
i for the life of me cannot think of a single reason to have that.

tv_lighttablemode
parse result interval interval_value remaining

IF ( CMP( interval_value, "bookmark" ) == 1 || CMP( interval_value, "imagemark" ) == 1 )
tv_lighttablemode interval "image"
EXIT
END

IF ( CMP( interval_value, "image") == 1)
tv_lighttablemode interval "instance"
EXIT
END

IF ( CMP( interval_value, "instance") == 1)
tv_lighttablemode interval "image"
EXIT
END
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Cardin
Posts: 134
Joined: 06 Sep 2010, 17:59

Re: Switching between Mode Instance/Frame

Post by Cardin »

Joost wrote: 20 Dec 2023, 08:55 That is exactly what I was looking for! Thanks a lot Cardin!
This will save me a lot of time :)

(Maybe TVPaint can implement this in the future?)
yer welcome, Joost :)


Peter Wassink wrote: 20 Dec 2023, 13:05
Would you care to explain how this script works, or what i could be doing wrong..?
....
but now it toggles between Image and instance...?
instead of between instance and imagemark
From what I understood of Joost's request, he wanted a shortcut to toggle exclusively between image and instance, omitting "image mark" and "bookmark".

yet it really did switch to image mark yesterday!? i'm confused now.
That is strange! Can't really explain that one :?

but for instance... i don't get why it says [ tv_lighttablemode interval "image" ] , instead of [ tv_lighttablemode interval "image mark" ]
( i tried changing it but that broke it :( )

The error was probably "image mark" instead of "imagemark" [the enumator value designated for image mark]. Removing the 'space' character might fix the issue for you.


Peter, I modified the script to switch exclusively between Instance and Image Mark, brief explanations are provided in yellow comments.
tv_lighttablemode //fetch light table data
parse result interval interval_value remaining //disseminate data from fetch into separate variables


//*This part is to resolve situations where the mode was somehow set to a value we didn't want
//Section 2: This bit checks if the current value is set to image or bookmark;
//if either are true then it simply changes the value to "image". Setting it to "image"
//was an arbitrary decision since we only want/need the choices to be instance and image mark.
//After the change, the script is terminated because we don't want to do anymore checks at this time.

IF ( CMP( interval_value, "bookmark" ) == 1 || CMP( interval_value, "image" ) == 1 )
tv_lighttablemode interval "instance"
EXIT
END

//This bit checks if the current value is set to instance. If so, it toggles to image mark then terminates script.
IF ( CMP( interval_value, "instance") == 1)
tv_lighttablemode interval "imagemark"
EXIT
END

//This bit checks if the current value is set to image mark. If so, toggles to instance then terminates script.
IF ( CMP( interval_value, "imagemark") == 1)
tv_lighttablemode interval "instance"
EXIT
END
edited: Mixed up instance and image in the code; fixed now
TVPaint 12.0.0 Pro
System - CPU: i9-13900K, RAM: 128GB, GPU: Intel Arc A770 16GB, OS: Win 11 Pro 23H2 Build 22631.3447
Wacom Cintiq 4K (Driver 6.4.6-1 April 23, 2024)
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Switching between Mode Instance/Frame

Post by Peter Wassink »

Yes now it really works!

Thank you for your Trouble!

Sorry, yesterday i did not test it thoroughly i'm afraid and probably did not look close, imagining it worked :?

I actually don't quite understand why Joost would need that toggle between frame and image mark.
And am curious to learn, because i don't see how "mode frame" offers anything "mode instance" doesn't?
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Switching between Mode Instance/Frame

Post by D.T. Nethery »

Cardin wrote: 19 Dec 2023, 20:22 Using the command Peter listed, I created a button that toggles the light table mode between image and instance(frame).

-install custom button
-click the 'x' to close the button's window so that it is no longer visible.
-the button is now installed and is listed in your shortcuts menu to be assigned a key.

Here's the code from the embedded script in case you just want to create the button for yourself. Not much of a programmer myself but it seems to work when I tested it...

Code: Select all

tv_lighttablemode 
parse result  interval interval_value  remaining

IF ( CMP( interval_value, "bookmark" ) == 1 || CMP( interval_value, "imagemark" ) == 1 )
tv_lighttablemode interval "image"
EXIT
END

IF ( CMP( interval_value, "image") == 1)
tv_lighttablemode interval "instance"
EXIT
END

IF ( CMP( interval_value, "instance") == 1)
tv_lighttablemode interval "image"
EXIT
END

Thank you, Cardin ! That looks very useful. Looking forward to trying it out (and I read the follow-up with Peter)

.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Post Reply