spinner control scale by axis
Hi everyone,
I'm beginning on maxscript and I currently have an issue.
I'd like to control an object's scale x, y and z independently with 3 spinners. I also need the feeback on the spinners if I scale the object
I already can control the position or the rotation like this:
"
x_Controller = Bezier_float(); y_Controller = Bezier_float(); z_Controller = Bezier_float()
--assign controller to spinners
dialogtest.spinnerA.controller = x_Controller; dialogtest.spinnerB.controller = y_Controller; dialogtest.spinnerC.controller = z_Controller
-- position control:
$.pos.X_Position.controller = x_Controller; $.pos.Y_Position.controller = y_Controller; $.pos.Z_Position.controller = z_Controller
--rotation control:
$.rotation.X_Rotation.controller = x_Controller; $.rotation.Y_Rotation.controller = y_Controller; $.rotation.Z_Rotation.controller = z_Controller
"
But I didn't succeed to do the same for the scale. I can easily control the scale with spinners like this:
"
on SpinnerA changed arg_x do $.scale.x = (arg_x)
on SpinnerB changed arg_y do $.scale.x = (arg_y)
on SpinnerC changed arg_z do $.scale.x = (arg_z)
"
but this way I don't have the feedback on the spinners if I directly scale the object ...
So after hours of google search, I'm tired and I need help please
Comments
I experienced using the same
I experienced using the same code before and it really works. I'm familiar with different programming codes because I experienced making programs before. Programming is quite difficult and challenging but it's just need patience.-bio-oil
Thank you for your post, it gives me a big help for my project reference.
chia frø
U can assigne "ScaleXYZ"
U can assigne "ScaleXYZ" controller to selection.
bga
I don't understand
Hi Barigazy
Thanks for your answer :)
Actually I don't understand how i'm supposed to use this with a spinner.
The thing is that I really need to control the scale with the 3 spinners in real time (with the upbutton, downbutton or when a value is set directly in the spinner manualy) but I also need the reverse fonction in real time.
I mean when I scale the selected object in the viewport with the scale tool, I want the spinners update their value in real time too.
Hope you understand what I'm searching for.
gift from me ;)
well... even attaching a bit improved version (.ms file), cheers!
my recent MAXScripts RSS (archive here)
Thanks, it works but on " object level"
so i could not scale the selected vertices of that object, dont know it if is possible though...
Thanks a lot
Hi Anubis
Thanks a lot for this, it's (almost) perfect !
Almost because i'd like to display the scale value in spinners as a percentage, like the transform type-in dialog (F12).
But hey, since it works, it's really not a big problem if I can't do this.
Again thank you
LOL
The TTI(F12) is just a tool NOT binded to selected or other object.
What you can do though, for the 2nd goal, is to add another set of 3 controls (spinners or labels), which to serve as display only, and in them to display measured percent value. But I'll leave this as exercise (homework) for you.
Cheers!
my recent MAXScripts RSS (archive here)
Hi AnubisAgain, thanks for
Hi Anubis
Again, thanks for the help.
Still, I really want to set and get the object scale with a percentage in associated spinners.
Like that I get more precision on the scale (I'm often doing really tiny scale on objects at my job, so it's easier when manipulating a percentage).
Since I'm doing this tool to help me working faster, the actual way don't help me...
Hope i'm not bothering you :)
spinnerPrecision vs measured-percent ;)
preferences.spinnerPrecision
is what you need then (quote from mxs-help: This integer value defines the number of decimal digits displayed by spinners.) or open Customize > Preferences > General and set the value there.Adjust also the #scale property of Rollout Spinner control (which is 0.1 for Floats by defaults).
my recent MAXScripts RSS (archive here)
Works now
Hi, it's been a while since this but finally find a solution to what I did want to do exactly.
So two parts for the code:
So that way it's working nicely