Maya create object at mouse position

python
maya

#1

Hello,

I’d like to script (preferably in python) a poly plane that appears at my mouse position when I hit a keyboard shortcut. The polyplane I can do, but as for the rest - is that even possible? I have a lot of experience using python, but only simple scripts and functions. I can’t figure out how to get and set at the mouse position, and any help would be greatly appreciated.


#2

Check out this stack overflow question and the documentation for the draggerContext command. draggerContext has options for how to project a mouse pointer position into 3d space . It is, however, kind of clunky but it’s a good place to start.