Notifications
Clear all

[Closed] viewport guide lines

I would like to place horizontal and vertical lines in a view port to act as guide lines. How would a go about this? I take it the yellow controls of the “viewport clipping” tool are on a different layer then the model geometry. Dose anyone know of a script out there that displays controls in the viewport that I could learn from?

thanks

6 Replies

Othoap,

Do you want to snap to these lines? If not, then it is quite easy to create, without using gw methods, which cause flicker and some speed loss in viewport on navigation.

Light

Snapping would be nice, but I have to start some were so I’ll take anything. Would you know of any scripts I could deconstruct?

Are you the “Light” of Orionflame fame? If so it ROCKS. Anyone out there doing modeling in max with out it is just beating there head against the wall. Thank you so much for all you hard work. I’m just starting out learning max script and marvel at people like you, I have so much to learn.

othoap

Hey man,

Thank you very much for your words, I am very honored!

About guideline script, I don’t know any script but I can create a sample script for you tomorrow, as it is 2:50 am here, so you can play with it. Snapping would require some decisions to be made. Will it snap from where the active snap grabs the current object or will it snap like Photoshop objects [regardless of snap settings] as in top/bottom, left/right boundaries?

Light

Othoap,

I have written a sample for you, which lets you to place guidelines. To delete a guideline, hold down control and move your move over the guideline.

(
	global preGL
	
	rollout preGL ""
	(
	
	)

	rollout guideMe "Guide Me v0.1 // by Light"
	(
    	spinner 		gPos 		""    		type:#integer    	    range:[0,1000,300]	pos:[2,5]    	fieldWidth:50	    across:4
		checkButton 	vertical	    "Vertical" 	checked:true    		height:18    			pos:[67,4]
    	checkButton    horizontal	"Horizontal"    		    		height:18    			pos:[120,4]
    	button	    create		"Create"    		    		    height:18		    	pos:[185,4]
		
		local ds = sysInfo.desktopSize
		
		on guideMe open do createDialog preGL 1 ds.y 300 0 bgColor:blue style:#()
    	on gPos changed val do (if vertical.checked then setDialogPos preGL [val, (getDialogPos preGL).y] else setDialogPos preGL [(getDialogPos preGL).x, val])
		
		on vertical changed pState do
		(
			horizontal.checked = not pState
    		if pState then preGL.width = 1; preGL.height = ds.y; setDialogPos preGL [gPos.value, 0]
		)
		
		on horizontal changed pState do
		(
			vertical.checked = not pState
    		if pState then preGL.height = 1; preGL.width = ds.x; setDialogPos preGL [0, gPos.value]
		)
		
		on create pressed do
		(
			local val = (random 1 1000000) as string
			local pp = getDialogPos preGL
			local txt = "rollout gl" + val + " \"\"
"
			txt += "(
"
    		txt += "on gl" + val + " mouseMove pos do (if keyboard.controlPressed do destroyDialog gl" + val + ")
"
			txt += ")
"
    		txt += "createDialog gl" + val + " " + (preGL.width as string) + " " + (preGL.height as string) + " " + (pp.x as string) + " " + (pp.y as string) + " bgColor:blue style:#()"
			execute txt
		)
		
		on guideMe close do destroyDialog preGL
	)
	createDialog guideMe 236 26 style:#(#style_toolWindow, #style_sysMenu)
)

Please feel free to use it in any way you want.

Light

Light

WOW, Dude, MAN and to quote Jenifer Anistin “isn’t that’s just kick you in the crotch spit on your neck fantastic”

Know see that’s what I’m talking about. Don’t let anyone try to tell you other wise, that Sir is a talent. To whip out something so quick, thank you. I’m in your debt.

On the snapping I would say like Photoshop. The snap would be at an intersection of the vertical / horizontal guides.

On your earlier post about the viewport performance hit, I can image so. When I’m playing music from WMP in the background on my pc and modeling in max viewport performance is fine. When I turn on grid or snap the music starts skipping.

My goal is to have something like the following image. I always wanted Photoshop type guides in max with an addition. I thing Photoshop really needs to include circle/ovals guide. Also the ability to take a vertical or horizontal guide and drag one corner to make a diagonal line.

Sorry, I’m off my rant

Well thanks for giving me a great start.

Thanks man for your words, I am glad it helped.

Light

To quote Lachdanan, “You have saved my soul from damnation and for that I am in your debt.”