Maya Python type problem const & in C++
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I've been trying to change the type of cursor used in Maya via python in a context command but I still didn't have any sucess and I've been trying this for some days already... 😕
class DrawContext( OpenMayaMPx.MPxContext 😞
def __init__(self):
''' Constructor. '''
OpenMayaMPx.MPxContext.__init__(self)
def toolOnSetup(self, event):
self._setCursor(OpenMayaUI.MCursor.pencilCursor)
And I allways get this error:
// Error: TypeError: in method 'MPxContext__setCursor', argument 2 of type 'MCursor const &' //
the python function is defined as _setCursor(*args).... and I know that in c++ it is only necessary to do setCursor(MCursor::pencilCursor)... I'm completely lost by this point... I already tryed passing as a list or tuple, and thought of MScriptUtil but it doesn't have this kind of conversion...
Any idea on how to solve this would be awesome!
Thank you!