Blender Scale

1 vote
Version: 
1.4
Author Name: 
Obaida

3dsMax Script for Appling Scale on Sub Levels Similar to Blender ,

  • Works with Editable Spline, Editable Mesh, Editable Poly Objects .
  • Depends on Current Coordinate Systems , (Coordinate Center not Used) .

UPDATE 1 :

  • Add "Middle" as Center of Scale .

  • Add Support for Edge and Face/Poly 

UPDATE 2 :

    • Remove "Get Selected Vertices" Button , Thanks to Miauu .

    • Fix Scaling on Y and Z Axis not Working in Pervious Update .

UPDATE 3 :

  • Restoring "Get Selected Vertices" Button (Previous Update not Working Properly) .

NOTS :

  • Better to not use RightClick On spinners while dragging (You can use 0.0 value anytime) .

  • When selecting more than 500 vertices its better to not Drag the spinners  .

  • Pressing any of Center Buttons (Min,Mid,Max) will also Get Selected Vertices .

UPDATE 4 :

  • Add Auto Sublevel Selection Detection .

Video URL: 

Comments

Comment viewing options

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

OK

Ok

obaida's picture

I didn't make it save to

I didn't make it save to External file because this sometimes Make the Script UI disappear when using 2 monitors .

temirgalin's picture

UI position

Can UI window remember its position after restart of the max

obaida's picture

yes you right . I'll see ,

yes you right . I'll see , but its very annoying why imgTag has event mouseout and the dialog doesn't have !!!! , mouseout event will solve all this problems .

miauu's picture

.

Yes, every time when you click the spinner the code inside "on lbutton down do" will be executed, but why this should be a problem?
The script is yours and you will make it as you want. Here is how I see the things.
1) if you use what I posted the benefits are:
- you will get rid of the Get Vert Sel button and will simplify the workflow
- the script will work only with the currently selected object

The script creates an Undo record each time when the user click the spinner, so with or without the Get Vert Sel button, the user will have to press the UNDO as many times as he needs.

obaida's picture

I tried your code and its

I tried your code and its printing "sp_scaleX buttonDown" each time I click the spinner
so it looks like the spinner doing the function on every click (not dragging the spinner)
with dragging the spinner its ok .

miauu's picture

.

OK, try this then:

on sp_scaleX buttonDown do
	(
		print "sp_scaleX buttonDown"
		Check_Axis() 
		Check_Class()
		do_Hold #start
 
	)
	on sp_scaleX changed value do 
	(
		print "sp_scaleX changed value"
		BScale #X rad_center.state
	)
	on sp_scaleX entered inSpin inCancel do 
	(
		if not inCancel then do_Hold #accept Str:"Scale X" else
		(
			print "sp_scaleX entered inSpin inCancel"
			Check_Axis() 
			Check_Class()
			do_Hold #cancel
		)
	)

and check what will be printed in the maxscirpt listener.

The
on sp_scaleX buttonDown do
is executed only once, when the user press any of the spinner's buttons. So, when this happen the script will do the same as when the Get Sel Vert button is pressed, and will do it only once. Then, while the lmb is down and the value of the spinner is changed the script will execute only this:
BScale #X rad_center.state
If I am not right, in the maxscript listener you should see this, while the spinner's button is pressed:
"sp_scaleX buttonDown"
"sp_scaleX changed value"
"sp_scaleX buttonDown"
"sp_scaleX changed value"
"sp_scaleX buttonDown"
"sp_scaleX changed value"
...
but what you will see is this:
"sp_scaleX buttonDown"
"sp_scaleX changed value"
"sp_scaleX changed value"
"sp_scaleX changed value"
"sp_scaleX changed value"

obaida's picture

Thanks

I use ' ' in names just for fun :) ,
about your idea I separated the calculation function from the spinners cuz I thought it'll lead to delay while changing the values and it needs to be calculated once ! , so I Kept it out .
I add "middle" as center for the scale ,
About the Get Button , I tried to get rid of it but I couldn't , maybe with mousemove event on the dialog but also couldn't stop it (it should work 1 time !) .
I think I'll make it imgTag , so by hovering it'll do the job .

miauu's picture

.

Use this. No need to press the [Get Selected Vertices] button.

on sp_scaleX buttonDown do
	(
		Check_Axis() 
		Check_Class()
		do_Hold #start
 
	)
	on sp_scaleX changed value do BScale #X rad_center.state
	on sp_scaleX entered inSpin inCancel do 
	(
		if not inCancel then do_Hold #accept Str:"Scale X" else
		(
			Check_Axis() 
			Check_Class()
			do_Hold #cancel
		)
	)

By the way, why do you name your controls this way:

button 'btn_getsel'

When you can use this:

button btn_getsel

obaida's picture

Thanks

idk any other idea rather than using Callbacks , I don't like to use it , cuz I disable it long time ago in my max preferences .

Comment viewing options

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