Notifications
Clear all

[Closed] Select Subobject under mouse?

So i want to make a mouse tool for my little stair making script but i cant figure out how to get the tool to select edges(or any subobject for that matter).
It seems like there are a ton of tools native to max that can do this. like bridge, target weld. champher ect. but i’m yet to find a script with the code in it to help me.

it seems like a no-brainier to have this functionality build into maxscript but perhaps i'm wrong and there is no way to do it aside from making an actual plugin...i cant even find a callback event to help me with this.

to further explain i want to be able to, in pseudocode, do:
1: start tool StairBridge
2: on mouse click down (click:1) select edge under cursor
3: on mouse click up (click:2) addselect second edge that is now under the cursor
4: run my stairMaker script on the 2 now selected poly edges
5: return to step 2 until abort
I dont even have to select them, i would be happy if i could just store whatever subobject index is under the mouse in whatever subobject level i'm in

sorry if this is yet another thing that cant be done with maxscript. i’m still trying to learn what can and can not be done with it. and believe be, it takes a long time before i will ask how to do something and this has me stumped. it would just make sence that there would be methods for selecting subobjects and i cant figure out if i can or not seeing how so many native tools do it.

4 Replies

Look up Scripted Mouse Tools, How To… Create Scripted Geometry Plug-in, and How To… Draw a Freehand Spline in the Maxscript Help. They should help with the mouse related info.

-Eric

I looked at that stuff already. lots of talk about selecting and creating objects but nothing on selecting edges, verts or faces. If there is a callback event for subojectselectionchanged i’m not finding i could easly do it.

1 Reply
(@denist)
Joined: 2 years ago

Posts: 0

you can use when select … construct, but what was selected you have to detect yourself.

Well, you did get me on the right track. Did a search for “when construct” and followed a couple see also links. I ended up at “Node Event System” scrolled down all the way and found [b]subobjectSelectionChanged…exactly like i had said in the last post!

funny cause i know i searched for “[/b][b]subobjectSelection” and it comes up with no results. however add “changed” to the end and it finds that single page. I just gotta say. I KNEW IT! had to be there somewhere! would never have guessed the search would fail me so badly, lol. Wow, even “subobjectSelectionchange” doesn’t find it. that d at the end is really important apparently.

thanks a bunch.

[/b]