Exemple #1
0
    def __init__(self):
        """ Constructor. """
        om2.MUserData.__init__(self, False)  # Don't delete after draw

        self.fDormantColor = om2.MColor()
        self.fActiveColor = om2.MColor()
        self.fLeadColor = om2.MColor()
        self.fQuadList = om2.MPointArray()
        self.fSize = 1.0
Exemple #2
0
    def __init__(self):
        """ Constructor. """
        om2.MUserData.__init__(self, False)  # Don't delete after draw

        self.fDormantColor = om2.MColor()
        self.fActiveColor = om2.MColor()
        self.fLeadColor = om2.MColor()
        self.fPntPos = om2.MPoint()
        self.fRow0 = ""
        self.fRow1 = ""
        self.fRow2 = ""
        self.fRow3 = ""
        self.fRow4 = ""
        self.fDist = 2.0
    def __init__(self):
        """ Constructor. """
        om2.MUserData.__init__(self, False)  # Don't delete after draw

        self.fDormantColor = om2.MColor()
        self.fActiveColor = om2.MColor()
        self.fLeadColor = om2.MColor()
        self.fLineList = om2.MPointArray()
        self.fLineWidth = 1.0
        self.fTipSize = 0.1
        self.fSubd = 4
        self.fRadius = 1.0
        self.fXRay = False
        self.fDashed = False
        self.fOperation = 0
Exemple #4
0
    def addUIDrawables(self, path, drawManager, frameContext):
        """
        For each instance of the object, besides the render items updated in updateRenderItems() there is also
        a render item list for rendering simple UI elements. This stage gives the plugin access to MUIDrawManager
        which aids in drawing simple geometry like line, circle, rectangle, text, etc. If you are not going to
        override this function, please don't make 'hasUIDrawables()' return True or there may be some wasted
        performance overhead.
            * path [MDagPath] is the path to the instance to update auxiliary items for (this shape node).
            * drawManager [MUIDrawManager] is the draw manager used to draw simple geometry.
            * frameContext [MFrameContext] is the frame level context information.
        """
        displayStyle = frameContext.getDisplayStyle()

        activeView = omui2.M3dView.active3dView()
        displayXRay = activeView.xrayJoints()

        drawManager.beginDrawable(omr2.MUIDrawManager.kSelectable)
        if (displayStyle & omr2.MFrameContext.kXrayActiveComponents):
            om2.MGlobal.displayInfo("Opa! Xray on!!! [%s]" % displayStyle)
            drawManager.beginDrawInXray()

        drawManager.setColor(om2.MColor([1.0, 0.0, 0.0, 0.3]))
        drawManager.mesh(omr2.MUIDrawManager.kTriStrip, DebugGeometry.kPnts,
                         None, None, om2.MUintArray([0, 1, 3, 2]))

        if (displayStyle & omr2.MFrameContext.kXrayActiveComponents):
            drawManager.endDrawInXray()
        drawManager.endDrawable()
Exemple #5
0
    def draw(self, view, path, style, status):
        """
        Draw custom geometry in the viewport using OpenGL calls.
            * view [M3dView] is a 3D view that is being drawn into.
            * path [MDagPath] to the parent (transform node) of this locator in the DAG.  To obtain the locator shape node,
                use MDagPath::extendToShape() if there is only one shape node under the transform or
                MDagPath::extendToShapeDirectlyBelow(unsigned int index) with the shape index if there are multiple
                shapes under the transform.
            * style [M3dView.DisplayStyle] is the style to draw object in.
            * status [M3dView.DisplayStatus] is the selection status of the object.
        """
        # pylint: disable=unused-argument

        thisMob = self.thisMObject()
        mInput = om2.MPlug(thisMob,
                           DebugMatrix.inMatrix).asMDataHandle().asMatrix()
        nameColor = om2.MPlug(
            thisMob, DebugMatrix.inNameColor).asMDataHandle().asFloatVector()
        mtxColor = om2.MPlug(
            thisMob, DebugMatrix.inMtxColor).asMDataHandle().asFloatVector()
        dist = om2.MPlug(thisMob, DebugMatrix.inDistance).asFloat()
        lineHeight = om2.MPlug(thisMob, DebugMatrix.inLineHeight).asFloat()
        colorList = om2.MColorArray()
        colorList.append(om2.MColor([nameColor.x, nameColor.y, nameColor.z]))
        colorList.append(om2.MColor([mtxColor.x, mtxColor.y, mtxColor.z]))
        cameraPath = view.getCamera()

        view.beginGL()

        glRenderer = omr1.MHardwareRenderer.theRenderer()
        glFT = glRenderer.glFunctionTable()

        glFT.glPushAttrib(omr1.MGL_CURRENT_BIT)
        glFT.glDisable(omr1.MGL_CULL_FACE)

        self.drawText(mInput, dist, colorList, status, cameraPath, lineHeight,
                      view)

        view.endGL()
        return None
Exemple #6
0
    def prepareForDraw(self, objPath, cameraPath, frameContext, oldData):
        """
        Called by Maya each time the object needs to be drawn.
        Any data needed from the Maya dependency graph must be retrieved and cached in this stage.
        Returns the data to be passed to the draw callback method.
            * objPath [MDagPath] is the path to the object being drawn.
            * cameraPath [MDagPath] is the path to the camera that is being used to draw.
            * frameContext [MFrameContext] is the frame level context information.
            * oldData [MUserData] is the data cached by the previous draw of the instance.
        """
        # pylint: disable=unused-argument
        data = oldData
        if not isinstance(data, DebugMatrixData):
            data = DebugMatrixData()

        node = objPath.node()
        mInput = om2.MPlug(node,
                           DebugMatrix.inMatrix).asMDataHandle().asMatrix()
        color = om2.MPlug(
            node, DebugMatrix.inNameColor).asMDataHandle().asFloatVector()
        dist = om2.MPlug(node, DebugMatrix.inDistance).asFloat()

        pntPos = om2.MPoint(mInput[12], mInput[13], mInput[14])

        pntRow1 = om2.MPoint(mInput[0], mInput[1], mInput[2], mInput[3])
        row1 = "%s | %s | %s | %s" % (str(pntRow1.x), str(
            pntRow1.y), str(pntRow1.z), str(pntRow1.w))

        data.fDormantColor = om2.MColor([color.x, color.y, color.z])
        data.fActiveColor = om2.MColor([0.3, 1.0, 1.0])
        data.fLeadColor = om2.MColor([1.0, 1.0, 1.0])

        data.fDist = dist
        data.fPntPos = pntPos
        data.fRow1 = row1

        return data
Exemple #7
0
    def prepareForDraw(self, objPath, cameraPath, frameContext, oldData):
        """
        Called by Maya each time the object needs to be drawn.
        Any data needed from the Maya dependency graph must be retrieved and cached in this stage.
        Returns the data to be passed to the draw callback method.
            * objPath [MDagPath] is the path to the object being drawn.
            * cameraPath [MDagPath] is the path to the camera that is being used to draw.
            * frameContext [MFrameContext] is the frame level context information.
            * oldData [MUserData] is the data cached by the previous draw of the instance.
        """
        # pylint: disable=unused-argument
        data = oldData
        if not isinstance(data, TestLocatorData):
            data = TestLocatorData()

        node = objPath.node()
        size = om2.MPlug(node, TestLocator.inSize).asDouble()

        data.fDormantColor = om2.MColor([1.0, 1.0, 0.0])
        data.fActiveColor = om2.MColor([0.3, 1.0, 1.0])
        data.fLeadColor = om2.MColor([1.0, 1.0, 1.0])

        data.fSize = size

        vPoint1 = om2.MVector(1.0, 0.0, -1.0) * size
        vPoint2 = om2.MVector(-1.0, 0.0, -1.0) * size
        vPoint3 = om2.MVector(-1.0, 0.0, 1.0) * size
        vPoint4 = om2.MVector(1.0, 0.0, 1.0) * size

        data.fQuadList.clear()
        data.fQuadList.append(om2.MPoint(vPoint1))
        data.fQuadList.append(om2.MPoint(vPoint2))
        data.fQuadList.append(om2.MPoint(vPoint3))
        data.fQuadList.append(om2.MPoint(vPoint4))
        data.fQuadList.append(om2.MPoint(vPoint1))

        return data
Exemple #8
0
    def prepareForDraw(self, objPath, cameraPath, frameContext, oldData):
        """
        Called by Maya each time the object needs to be drawn.
        Any data needed from the Maya dependency graph must be retrieved and cached in this stage.
        Returns the data to be passed to the draw callback method.
            * objPath [MDagPath] is the path to the object being drawn.
            * cameraPath [MDagPath] is the path to the camera that is being used to draw.
            * frameContext [MFrameContext] is the frame level context information.
            * oldData [MUserData] is the data cached by the previous draw of the instance.
        """
        # pylint: disable=unused-argument
        startTime = time.time()
        data = oldData
        if not isinstance(data, MeshControllerData):
            data = MeshControllerData()

        node = objPath.node()
        transformPath = om2.MDagPath.getAPathTo(
            om2.MFnDagNode(objPath).parent(0))
        mWorldInv = transformPath.inclusiveMatrixInverse()
        indexStr = om2.MPlug(node, MeshController.inIndexList).asString()
        offset = om2.MPlug(node, MeshController.inOffset).asFloat()
        mesh = om2.MPlug(node, MeshController.inMesh).asMDataHandle().asMesh()
        color = om2.MPlug(
            node, MeshController.inColor).asMDataHandle().asFloatVector()

        # If plugs are dirty calculate the geometry points
        MeshController.getGeometryPoints(mesh, indexStr, offset, mWorldInv)

        data.fVtxPositions = MeshController.ctrlVertices

        status = omr2.MGeometryUtilities.displayStatus(objPath)
        if status == omr2.MGeometryUtilities.kDormant:
            # Not selected
            alpha = 0.25
        elif status == omr2.MGeometryUtilities.kActive:
            # Multiselection
            alpha = 0.65
        elif status == omr2.MGeometryUtilities.kLead:
            # Selected
            alpha = 0.5
        data.fColor = om2.MColor([color.x, color.y, color.z, alpha])

        runTime = round((time.time() - startTime) * 1000, 5)
        om2.MGlobal.displayInfo("prepareForDraw time: %s ms" % str(runTime))
        return data
    def prepareForDraw(self, objPath, cameraPath, frameContext, oldData):
        """
        Called by Maya each time the object needs to be drawn.
        Any data needed from the Maya dependency graph must be retrieved and cached in this stage.
        Returns the data to be passed to the draw callback method.
            * objPath [MDagPath] is the path to the object being drawn.
            * cameraPath [MDagPath] is the path to the camera that is being used to draw.
            * frameContext [MFrameContext] is the frame level context information.
            * oldData [MUserData] is the data cached by the previous draw of the instance.
        """
        # pylint: disable=unused-argument
        data = oldData
        if not isinstance(data, DebugVectorData):
            data = DebugVectorData()

        node = objPath.node()
        lineW = om2.MPlug(node, DebugVector.inLineWidth).asFloat()
        color = om2.MPlug(node,
                          DebugVector.inColor).asMDataHandle().asFloatVector()
        tipSize = om2.MPlug(node, DebugVector.inTipSize).asFloat()
        subd = om2.MPlug(node, DebugVector.inSubdivisions).asInt()
        radius = om2.MPlug(node, DebugVector.inRadius).asFloat()
        xray = om2.MPlug(node, DebugVector.inXRay).asBool()
        dashed = om2.MPlug(node, DebugVector.inDashed).asBool()
        operation = om2.MPlug(node, DebugVector.inOperation).asShort()
        vVector1 = om2.MPlug(
            node, DebugVector.inVec1).asMDataHandle().asFloatVector()
        vVector2 = om2.MPlug(
            node, DebugVector.inVec2).asMDataHandle().asFloatVector()
        normalize = om2.MPlug(node, DebugVector.inNormalize).asBool()

        data.fDormantColor = om2.MColor([color.x, color.y, color.z])
        data.fActiveColor = om2.MColor([0.3, 1.0, 1.0])
        data.fLeadColor = om2.MColor([1.0, 1.0, 1.0])
        data.fLineWidth = lineW
        data.fTipSize = tipSize
        data.fSubd = subd
        data.fRadius = radius
        data.fXRay = xray
        data.fDashed = dashed
        data.fOperation = operation

        if operation == 0:
            vEnd = vVector1
        elif operation == 1:
            vFinal = vVector1 + vVector2
            vEnd = vFinal
        elif operation == 2:
            vFinal = vVector1 - vVector2
            vEnd = vFinal
        elif operation == 3:
            vFinal = vVector1 ^ vVector2
            vEnd = vFinal
        elif operation == 4:
            if vVector2.length() < 0.001:
                vFinal = om2.MFloatVector(0.0, 0.0, 0.0)
            else:
                vFinal = ((vVector1 * vVector2) /
                          math.pow(vVector2.length(), 2.0)) * vVector2
            vEnd = vFinal

        vStart = om2.MFloatVector()
        if normalize:
            vEnd.normalize()

        data.fLineList.clear()
        DebugVector.drawArrow(vStart,
                              vEnd,
                              tipSize,
                              radius,
                              subd,
                              lineW,
                              vp2=True,
                              lineList=data.fLineList)

        return data
Exemple #10
0
    def __init__(self):
        """ Constructor. """
        om2.MUserData.__init__(self, False)  # Don't delete after draw

        self.fColor = om2.MColor()
        self.fVtxPositions = []
Exemple #11
0
    def drawText(self,
                 mtx,
                 dist,
                 colorList,
                 status,
                 cameraPath,
                 lineH,
                 view=None,
                 drawManager=None):
        """Draw the matrix text.
        """
        mCamera = cameraPath.inclusiveMatrix()
        camFn = om2.MFnCamera(cameraPath)
        thisMob = self.thisMObject()
        worldMtxPlug = om2.MPlug(thisMob, DebugMatrix.inMatrix)
        destPlugList = worldMtxPlug.connectedTo(True, False)
        if len(destPlugList) >= 1:
            node = destPlugList[0].node()
            attr = destPlugList[0].attribute()
            dagFn = om2.MFnDagNode(node)
            name = dagFn.name()
            attrName = "%s   (%s)" % ("  " * len(name),
                                      om2.MFnAttribute(attr).name)
            bBox = dagFn.boundingBox
        else:
            attrName = ""
            name = "NO MATRIX INPUT"
            bBox = om2.MBoundingBox()

        offsetY = bBox.height / 2.0

        pntCamera = om2.MPoint(mCamera[12], mCamera[13], mCamera[14])
        pntPos = om2.MPoint(mtx[12] + dist, mtx[13] + offsetY, mtx[14])
        vCamera = pntCamera - pntPos
        distFromCamera = vCamera.length()
        pntLineOffset = om2.MPoint(0.0, (distFromCamera / camFn.focalLength) *
                                   lineH, 0.0)
        rowList = []

        pntRow1 = om2.MPoint(mtx[0], mtx[1], mtx[2], mtx[3])
        row1 = "%s | %s | %s | %s" % ("%.3f" % pntRow1.x, "%.3f" % pntRow1.y,
                                      "%.3f" % pntRow1.z, "%.3f" % pntRow1.w)
        rowList.append(row1)
        pntRow2 = om2.MPoint(mtx[4], mtx[5], mtx[6], mtx[7])
        row2 = "%s | %s | %s | %s" % ("%.3f" % pntRow2.x, "%.3f" % pntRow2.y,
                                      "%.3f" % pntRow2.z, "%.3f" % pntRow2.w)
        rowList.append(row2)
        pntRow3 = om2.MPoint(mtx[8], mtx[9], mtx[10], mtx[11])
        row3 = "%s | %s | %s | %s" % ("%.3f" % pntRow3.x, "%.3f" % pntRow3.y,
                                      "%.3f" % pntRow3.z, "%.3f" % pntRow3.w)
        rowList.append(row3)
        pntRow4 = om2.MPoint(mtx[12], mtx[13], mtx[14], mtx[15])
        row4 = "%s | %s | %s | %s" % ("%.3f" % pntRow4.x, "%.3f" % pntRow4.y,
                                      "%.3f" % pntRow4.z, "%.3f" % pntRow4.w)
        rowList.append(row4)

        if status == omui2.M3dView.kActive:
            view.setDrawColor(om2.MColor([0.3, 1.0, 1.0]))
        elif status == omui2.M3dView.kLead:
            view.setDrawColor(om2.MColor([1.0, 1.0, 1.0]))

        if status == omui2.M3dView.kDormant:
            view.setDrawColor(colorList[0])
        view.drawText(name, pntPos, omui2.M3dView.kLeft)

        if status == omui2.M3dView.kDormant:
            view.setDrawColor(colorList[1])
        view.drawText(attrName, pntPos, omui2.M3dView.kLeft)
        if worldMtxPlug.isConnected:
            for i in range(1, 5):
                pos = om2.MPoint(pntPos - (pntLineOffset * i))
                view.drawText(rowList[i - 1], pos, omui2.M3dView.kLeft)
Exemple #12
0
class DebugMatrix(omui2.MPxLocatorNode):
    """ Main class of gfDebugMatrix node. """

    kNodeName = ""
    kNodeClassify = ""
    kNodeRegistrantID = ""
    kNodeID = ""

    inMatrix = om2.MObject()
    inNameColor = om2.MObject()
    inMtxColor = om2.MObject()
    inDistance = om2.MObject()
    inLineHeight = om2.MObject()

    fNameColor = om2.MColor([0.90588, 0.41961, 0.41961])
    fMtxColor = om2.MColor([0.93725, 0.87843, 0.69412])

    def __init__(self):
        """ Constructor. """
        omui2.MPxLocatorNode.__init__(self)

    def postConstructor(self):
        """ Post Constructor. """
        thisMob = self.thisMObject()
        nodeFn = om2.MFnDependencyNode(thisMob)
        nodeFn.setName("%sShape#" % DebugMatrix.kNodeName)
        # localPosPlug = nodeFn.findPlug("localPosition", False)
        # localPosPlug.isChannelBox = False
        # localPosPlug

    @staticmethod
    def creator():
        """ Maya creator function. """
        return DebugMatrix()

    @staticmethod
    def initialize():
        """
        Defines the set of attributes for this node. The attributes declared in this function are assigned
        as static members to DebugMatrix class. Instances of DebugMatrix will use these attributes to create plugs
        for use in the compute() method.
        """
        mAttr = om2.MFnMatrixAttribute()
        nAttr = om2.MFnNumericAttribute()

        DebugMatrix.inMatrix = mAttr.create("matrixInput", "mtxi",
                                            om2.MFnMatrixAttribute.kDouble)
        INPUT_ATTR(mAttr)
        mAttr.storable = False
        mAttr.keyable = True

        DebugMatrix.inNameColor = nAttr.createColor("nameColor", "nColor")
        nAttr.default = (DebugMatrix.fNameColor.r, DebugMatrix.fNameColor.g,
                         DebugMatrix.fNameColor.b)
        INPUT_ATTR(nAttr)

        DebugMatrix.inMtxColor = nAttr.createColor("matrixColor", "mColor")
        nAttr.default = (DebugMatrix.fMtxColor.r, DebugMatrix.fMtxColor.g,
                         DebugMatrix.fMtxColor.b)
        INPUT_ATTR(nAttr)

        DebugMatrix.inDistance = nAttr.create("distance", "dist",
                                              om2.MFnNumericData.kFloat, 0.0)
        INPUT_ATTR(nAttr)

        DebugMatrix.inLineHeight = nAttr.create("lineHeight", "lHeight",
                                                om2.MFnNumericData.kFloat, 0.7)
        nAttr.setMin(0.001)
        nAttr.setMax(2.0)
        INPUT_ATTR(nAttr)

        DebugMatrix.addAttribute(DebugMatrix.inMatrix)
        DebugMatrix.addAttribute(DebugMatrix.inNameColor)
        DebugMatrix.addAttribute(DebugMatrix.inMtxColor)
        DebugMatrix.addAttribute(DebugMatrix.inDistance)
        DebugMatrix.addAttribute(DebugMatrix.inLineHeight)

    def compute(self, plug, dataBlock):
        """
        Node computation method:
            * plug is a connection point related to one of our node attributes (either an input or an output).
            * dataBlock contains the data on which we will base our computations.
        """
        # pylint: disable=unused-argument
        return None

    def connectionMade(self, plug, otherPlug, asSrc):
        """This method gets called when connections are made to attributes of this node.
            * plug (MPlug) is the attribute on this node.
            * otherPlug (MPlug) is the attribute on the other node.
            * asSrc (bool) is this plug a source of the connection.
        """
        if plug == DebugMatrix.inMatrix:
            thisMob = self.thisMObject()
            distancePlug = om2.MPlug(thisMob, DebugMatrix.inDistance)
            dagFn = om2.MFnDagNode(otherPlug.node())
            bBox = dagFn.boundingBox
            offset = bBox.width / 2.0
            distancePlug.setFloat(offset + 2.0)
        return omui2.MPxLocatorNode.connectionMade(self, plug, otherPlug,
                                                   asSrc)

    def connectionBroken(self, plug, otherPlug, asSrc):
        """This method gets called when connections are broken with attributes of this node.
            * plug (MPlug) is the attribute on this node.
            * otherPlug (MPlug) is the attribute on the other node.
            * asSrc (bool) is this plug a source of the connection.
        """
        if plug == DebugMatrix.inMatrix:
            thisMob = self.thisMObject()
            distancePlug = om2.MPlug(thisMob, DebugMatrix.inDistance)
            distancePlug.setFloat(0.0)
        return omui2.MPxLocatorNode.connectionBroken(self, plug, otherPlug,
                                                     asSrc)

    def drawText(self,
                 mtx,
                 dist,
                 colorList,
                 status,
                 cameraPath,
                 lineH,
                 view=None,
                 drawManager=None):
        """Draw the matrix text.
        """
        mCamera = cameraPath.inclusiveMatrix()
        camFn = om2.MFnCamera(cameraPath)
        thisMob = self.thisMObject()
        worldMtxPlug = om2.MPlug(thisMob, DebugMatrix.inMatrix)
        destPlugList = worldMtxPlug.connectedTo(True, False)
        if len(destPlugList) >= 1:
            node = destPlugList[0].node()
            attr = destPlugList[0].attribute()
            dagFn = om2.MFnDagNode(node)
            name = dagFn.name()
            attrName = "%s   (%s)" % ("  " * len(name),
                                      om2.MFnAttribute(attr).name)
            bBox = dagFn.boundingBox
        else:
            attrName = ""
            name = "NO MATRIX INPUT"
            bBox = om2.MBoundingBox()

        offsetY = bBox.height / 2.0

        pntCamera = om2.MPoint(mCamera[12], mCamera[13], mCamera[14])
        pntPos = om2.MPoint(mtx[12] + dist, mtx[13] + offsetY, mtx[14])
        vCamera = pntCamera - pntPos
        distFromCamera = vCamera.length()
        pntLineOffset = om2.MPoint(0.0, (distFromCamera / camFn.focalLength) *
                                   lineH, 0.0)
        rowList = []

        pntRow1 = om2.MPoint(mtx[0], mtx[1], mtx[2], mtx[3])
        row1 = "%s | %s | %s | %s" % ("%.3f" % pntRow1.x, "%.3f" % pntRow1.y,
                                      "%.3f" % pntRow1.z, "%.3f" % pntRow1.w)
        rowList.append(row1)
        pntRow2 = om2.MPoint(mtx[4], mtx[5], mtx[6], mtx[7])
        row2 = "%s | %s | %s | %s" % ("%.3f" % pntRow2.x, "%.3f" % pntRow2.y,
                                      "%.3f" % pntRow2.z, "%.3f" % pntRow2.w)
        rowList.append(row2)
        pntRow3 = om2.MPoint(mtx[8], mtx[9], mtx[10], mtx[11])
        row3 = "%s | %s | %s | %s" % ("%.3f" % pntRow3.x, "%.3f" % pntRow3.y,
                                      "%.3f" % pntRow3.z, "%.3f" % pntRow3.w)
        rowList.append(row3)
        pntRow4 = om2.MPoint(mtx[12], mtx[13], mtx[14], mtx[15])
        row4 = "%s | %s | %s | %s" % ("%.3f" % pntRow4.x, "%.3f" % pntRow4.y,
                                      "%.3f" % pntRow4.z, "%.3f" % pntRow4.w)
        rowList.append(row4)

        if status == omui2.M3dView.kActive:
            view.setDrawColor(om2.MColor([0.3, 1.0, 1.0]))
        elif status == omui2.M3dView.kLead:
            view.setDrawColor(om2.MColor([1.0, 1.0, 1.0]))

        if status == omui2.M3dView.kDormant:
            view.setDrawColor(colorList[0])
        view.drawText(name, pntPos, omui2.M3dView.kLeft)

        if status == omui2.M3dView.kDormant:
            view.setDrawColor(colorList[1])
        view.drawText(attrName, pntPos, omui2.M3dView.kLeft)
        if worldMtxPlug.isConnected:
            for i in range(1, 5):
                pos = om2.MPoint(pntPos - (pntLineOffset * i))
                view.drawText(rowList[i - 1], pos, omui2.M3dView.kLeft)

    def draw(self, view, path, style, status):
        """
        Draw custom geometry in the viewport using OpenGL calls.
            * view [M3dView] is a 3D view that is being drawn into.
            * path [MDagPath] to the parent (transform node) of this locator in the DAG.  To obtain the locator shape node,
                use MDagPath::extendToShape() if there is only one shape node under the transform or
                MDagPath::extendToShapeDirectlyBelow(unsigned int index) with the shape index if there are multiple
                shapes under the transform.
            * style [M3dView.DisplayStyle] is the style to draw object in.
            * status [M3dView.DisplayStatus] is the selection status of the object.
        """
        # pylint: disable=unused-argument

        thisMob = self.thisMObject()
        mInput = om2.MPlug(thisMob,
                           DebugMatrix.inMatrix).asMDataHandle().asMatrix()
        nameColor = om2.MPlug(
            thisMob, DebugMatrix.inNameColor).asMDataHandle().asFloatVector()
        mtxColor = om2.MPlug(
            thisMob, DebugMatrix.inMtxColor).asMDataHandle().asFloatVector()
        dist = om2.MPlug(thisMob, DebugMatrix.inDistance).asFloat()
        lineHeight = om2.MPlug(thisMob, DebugMatrix.inLineHeight).asFloat()
        colorList = om2.MColorArray()
        colorList.append(om2.MColor([nameColor.x, nameColor.y, nameColor.z]))
        colorList.append(om2.MColor([mtxColor.x, mtxColor.y, mtxColor.z]))
        cameraPath = view.getCamera()

        view.beginGL()

        glRenderer = omr1.MHardwareRenderer.theRenderer()
        glFT = glRenderer.glFunctionTable()

        glFT.glPushAttrib(omr1.MGL_CURRENT_BIT)
        glFT.glDisable(omr1.MGL_CULL_FACE)

        self.drawText(mInput, dist, colorList, status, cameraPath, lineHeight,
                      view)

        view.endGL()
        return None