ScriptSpot

Forum topic · General Scripting

max commands / mouse tools

By br0t · 2009-12-09

Description

Hey,
I just found out about the max command to fire up tools like "zoomregion". They are listed in the reference file under "MAX commands". My question is, is there any way to see the underlying code of these tools in maxscript? To be more specific, i would like to have a look at the "zoomregion"-code to be able to enhance my scripted mouse tool so that it will show a selection-frame when dragging.
Maybe this illustrates further, thus I am not sure if i am expressing right:

I want this tool...


	tool tool_dragFrame
	(
		local startpos = 0
		local endpos = 0
		
		on mousePoint clickno do
		(
			if clickno == 1 then 
			(
				startpos = mouse.pos
				print ("Start: "+startpos as String)
			)
			else 
			(
				endpos = mouse.pos
				print ("End: "+endpos as String)
				#stop
			)--end else
		)--end on
		on mouseMove clickno do ()--end on
	)--end tool
	
	startTool tool_dragFrame

...to create a visual representation of the dragged frame like this:
http://img707.imageshack.us/i/showframewhendragging.jpg/

Is there a way to see the code of the "zoomregion"-tool or do you know how to do what i described above?

Greetings

Comments (2)

br0t · 2009-12-10

mhm might be a starting point, but I don't get it right now, maybe when I have more time. Thanks for the tip.
Maybe I could just crete a Rectangle-Spline when dragging the frame, to have it visualize the frame. But I also don't know how to do that, anyone do :/ ?

What about "Viewport Drawing

sergo · 2009-12-10

What about "Viewport Drawing Methods"? Do they work in mouse tool clause?

my scripts and tips/tricks:
www.sergepogosyan.com