Good day all,
I have been writing a simple locator node that looks like the normal x,y,z manipulators that you see using the Maya API 2.0.
One problem that I am having is that when I select it, you can’t really see if it has been selected or not. Which brings me to my question. I know that it has to do with the kActive, kLead and so on, which I can do when setting one overall color to the locator. But as you can see in the picture above, I have three colors set. Has anyone come right with something like this?
This is the implementation what I have found online so far for the state:
state = OpenMayaRender.MGeometryUtilities.displayStatus(objPath) if state & OpenMayaRender.MGeometryUtilities.kActive: color= OpenMaya.MColor((1.0, 1.0, 1.0)) data.color=color else: data.color = OpenMayaRender.MGeometryUtilities.wireframeColor(objPath)
This is how I am drawing and setting the colors:
drawManager.setColor(x_axis_color) drawManager.setLineWidth(line_width) drawManager.line(origin_point, x_point * data.draw)
If anyone has any suggestions on this, I would really appreciate any help.
I look forward hearing your responses. Thanks!