View Full Version : Prevent scale tool from scaling negatively?
Swordsman 07-27-2006, 09:35 AM Hello I was wondering if it was possible to script the scale tool so that it won't scale into negative numbers. I would like to be able to use it to squash a number of points into the same area space is the reason for my question. Thanks.
|
|
Ge-ZUS
07-28-2006, 11:00 AM
If you had an expression the result of which you're going to use as the scaling value, then it would be no problem. If this value sometimes gets beneath zero you could use the absolute value of this expression:
$x = scaling value;
$y = abs $x;
...
that should work fine...
btw: the abs-function works for vectors as well. Just consult the MEL Command Reference
If I just missunderstood you:
A different approach could be that you use a custom attribute to control the value of the scale-attributes.
For expample you could create a new attribute called "scaleXcontrol". Then create a new expression for the "object.scaleX"-attribute:
object.scaleX = abs (object.scaleXcontrol);
This way, the value won't get underneath 0. Anyhow, this method is not really intuitive... :-(
Of course, you will probably need for every dimension a seperate custom attribute, connected to its scaling-attribute.
Looking forward to see any other possibilities...
micle
07-28-2006, 01:06 PM
you can simply set the limit scale to 1 so the scale valute will never be negative :)
use:
transformLimits -scaleX
Ge-ZUS
07-29-2006, 12:34 AM
why limit to 1? it should be possible to set a value of, for expamle 0.001 or even 0, but not to -0.001...
micle
07-29-2006, 07:35 AM
yes it's wrong....
the min valute should be 0 :)
sorry:thumbsup:
Ge-ZUS
07-29-2006, 12:43 PM
It's no problem. Is it possible though, using your "transformLimits -scaleX" to set the limit to 0?? Didn't not know this function at all...:eek:
micle
07-29-2006, 06:52 PM
yea you should use:
transformLimits -scaleX 1 5 -enableScaleX 1 1 $obj;
to set the min scale to 1 and the max to 5...
i dont know how to set only the min scale, it may be something like that:
transformLimits -scaleX 1 2 (you can use any valute you want) -enableScaleX 1 0 $obj;
:thumbsup:
Swordsman
07-29-2006, 11:25 PM
Thanks for your responses guys I really appreciate it. But after fiddling with the tools a little more I figured why not just use the "Merge to center" tool under Edit Polygons to achieve the desired effect. Thanks again for your ideas though. I'm learning a little more about Mel everyday by reading these forums.
Ge-ZUS
07-29-2006, 11:27 PM
mhmmm...interesting.....thanks micle...(i'm michael too...*g*)...
Ge-ZUS
07-29-2006, 11:35 PM
dear Swordsman, I can't get the affect of "merge to center". what is it going to do??
itsallgoode9
07-30-2006, 02:54 AM
There's a mel script I have downloaded that does alightments like this. Just select a group of verts, faces, edges, and press "x" and they line up along the x axis...press "y" and they line up along the y axis, etc. Basically it's the same thing as 3dsMax's planar function. Pm me if you want and i'll send you the mel script
CGTalk Moderation
07-30-2006, 02:54 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.