So we are starting to use vp2 in the latest maya and have rewritten our mpxlocator nodes to fit. However when the following is issued, the node still draws:
cmds.modelEditor('modelPanel4', e=True, locators=False)
If i create a normal locator, the new node does not draw but ours still do. I’m curious what I need to look for in order to not draw? Is this part of an overidden function or something I can check on the prepareForDraw arguments?
Thanks
Have you overridden MPxLocatorNode::excludeAsLocator? If that returns false, then the locator will still be drawn even when the modelEditor is set to not draw locators.
that would be it, many thanks!
nevermind, that wasn’t it. Its tru by default which is usually what you want. In the default renderer it shows and hides with normal maya locators as expected, however in vp2 it does not so there’s something else I’m missing. Probably in the MPxDrawOverride somewhere
I’m thinking this is a bug. Have you put a ticket in with Autodesk?
I was looking through the rest of the VP2 API, trying to find a way to get the current M3dView that is being rendered, but couldn’t find anything. You might also try looking at the MSceneRender class and using render overrides. That class has the notion of object type exclusions. Though, it seems like a lot of work for something that should be done by default.