Hi I am practicing Maya custom node building. So I would like to make a custom node which draws custom shapes under viewport 2.0. This node will track current cursor position and only display the custom shape when the cursor is hovering on the node. I know similar things can be done with tagging the node as “controller”. But that does not work with my custom implemented drawoverride in the viewport.
So my current approach is : install a event filter on maya main window to track the cursor position. And use this position to decide if my custom node should draw the shape in view port or not. It works with one node in maya. But because I created an QObject with event filter under the custom node to track cursor, if I create more than one instance of this custom node, I will end up with more than one event filter object being installed, which I don’t want to, is there a way to make one event filter and shared with all instance of the same custom node ?
Is there a better approach ?
And also what is the correct way to implement a custom node with custom drawoverride that allow “controller” tag to work ?