PDA

View Full Version : Mouse click event in a viewport


Roctren
05-22-2009, 12:34 AM
I've been trying all day to find a way to execute a procedure or scriptJob when a 3D object in a viewport is clicked. I can do it on selection via:

scriptJob -ct "SomethingSelected" ...(run proc)...

however, I am attempting to create a 3D button of sorts and want to keep the previously selected object. Using that aforementioned method inherently means I loose the selection I want to keep.

My main question is can I get a mouse click event with its coords or the object over which was clicked without delving into the Maya API? Or, can it be done with a custom Context? If the latter, would the scene have to operate within that context constantly?

Any insight is greatly appreciated, Thanks.

claydough
05-22-2009, 05:30 AM
I've been trying all day to find a way to execute a procedure or scriptJob when a 3D object in a viewport is clicked. I can do it on selection via:

scriptJob -ct "SomethingSelected" ...(run proc)...

however, I am attempting to create a 3D button of sorts and want to keep the previously selected object. Using that aforementioned method inherently means I loose the selection I want to keep.


some similar notes
http://web.archive.org/web/20050313211933/www.ewertb.com/maya/mel/mel.php?howto=83


My main question is can I get a mouse click event with its coords or the object over which was clicked without delving into the Maya API? Or, can it be done with a custom Context? If the latter, would the scene have to operate within that context constantly?

some similar notes
http://tech-artists.org/forum/showthread.php?t=419


result
http://farm4.static.flickr.com/3544/3444594964_b5f9dcc369_o.jpg

CGTalk Moderation
05-22-2009, 05:30 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.