Forced "Select object" mode

Hi!

Is there a way to switch by a script such a state when, for example, while being in "Select and move" mode with selected object, next I pick another object and the mode is automatically changing to just "Select object"?

It is extremely usefull to have such a state switcher because often when you are in "Select and move" with a selected object and pick another object it also by default in "Select and move" mode and as a result some accidental undesirable shifts of object may happen.

Comments

Comment viewing options

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

capture

Jahman, yes I understand how to install and use a script ))
But maybe I donot understand something.

Anyway please see yourself the script in action:
https://yadi.sk/i/EU-jEYhW3QuShd

scripture's picture

.

.

vusta's picture

it's called q..

yes...press q before you start clicking...

scripture's picture

q

Such a news! thank you!!! ))) Queen Ann is dead....

But I work so fast that I need automatic mode
Even shortcut is not good in my situation.

jahman's picture

.

macroScript autoSelectObjectModeON
category:"Jahman"
tooltip:"Auto select object mode ON"
(
 
	on execute do (
 
		global handleSelectCallback = undefined
		gc light:true
 
		fn handleSelect ev nd = (
 
			if selection.count > 1 do execute "max select"
 
		)
 
 
		global handleSelectCallback = NodeEventCallback selectionChanged:handleSelect
	)
 
)
 
macroScript autoSelectObjectModeOFF
category:"Jahman"
tooltip:"Auto select object mode OFF"
(
 
	on execute do (
 
		global handleSelectCallback = undefined
		gc light:true
 
	)
 
)
scripture's picture

Nothing happens

Jahman Thankyou very much!
But it appears that it does not work - nothing happens.

Applied your code as *.ms or *.mcr by dropping it to viewport
3D max 2018 64x

jahman's picture

.

Yes, nothing but two new macro in category 'Jahman' to turn On and Off
Did you try them?

I think having one macro to toggle this mode will be even more convenient.

macroScript autoSelectObjectModeToggle
category:"Jahman"
tooltip:"Auto select object mode toggle"
(
 
	on isChecked do (::handleSelectCallback != undefined)
 
 
	on execute do (
 
		if ::handleSelectCallback != undefined then (
 
			global handleSelectCallback = undefined
			gc light:true			
 
		) else (
 
			fn handleSelect ev nd = (
 
				if selection.count > 1 do execute "max select"
 
			) 
 
			global handleSelectCallback = NodeEventCallback selectionChanged:handleSelect
 
		)
 
	)
 
)
 
scripture's picture

capture

Jahman, yes I understand how to install and use a script ))
But maybe I donot understand something.

Anyway please see yourself the script in action:
https://yadi.sk/i/EU-jEYhW3QuShd

jahman's picture

.

Oh, so you need to set this state on any selection change? I didn't understand the task at first
Change selection.count > 1 to selection.count > 0 and run it again to update macros.

scripture's picture

Thank you, thank you. thank you!

Thank you Jahman!!!!
After this simple correction your script works exactly as wanted!!! This is the best script in my huge collection of scripts!!!(I am not joking)
Thank you Jahman again and again!!!!!!

Comment viewing options

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