Toggle grid?

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Toggle grid?

Post by BruceM »

Is there a hotkey command that would enable me to toggle on & off the grid pattern?
User avatar
slowtiger
Posts: 2897
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: Toggle grid?

Post by slowtiger »

G.
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Re: Toggle grid?

Post by BruceM »

Thanks Slowtiger, but through all of my re-binding of key commands, I've changed G to do something else. Can you tell me what the action on the right side of the menu for toggling the grid is titled? Under which heading it's found? I don't see anything that sounds like toggling of the grid.
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Toggle grid?

Post by Svengali »

The grid is created and managed under Guidelines. Try assigning Guidelines:Display:Toggle All. Its been a long time since I changed my original shortcut key assignments so I'm just guessing.
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
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Re: Toggle grid?

Post by BruceM »

Svengali,
That wasn't working, but I discovered that if I assigned "Add Grid" first, and then as you suggested "Guidelines:Display:Toggle All", it at least pops the grid on and off as I toggle the key.
The issue that I'm running into now is that each time I toggle it off and back on, it adds another layer of grid. When I look at the dropdown menu for "grid", there's a stack of them as a result of my toggling. Is there a way that you know of to avoid that?
Ideally, pressing the key would pull up a grid with the grid square size and opacity that I've pre-set for it. Is something like that doable?
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Toggle grid?

Post by Svengali »

Here is a link to a discussion about using GEORGE tvpaint scripting for the creation/toggling of a Guidelines grid.

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
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Re: Toggle grid?

Post by BruceM »

The way you describe the GEORGE scripting in your post sounds simple and reassuring, but YIKES! It sure doesn't look that way.
Thanks for your help Sven. I'll try delving into this GEORGE stuff. Perhaps I'll surprise myself...
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Toggle grid?

Post by Svengali »

Maybe the following COMMENTED version of the script will help explain what is happening... its really a simple GuideLines menu that offers the option to create or erase the 8x6 grid.
Spoiler : :

Code: Select all

// the lines with double forward slashes are comments added to explain what each GEORGE script line does...

Xcell = 8					// number of cells across stored in xcell variable
Ycell = 6					// number of cells down stored in the ycell variable
R = 0						// the R, G, B variables are zero meaning no color, i.e. black
G = 0
B = 0
A = 255						// the A variable is the alpha variable and sets the OPACITY of the grid...
						// Alpha opacity can be set from 0 = transparent to 255 = totally opaque

msg =  Xcell " by " YCell " grid|display|erase"	// the msg variable defines the title and choices you will see in the popup
tv_Request msg					// all commands start with tv_ so tv_Request will show the grid dimension title...
						// and then offer two options:  display the 8x6 grid   OR   erase the 8x6 grid
IF result == 1					// choosing display stores a one in the display variable
  tv_GetWidth					// to display the grid, we need to know the project window size - first get the width
  Width = result				// store the result in the Width variable
  tv_GetHeight					// next get the height of the project
  Height = result				// store the result in the Height variable
  GW = Width / Xcell				// calculate the pixel size of each cell's x dimension
  GH = Height / Ycell				// calculate the pixel size of each cell's y dimension
  tv_GuideLineAdd GRID X 0 Y 0 W GW H GH 	// this GUIDELINE ADD command defines the size of each individual grid cell
  						// it also displays the grid on screen with the first cell starting at X = 0 and Y = 0
  tv_GuideLineSnap GRID OFF			// this GUIDELINE SNAP command turns snap-to-grid OFF
  tv_GuideLinecolor GRID R G B A		// this GUIDELINE COLOR command defines the grid's lines as opaque black
ELSE						// if the user chose to erase the grid...
  tv_GuideLineRemove GRID			// this GUIDELINE REMOVE command will delete the grid
END
Click Spoiler : : Afficher to see the commented script...
To use the script, press the SELECT ALL at the top of the listing, then copy the selected lines.
Open a new Button in one of your Custom Panels and choose EMBEDDED GEORGE SCRIPT to create a new line.
in the text window box that opens, PASTE the lines of the script.
Press the OK button on the text window which will close it.
Press the OK button to finish editing the button.
Click the button to test the script. You should see a menu with the option to DISPLAY or ERASE an 8 x 6 grid.

You can EDIT your button's embedded script to create a different grid: Change the Xcell and Ycell assigned values to your own dimensions.
Let me know how it goes.

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
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Re: Toggle grid?

Post by BruceM »

Sven,
This is so kind of you lay all of this out for me to try. I will give this a go tomorrow morning and follow (or at least attempt to follow) your instructions to a T.
I will definitely let you know how it goes.
Thank you!
BruceM
Posts: 249
Joined: 17 Jan 2014, 15:39

Re: Toggle grid?

Post by BruceM »

Sven,
A question - once I've installed this GEORGE script into my TVPaint, will I have the ability to assign a hotkey to it to turn it on and off? Or will it exist as a button on the interface that I need to click on?
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: Toggle grid?

Post by Svengali »

BruceM wrote: 18 Jan 2019, 16:24 Sven,
A question - once I've installed this GEORGE script into my TVPaint, will I have the ability to assign a hotkey to it to turn it on and off? Or will it exist as a button on the interface that I need to click on?
You can assign a shortcut key to your custom button by going into shortkey list... in the left hand column, choose the shortcut key you want to assign the button to. In the right hand column look for the NAME OF THE CUSTOM PANEL which contains your new button and click the plus sign. In the sublist, you will see the NAME OF THE BUTTON which you will select. Then press ASSIGN and OK. Test out the shortcut key.

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
Post Reply