why there is no switching between move and scale modes in the example?

Good afternoon. Can anyone explain why there is no switching between move and scale modes in the example? Any object and Point named Point001 is present in the scene

___________________________________________________________________________________________

 

try (DestroyDialog  Test) catch()

rollout Test "Test" 

(

pickbutton pbtn_Select_Object "Select Object" 

on pbtn_Select_Object picked obj do

(

select obj

max scale

toolMode.coordsys $Point001

toolMode.transformCenter() 

)

)

createDialog Test pos:[100,100] style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox)

_____________________________________________________________________________________________

 

I'm using Max 2015. After executing the script, the main Toolbar is set to Move, not to Scale.

Comments

Comment viewing options

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

Oh how difficult... But thank

Oh how difficult... But thank you for your attention to my problem

miauu's picture

.

If you find another solution, please share it here. :)

miauu's picture

.

Switch to Select and Scale mode, execute this and pick an object in the scene:

try (DestroyDialog  Test) catch()
rollout Test "Test" 
(
 
	pickbutton pbtn_Select_Object "Select Object" 
 
	on pbtn_Select_Object picked obj do
	(
 
	)
 
)
createDialog Test pos:[100,100] style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox)

As you can see right after the object is picked the Select and Move mode will be turned on.

Any's picture

I do not understand the answer.

Hello miauu!!! I do not understand the answer. How is my code different from yours? I even improved it. But the result is the same. Switching to SCALE mode does not occur.

________________________________________________________________________________________

try (DestroyDialog  Test) catch()

rollout Test "Test" 

(

 

pickbutton pbtn_Select_Object "Select Object" 

 

on pbtn_Select_Object picked obj do

(

select obj

    max move

max scale

toolMode.coordsys $Point001

toolMode.transformCenter() 

)

 

)

createDialog Test pos:[100,100] style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox)

 

_________________________________________________________________________________________

miauu's picture

.

As you can see in my code there is no need to have any code in the
on pbtn_Select_Object picked obj do
It seems that no matter of the code in the picked obj event at the end the 3ds Max automatically turns on the Select and move.

This will do what you need:

try (DestroyDialog  Test) catch()
rollout Test "Test" 
(
	local pickedObj = undefined
 
	pickbutton pbtn_Select_Object "Select Object" 
	timer timer_01 "" interval:10 active:false
 
	on pbtn_Select_Object picked obj do
	(
		timer_01.active = true
		pickedObj = obj
	)
 
	on timer_01 tick do
	(
		if pickedObj != undefined do
		(
			max scale
			toolMode.coordsys $Point001
			toolMode.transformCenter()
			timer_01.active = false
		)	
	)
)
 
createDialog Test pos:[100,100] style:#(#style_titlebar, #style_border, #style_sysmenu, #style_minimizebox)

Comment viewing options

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