Im guessing this have to do anything with it, but I have no idea where to proceed from there. Or is this even possible to do?mouse.modeA read only variable to get the mouse mode as an <integer> value.Return values are:0 - Idle;1 - Point;2 - Move
Replies
So the logic will be, instead of checking it all the time;
If when script is run (by pressing a hotkey, for my case, Q) by the user, max check whether mouse is over the object or not, if yes then paint selection, else will toggle between box/ lasso.
Is this more possible to do without leaving max freeze out cold?
Now, download this script and use it to write your own.
The nethod that is used is verry similar to what I use in some of my scripts.
EDIT: woops, removed part of the code that only served as a testing purpose on my early itteration, heh.
The problem with your code is that "intersect" always returns an array of objects. If you have several objects one after another, for example Teapot003 is in front of Teapot001, whics is in front of Teapot005, which is in front of Teapot002, the returned array wll be
Teapot001, Teapot002, Teapot003, Teapot005
As you see the objects are not in the order the ray hits them. You can try it. If this is not a problem for you then you can use the code. The other problem is that the code not works with splines.
I don't quite understand your point with the "intersect" though, the original code was for making a list of object under the mouse cursor, hence return the array of objects like what you said. But the other 3 lines of code (variable: ry, myray, intersect) are connecting to each other so I guess I can't really remove any one of them.
Also what is the different between whether the ray hits the object based on distance or not, for my case? Because for my purpose it's just to tell Max to select paint selection when there is any object bellow the cursor (no matter what object that is). Or am I missing some important detail in optimizing the code?
As for the code only work for editable poly base object, well I might just put "case of" to tell max to run the code only when its editable poly when it's not, just cycle between rect/ lasso.
I want to make an if statement but have no idea what should I check as an if condition...
fn paintrect =
But how to "pause" a timer when left mousebutton is pressed?