MUIDrawManager.lineList python returns an error when it's passed an MPointArray

MUIDrawManager.lineList python returns an error when it's passed an MPointArray

calibrix
Advocate Advocate
794 Views
3 Replies
Message 1 of 4

MUIDrawManager.lineList python returns an error when it's passed an MPointArray

calibrix
Advocate
Advocate

I'm trying to create some custom UI elements using the MPxLocatorNode class. This is my first time using viewport 2.0. I'm following the basic setup from the pyFootPrintNode.py file. When I get to MPxDrawOverride.addUIDrawables function. I'm finding that the MUIDrawManager.lineList function does not work. My code looks something like so: drawManager.lineList(om.MPointArray, False) The MPointArray is a variable of course. In maya, the function draws the lines, but throws an exception: // Error: SystemError: file C:/Users/Chris/Documents/maya/homeEnv/plugins/FxLocator.py line 149: error return without exception set //

I don't see what I'm doing wrong. Perhaps someone with more viewport 2.0 experience can help out.

0 Likes
Accepted solutions (1)
795 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It should be a bug. I've logged it as a defect in our system. Our engineers will look at it.

 

Yours,

Li

Message 3 of 4

calibrix
Advocate
Advocate
Accepted solution

As a work-a-round I found I can use MUIDrawManager.line and loop through my MPointArray object.

 

for i in range(0, MPointArray().length(), 2):

    MUIDRawManager.line(MPointArray[i], MPointArray[i+1])

0 Likes
Message 4 of 4

fleity
Explorer
Explorer

Same is true for lineStrip() by the way

0 Likes