Edit Render Region-button

Currently, there is an Edit Render Region button available that can be added to the toolbar.

I made a custom one like this:

	on execute do if keyboard.shiftpressed then
 	(
		macros.run "Haider" "RenderRegion_GUI_02"
	)
 
 	else 
 
	(
		actionMan.executeAction 0 "59241" -- Edit Render Region
	)

I need your help to make this script behave so that it is pressed when the Edit Render Region mode is on, and unpressed when it is off, like the original button.

Also, I am not sure if actionMan.executeAction 0 "59241" is the proper code. I got it from the listener.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Haider of Sweden's picture

--

Thanks Miauu, this did the trick.

Here is the result

on execute do 
	if keyboard.shiftPressed then
		(
			macros.run "Haider" "RenderRegion_GUI_02"
		)
 
	else if keyboard.controlPressed then
		(
			setRenderType #view
		)
 
	else if EditRenderRegion.IsEditable then
		(
			setRenderType #view
		)
 
	else
		(
			 EditRenderRegion.EditRegion()
		)
 
		on isChecked return EditRenderRegion.IsEditing

The next issue I am struggling with is to set setRenderType #view if EditRenderRegion.IsEditable. But it ends up that I need to click twice to get the effect I need.

Kind regards
Haider
www.haider.se

miauu's picture

.

Open MaxScript Help file and search for this:

Interface: EditRenderRegion

Then, to make the toolbar button to stay pressed search for this:

on isChecked do

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.