clicking off selection

I was checking out how a friend of mine uses modo. He has axis constraints update automatically based off his viewport orientation, and his transform tool toggle on an off with the gizmo invisible. This allows him to be super fast because he doesn't have to position the cursor over a selection or gizmo handle.

I want the same thing.

I got the auto axis constraints working, but I have NO IDEA how to make it so that if I L click drag in empty viewport space while having an object/subobject selected, and while having this script enabled, the selection will move with my mouse even though I didn't click drag over the selection.

Any ideas?
I looked into maybe using dotnet to set the cursor position... but i don't see any method that does that.

HELP!!!!

Attached is my code for my axis constraints script. Thx!!!!

AttachmentSize
autotransformconstraints.ms4.23 KB

Comments

Comment viewing options

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

thank you!!! now i can get

thank you!!! now i can get back to work.
Getting the screen pos is easy. I just use the commands bellow.

gw.setTransform( Matrix3 1 )
2DPOINT = gw.transPoint( 3DPOINT )

Then offset 2DPOINT by the location of the top left corner of the active viewport.

But I didnt know about selection lock... that makes things a lot easyer.

well, at least i learned a lot. :)

pixamoon's picture

:)

no prob, Glad it helped :)

And yes, lock selection is so great while modeling, I use it all the time with F5,F6,F7,F8 .
But your script as a shortcut will be very helpful too !

Cheers,
Pixamoon

pixamoon's picture

hmm

Hey, If I understand -- for that I usually use Space Bar (short-key) to lock selection (Selection Lock Toggle)

So if you don't want to press Space Bar every time you can add to script code:

Max SpaceBar

But if you still want to do get and set mouse position then :
http://forums.cgsociety.org/archive/index.php/t-803151.html

cursor = dotnetclass "System.Windows.Forms.Cursor"
p = cursor.Position
cursor.Position = dotnetobject "System.Drawing.Point" (p.x+300) (p.y+300)

this will get mouse position and will set/offset it by [300,300]

max script can also easy get mouse position by:

mouse.pos
or
mouse.screenpos

But I'm not sure if script can set mouse position.

Let me know if you know how to get screen gizmo position to move mouse there ?
Cheers,
Pixamoon

Comment viewing options

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