Vanishing Point Tool

Share your custom panels, brushes, papers... (you need to be registered to read posts in this section)
v.veidt
Posts: 68
Joined: 19 Oct 2009, 00:23

Vanishing Point Tool

Post by v.veidt »

I've made this brush to serve as a vanishing point tool for creating perspective grids. It's a fairly simple set of radiating lines, which is scalable and can be modified by the Tint brushes in the Sketch Panel. I hope you find it useful.
Spoiler : :
vp1.png
vp3.png
vanishingpoint.tvpx
(1.57 MiB) Downloaded 577 times
This file was made in TVP 9.5 Standard if it matters.
Elodie
Posts: 13912
Joined: 06 Jan 2009, 09:53
Location: Metz

Re: Vanishing Point Tool

Post by Elodie »

Thank you for sharing :)
User avatar
Animark
Posts: 505
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Vanishing Point Tool

Post by Animark »

Great! Thumbs up!

... and thanks a lot :-)
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)
User avatar
lemec
Posts: 1678
Joined: 19 Feb 2006, 08:54
Location: Toronto, Ontario, Canada
Contact:

Re: Vanishing Point Tool

Post by lemec »

This is a rather heavily modified version of KylerK's vanishing point tool.
Spoiler : Kyler's tutorial video :
This version automatically switches you to the propelling pencil and restores your brush afterwards.
It makes use of the tv_undoOpenStack and tv_undoCloseStack commands to avoid clobbering your undo buffer
It locks/unlocks the display during operation for faster results.
It also uses tv_zLine to fade the opacity at the center point to eliminate the "fuzzy navel" artifact at the vanishing point
Using the first script
Using the first script

Code: Select all

Param Circle

Parse result command Cx Cy r button

tv_getActiveTool
oldTool = Result

if r>800
	t=800
Else
	t=r
End

tv_projectInfo
parse Result name width height extra

maxLen = sqr(width*width + height*height)

tv_propelling mode "color" power 100 opacity 100 dry 0 aaliasing 1 gradient 0 cpower "10;2 0 1 0 0 1 1 "
tv_undoOpenStack
tv_lockDisplay
FOR i = 1 TO t
	angle = i * (360 / t)
	x1=COS(angle) * maxLen
	y1=SIN(angle) * maxLen

	tv_ZLine Cx Cy x1+Cx y1+Cy button 0 255
END
tv_UnLockDisplay
tv_cmd oldTool
tv_undoCloseStack "Perspective Guide"
This one is a little different in that it randomizes the angle and the distance to the center point. It doesn't affect the current tool, so it's useful for various zooming effects.
Using the second script
Using the second script

Code: Select all

Param Circle

Parse result command Cx Cy r button

tv_projectInfo
parse Result name width height extra
maxLen = sqr(width*width + height*height)

r = 800 * (r / (maxLen / 3))

if r>800
	t=800
Else
	t=r
End

tv_undoopenstack
tv_LockDisplay
FOR i = 1 TO t
	r1 = rnd(maxLen / 2)
	o2 = 255 * (1 - (r1 / (maxLen / 2)))
	angle = rnd(3600)
	x2=COS(angle/10)
	y2=SIN(angle/10)
	x1=x2 * maxLen
	y1=y2 * maxLen
	x2 = x2 * r1
	y2 = y2 * r1
	
	tv_ZLine x2+Cx y2+Cy x1+Cx y1+Cy button 0 o2
END
tv_UnLockDisplay
tv_undoclosestack "Radial Burst"
Last edited by lemec on 13 Jul 2012, 17:57, edited 3 times in total.
(Win7x64, TVP Pro 11 32-bit)
User avatar
lemec
Posts: 1678
Joined: 19 Feb 2006, 08:54
Location: Toronto, Ontario, Canada
Contact:

Re: Vanishing Point Tool

Post by lemec »

With the right settings...
With the right settings...
vPForestTool.png (23.48 KiB) Viewed 5825 times
vPForest.png
(Win7x64, TVP Pro 11 32-bit)
Elodie
Posts: 13912
Joined: 06 Jan 2009, 09:53
Location: Metz

Re: Vanishing Point Tool

Post by Elodie »

Wow, very nice :D
v.veidt
Posts: 68
Joined: 19 Oct 2009, 00:23

Re: Vanishing Point Tool

Post by v.veidt »

Wow, thanks for all the work, especially with the "fuzzy navel" issue. I suppose I should really learn to script for TVP.

Not to seem belligerently ignorant, but how does one implement these wonderful scripts?
User avatar
lemec
Posts: 1678
Joined: 19 Feb 2006, 08:54
Location: Toronto, Ontario, Canada
Contact:

Re: Vanishing Point Tool

Post by lemec »

1: create a new custom panel action (right click an empty spot on an EDITABLE custom panel and choose Add Action)
2: edit the new action (right click it)
3: Choose Embedded Script
4: copy/paste the script of your choice into the script window that comes up.
(Win7x64, TVP Pro 11 32-bit)
v.veidt
Posts: 68
Joined: 19 Oct 2009, 00:23

Re: Vanishing Point Tool

Post by v.veidt »

I can't seem to get either of these scripts to work. The Param Circle command is definitely working and I don't get an error message, but there is no result when I use the action. Is there any reason this would not work on Mac OS X?

Update: It works flawlessly on Windows. Now I'm extra glad I switched over. Thanks.
kariP
Posts: 134
Joined: 20 Jul 2010, 19:14
Location: Turku, Finland

Re: Vanishing Point Tool

Post by kariP »

They both seem to work on my mac, very nice, especially the perspective tool!
I adjusted the opacity of the endpoint from 0 to 3. Now it creates a small dot into the horizon, which is a bit clearer for me. And with low amount of lines, no funny stuff on the navel area either. A Big thank you for the script!
Windows 10 (64 bit), 8gb ram, intel i5 10400f. TVpaint 11.7
User avatar
lemec
Posts: 1678
Joined: 19 Feb 2006, 08:54
Location: Toronto, Ontario, Canada
Contact:

Re: Vanishing Point Tool

Post by lemec »

Hm. Maybe I should make a version that will set the vanishing point to the intersection of two non-parallel lines. Might be useful for getting perspective guides for imagery that has an existing vanishing point.
(Win7x64, TVP Pro 11 32-bit)
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: Vanishing Point Tool

Post by Fabrice »

hey Mark and Vincent Veidt, excellent job, as usual ;)
Fabrice Debarge
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Vanishing Point Tool

Post by Peter Wassink »

lemec wrote:Hm. Maybe I should make a version that will set the vanishing point to the intersection of two non-parallel lines. Might be useful for getting perspective guides for imagery that has an existing vanishing point.
you mean a version with an input of four points that would create a grid to match an existing image?
cool idea!
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
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: Vanishing Point Tool

Post by slowtiger »

+1. That's something so fundamental, yet I haven't seen it in any graphics program yet: let the user create a rectangle or tetragon, and the script would create a grid of that. Adjust the original tetragon, and the grid changes with it.
grid.png
grid.png (30.34 KiB) Viewed 5690 times
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
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: Vanishing Point Tool

Post by Fabrice »

Maybe it can help :
The vanishing points are usable in the warp tool.
So if you draw a grid on the screen, you can use the warp tool to put it in perspective, using the vanishing points of the warp tool.

nb : This kind of grid is in the ToDo list for a future 10.x version. with the complete renewal of grid, guides, etc ... (old code ...)
Fabrice Debarge
Post Reply