How can I find out if the mouse is over any object in the 3D View area with Python?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
There's no property or function to find it out, there's an example script to find mesh objects under the mouse however. It casts a ray on LMB and selects an object if there is one (only mesh objects and duplis).
You find the script in the built-in Text Editor, in the menu:
Templates > Python > Operator Modal View3D Raycast
AFAIK it can't be changed to also hit objects like lamps and cameras, 'cause they don't have actual faces (they are kind of virtual objects only).
If you tell more about your ultimate goal, we might find a different approach that doesn't require to know whether there's something under the mouse cursor or not.