12 import maya.api.OpenMaya
as om
13 import maya.api.OpenMayaUI
as omui
14 import maya.api.OpenMayaRender
as omr
18 The presence of this function tells Maya that the plugin produces, and
19 expects to be passed, objects created using the Maya Python API 2.0.
32 class uiDrawManager(omui.MPxLocatorNode):
33 id = om.MTypeId(0x0008002A)
34 drawDbClassification =
"drawdb/geometry/uiDrawManager"
35 drawRegistrantId =
"uiDrawManagerPlugin"
42 aPrimitiveColor =
None
43 aPrimitiveTransparency =
None
68 aTextBoxTransparency =
None
76 aLineStartPoint =
None
85 aQuadVertex = [
None,
None,
None,
None]
98 omui.MPxLocatorNode.__init__(self)
102 return uiDrawManager()
106 nAttr = om.MFnNumericAttribute()
107 eAttr = om.MFnEnumAttribute()
108 typedAttr = om.MFnTypedAttribute()
111 uiDrawManager.aUIType = eAttr.create(
"uiType",
"ut", kText)
112 eAttr.addField(
"text", kText)
113 eAttr.addField(
"line", kLine)
114 eAttr.addField(
"point", kPoint)
115 eAttr.addField(
"rect", kRect)
116 eAttr.addField(
"quad", kQuad)
117 eAttr.addField(
"sphere", kSphere)
118 eAttr.addField(
"circle", kCircle)
119 eAttr.addField(
"arc", kArc)
120 om.MPxNode.addAttribute(uiDrawManager.aUIType)
123 uiDrawManager.aSelectability = eAttr.create(
"selectability",
"st", omr.MUIDrawManager.kAutomatic)
124 eAttr.addField(
"Unselectable", omr.MUIDrawManager.kNonSelectable)
125 eAttr.addField(
"Selectable", omr.MUIDrawManager.kSelectable)
126 eAttr.addField(
"Automatic", omr.MUIDrawManager.kAutomatic)
127 om.MPxNode.addAttribute(uiDrawManager.aSelectability)
130 uiDrawManager.aPrimitiveColor = nAttr.create(
"primitiveColor",
"pc", om.MFnNumericData.k3Float)
131 nAttr.default = (1.0, 0.0, 0.0)
132 nAttr.usedAsColor =
True
133 om.MPxNode.addAttribute(uiDrawManager.aPrimitiveColor)
136 uiDrawManager.aPrimitiveTransparency = nAttr.create(
"primitiveTransparency",
"pt", om.MFnNumericData.kFloat, 0.0)
137 nAttr.setSoftMin(0.0)
138 nAttr.setSoftMax(1.0)
139 om.MPxNode.addAttribute(uiDrawManager.aPrimitiveTransparency)
142 uiDrawManager.aLineWidth = nAttr.create(
"lineWidth",
"lw", om.MFnNumericData.kFloat, 2.0)
143 om.MPxNode.addAttribute(uiDrawManager.aLineWidth)
145 uiDrawManager.aLineStyle = eAttr.create(
"lineStyle",
"ls", omr.MUIDrawManager.kSolid)
146 eAttr.addField(
"solid", omr.MUIDrawManager.kSolid)
147 eAttr.addField(
"shortdotted", omr.MUIDrawManager.kShortDotted)
148 eAttr.addField(
"shortdashed", omr.MUIDrawManager.kShortDashed)
149 eAttr.addField(
"dashed", omr.MUIDrawManager.kDashed)
150 eAttr.addField(
"dotted", omr.MUIDrawManager.kDotted)
151 om.MPxNode.addAttribute(uiDrawManager.aLineStyle)
154 uiDrawManager.aIsFilled = nAttr.create(
"isFilled",
"if", om.MFnNumericData.kBoolean, 0)
155 om.MPxNode.addAttribute(uiDrawManager.aIsFilled)
158 uiDrawManager.aRadius = nAttr.create(
"radius",
"ra", om.MFnNumericData.kDouble, 1.0)
159 om.MPxNode.addAttribute(uiDrawManager.aRadius)
162 uiDrawManager.aDraw2D = nAttr.create(
"draw2D",
"d2", om.MFnNumericData.kBoolean, 0)
163 om.MPxNode.addAttribute(uiDrawManager.aDraw2D)
165 uiDrawManager.aPosition = nAttr.create(
"position",
"pos", om.MFnNumericData.k3Double)
166 nAttr.default = (0.0, 0.0, 0.001)
167 om.MPxNode.addAttribute(uiDrawManager.aPosition)
170 stringFn = om.MFnStringData()
171 defaultText = stringFn.create(
"uiDrawManager-Text")
172 uiDrawManager.aText = typedAttr.create(
"text",
"t", om.MFnData.kString, defaultText)
173 om.MPxNode.addAttribute(uiDrawManager.aText)
175 uiDrawManager.aTextFontSize = nAttr.create(
"textFontSize",
"tfs", om.MFnNumericData.kInt, omr.MUIDrawManager.kDefaultFontSize)
178 om.MPxNode.addAttribute(uiDrawManager.aTextFontSize)
180 uiDrawManager.fFontList = omr.MUIDrawManager.getFontList()
181 if len(uiDrawManager.fFontList) == 0:
182 sys.stderr.write(
"No font available!\n")
184 uiDrawManager.aFontFaceName = eAttr.create(
"fontFaceName",
"ffn", 0)
185 for i
in range(len(uiDrawManager.fFontList)):
186 faceName = uiDrawManager.fFontList[i]
187 eAttr.addField(faceName, i)
188 om.MPxNode.addAttribute(uiDrawManager.aFontFaceName)
190 uiDrawManager.aTextAlignment = eAttr.create(
"textAlignment",
"ta", omr.MUIDrawManager.kLeft)
191 eAttr.addField(
"left", omr.MUIDrawManager.kLeft)
192 eAttr.addField(
"center", omr.MUIDrawManager.kCenter)
193 eAttr.addField(
"right", omr.MUIDrawManager.kRight)
194 om.MPxNode.addAttribute(uiDrawManager.aTextAlignment)
196 uiDrawManager.eTextIncline = eAttr.create(
"textIncline",
"tic", omr.MUIDrawManager.kInclineNormal)
197 eAttr.addField(
"normal", omr.MUIDrawManager.kInclineNormal)
198 eAttr.addField(
"italic", omr.MUIDrawManager.kInclineItalic)
199 om.MPxNode.addAttribute(uiDrawManager.eTextIncline)
201 uiDrawManager.aTextWeight = eAttr.create(
"textWeight",
"tw", omr.MUIDrawManager.kWeightBold)
202 eAttr.addField(
"light", omr.MUIDrawManager.kWeightLight)
203 eAttr.addField(
"bold", omr.MUIDrawManager.kWeightBold)
204 om.MPxNode.addAttribute(uiDrawManager.aTextWeight)
206 uiDrawManager.aTextStretch = nAttr.create(
"textStretch",
"ts", om.MFnNumericData.kInt, omr.MUIDrawManager.kStretchUnstretched)
209 om.MPxNode.addAttribute(uiDrawManager.aTextStretch)
211 uiDrawManager.aTextLine = eAttr.create(
"textLine",
"tl", 0)
212 eAttr.addField(
"none", 0)
213 eAttr.addField(
"overline", omr.MUIDrawManager.kLineOverline)
214 eAttr.addField(
"underline", omr.MUIDrawManager.kLineUnderline)
215 eAttr.addField(
"strikeout", omr.MUIDrawManager.kLineStrikeoutLine)
216 om.MPxNode.addAttribute(uiDrawManager.aTextLine)
218 uiDrawManager.aTextBoxSize = nAttr.create(
"textBoxSize",
"tbs", om.MFnNumericData.k2Int)
219 nAttr.default = (0, 0)
220 om.MPxNode.addAttribute(uiDrawManager.aTextBoxSize)
222 uiDrawManager.aTextBoxColor = nAttr.create(
"textBoxColor",
"tbc", om.MFnNumericData.k3Float)
223 nAttr.default = (0.0, 1.0, 1.0)
224 nAttr.usedAsColor =
True
225 om.MPxNode.addAttribute(uiDrawManager.aTextBoxColor)
227 uiDrawManager.aTextBoxTransparency = nAttr.create(
"textBoxTransparency",
"tbt", om.MFnNumericData.kFloat, 0.0)
228 nAttr.setSoftMin(0.0)
229 nAttr.setSoftMax(1.0)
230 om.MPxNode.addAttribute(uiDrawManager.aTextBoxTransparency)
233 uiDrawManager.aPointSize = nAttr.create(
"pointSize",
"ps", om.MFnNumericData.kFloat, 2.0)
234 om.MPxNode.addAttribute(uiDrawManager.aPointSize)
237 uiDrawManager.aLineStartPoint = nAttr.create(
"lineStartPoint",
"lsp", om.MFnNumericData.k3Double)
238 nAttr.default = (0.0, 0.0, 0.0)
239 om.MPxNode.addAttribute(uiDrawManager.aLineStartPoint)
241 uiDrawManager.aLineEndPoint = nAttr.create(
"lineEndPoint",
"lep", om.MFnNumericData.k3Double)
242 nAttr.default = (1.0, 1.0, 1.0)
243 om.MPxNode.addAttribute(uiDrawManager.aLineEndPoint)
246 uiDrawManager.aRectUp = nAttr.create(
"rectUp",
"ru", om.MFnNumericData.k3Double)
247 nAttr.default = (0.0, 1.0, 0.0)
248 om.MPxNode.addAttribute(uiDrawManager.aRectUp)
250 uiDrawManager.aRectNormal = nAttr.create(
"rectNormal",
"rn", om.MFnNumericData.k3Double)
251 nAttr.default = (0.0, 0.0, 1.0)
252 om.MPxNode.addAttribute(uiDrawManager.aRectNormal)
254 uiDrawManager.aRectScale = nAttr.create(
"rectScale",
"rs", om.MFnNumericData.k2Double)
255 nAttr.default = (1.0, 1.0)
256 om.MPxNode.addAttribute(uiDrawManager.aRectScale)
259 defaultPosition = [ (0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (1.0, 1.0, 0.0), (0.0, 1.0, 0.0) ]
261 fullName =
"quadVertex" + str(i)
262 shortName =
"qv" + str(i)
263 uiDrawManager.aQuadVertex[i] = nAttr.create(fullName, shortName, om.MFnNumericData.k3Double)
264 nAttr.default = defaultPosition[i]
265 om.MPxNode.addAttribute(uiDrawManager.aQuadVertex[i])
268 uiDrawManager.aCircleNormal = nAttr.create(
"circleNormal",
"cn", om.MFnNumericData.k3Double)
269 nAttr.default = (0.0, 0.0, 1.0)
270 om.MPxNode.addAttribute(uiDrawManager.aCircleNormal)
273 uiDrawManager.aArcStart = nAttr.create(
"arcStartVector",
"asv", om.MFnNumericData.k3Double)
274 nAttr.default = (1.0, 0.0, 0.0)
275 om.MPxNode.addAttribute(uiDrawManager.aArcStart)
277 uiDrawManager.aArcEnd = nAttr.create(
"arcEndVector",
"aev", om.MFnNumericData.k3Double)
278 nAttr.default = (0.0, 1.0, 0.0)
279 om.MPxNode.addAttribute(uiDrawManager.aArcEnd)
281 uiDrawManager.aArcNormal = nAttr.create(
"arcNormal",
"an", om.MFnNumericData.k3Double)
282 nAttr.default = (0.0, 0.0, 1.0)
283 om.MPxNode.addAttribute(uiDrawManager.aArcNormal)
291 class uiDrawManagerData(om.MUserData):
293 om.MUserData.__init__(self,
False)
295 self.fSelectability = omr.MUIDrawManager.kAutomatic
296 self.fColor = om.MColor((1., 0., 0., 1.))
298 self.fLineStyle = omr.MUIDrawManager.kSolid
299 self.fIsFilled =
False
302 self.fPosition = om.MPoint(0.0, 0.0, 0.001)
304 self.fText =
"uiDrawManager-Text"
305 self.fTextFontSize = omr.MUIDrawManager.kDefaultFontSize
306 self.fFontFaceIndex = 0
307 self.fTextAlignment = omr.MUIDrawManager.kLeft
308 self.fTextIncline = omr.MUIDrawManager.kInclineNormal
309 self.fTextWeight = omr.MUIDrawManager.kWeightBold
310 self.fTextStretch = omr.MUIDrawManager.kStretchUnstretched
312 self.fTextBoxSize = [0, 0]
313 self.fTextBoxColor = om.MColor((0., 1., 1., 1.))
317 self.fLineStartPoint = om.MPoint(0.0, 0.0, 0.0)
318 self.fLineEndPoint = om.MPoint(1.0, 1.0, 1.0)
320 self.fRectUp = om.MVector(0.0, 1.0, 0.0)
321 self.fRectNormal = om.MVector(0.0, 0.0, 1.0)
322 self.fRectScale = [1., 1.]
324 self.fQuadVertex = [ om.MPoint(0.0, 0.0, 0.0), om.MPoint(1.0, 0.0, 0.0), om.MPoint(1.0, 1.0, 0.0), om.MPoint(0.0, 1.0, 0.0) ]
326 self.fCircleNormal = om.MVector(0.0, 0.0, 1.0)
328 self.fArcStart = om.MVector(1.0, 0.0, 0.0)
329 self.fArcEnd = om.MVector(0.0, 1.0, 0.0)
330 self.fArcNormal = om.MVector(0.0, 0.0, 1.0)
334 class uiDrawManagerDrawOverride(omr.MPxDrawOverride):
335 def __init__(self, obj):
336 omr.MPxDrawOverride.__init__(self, obj,
None)
340 return uiDrawManagerDrawOverride(obj)
342 def supportedDrawAPIs(self):
343 return (omr.MRenderer.kOpenGL | omr.MRenderer.kDirectX11 | omr.MRenderer.kOpenGLCoreProfile)
345 def isBounded(self, objPath, cameraPath):
348 def boundingBox(self, objPath, cameraPath):
349 return om.MBoundingBox()
351 def prepareForDraw(self, objPath, cameraPath, frameContext, oldData):
353 if not isinstance(data, uiDrawManagerData):
354 data = uiDrawManagerData()
356 uiDrawManagerNode = objPath.node()
357 if uiDrawManagerNode.isNull():
361 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aUIType)
362 data.fUIType = plug.asShort()
366 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aSelectability)
367 data.fSelectability = plug.asShort()
370 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aPrimitiveColor)
372 nData = om.MFnNumericData(o)
373 data.fColor = om.MColor(nData.getData())
376 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aPrimitiveTransparency)
377 data.fColor.a = 1.0 - plug.asFloat()
380 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aLineWidth)
381 data.fLineWidth = plug.asFloat()
384 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aLineStyle)
385 data.fLineStyle = plug.asShort()
388 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aIsFilled)
389 data.fIsFilled = plug.asBool()
392 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aRadius)
393 data.fRadius = plug.asDouble()
396 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aDraw2D)
397 data.fDraw2D = plug.asBool()
400 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aPosition)
402 nData = om.MFnNumericData(o)
403 data.fPosition = om.MPoint(nData.getData())
404 data.fPosition.w = 1.0
406 if data.fUIType == kText:
408 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aText)
409 data.fText = plug.asString()
412 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextFontSize)
413 data.fTextFontSize = max(plug.asInt(), 0)
416 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aFontFaceName)
417 data.fFontFaceIndex = plug.asInt()
420 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextAlignment)
421 data.fTextAlignment = plug.asShort()
424 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.eTextIncline)
425 data.fTextIncline = plug.asInt()
428 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextWeight)
429 data.fTextWeight = plug.asInt()
432 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextStretch)
433 data.fTextStretch = plug.asInt()
436 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextLine)
437 data.fTextLine = plug.asInt()
440 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextBoxSize)
442 nData = om.MFnNumericData(o)
443 data.fTextBoxSize = nData.getData()
446 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextBoxColor)
448 nData = om.MFnNumericData(o)
449 data.fTextBoxColor = om.MColor(nData.getData())
452 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aTextBoxTransparency)
453 data.fTextBoxColor.a = 1.0 - plug.asFloat()
455 elif data.fUIType == kPoint:
457 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aPointSize)
458 data.fPointSize = plug.asFloat()
460 elif data.fUIType == kLine:
462 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aLineStartPoint)
464 nData = om.MFnNumericData(o)
465 data.fLineStartPoint = om.MPoint(nData.getData())
466 data.fLineStartPoint.w = 1.0
469 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aLineEndPoint)
471 nData = om.MFnNumericData(o)
472 data.fLineEndPoint = om.MPoint(nData.getData())
473 data.fLineEndPoint.w = 1.0
475 elif data.fUIType == kRect:
477 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aRectUp)
479 nData = om.MFnNumericData(o)
480 data.fRectUp = om.MVector(nData.getData())
483 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aRectNormal)
485 nData = om.MFnNumericData(o)
486 data.fRectNormal = om.MVector(nData.getData())
489 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aRectScale)
491 nData = om.MFnNumericData(o)
492 data.fRectScale = nData.getData()
494 elif data.fUIType == kQuad:
497 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aQuadVertex[i])
499 nData = om.MFnNumericData(o)
500 data.fQuadVertex[i] = om.MPoint(nData.getData())
502 elif data.fUIType == kCircle:
504 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aCircleNormal)
506 nData = om.MFnNumericData(o)
507 data.fCircleNormal = om.MVector(nData.getData())
509 elif data.fUIType == kArc:
511 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aArcStart)
513 nData = om.MFnNumericData(o)
514 data.fArcStart = om.MVector(nData.getData())
517 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aArcEnd)
519 nData = om.MFnNumericData(o)
520 data.fArcEnd = om.MVector(nData.getData())
523 plug = om.MPlug(uiDrawManagerNode, uiDrawManager.aArcNormal)
525 nData = om.MFnNumericData(o)
526 data.fArcNormal = om.MVector(nData.getData())
528 elif data.fUIType == kSphere:
532 sys.stderr.write(
"unhandled ui type.\n")
536 def hasUIDrawables(self):
539 def addUIDrawables(self, objPath, drawManager, frameContext, data):
540 if not isinstance(data, uiDrawManagerData):
543 if data.fUIType == kText:
547 drawManager.beginDrawable(data.fSelectability)
549 drawManager.setColor(data.fColor)
550 drawManager.setFontSize(data.fTextFontSize)
551 drawManager.setFontIncline(data.fTextIncline)
552 drawManager.setFontWeight(data.fTextWeight)
553 drawManager.setFontStretch(data.fTextStretch)
554 drawManager.setFontLine(data.fTextLine)
556 faceName = uiDrawManager.fFontList[data.fFontFaceIndex]
557 drawManager.setFontName(faceName)
559 boxSize = data.fTextBoxSize
560 if boxSize[0] + boxSize[1] == 0:
566 drawManager.text2d(data.fPosition, data.fText, data.fTextAlignment, boxSize, data.fTextBoxColor,
False)
570 drawManager.text(data.fPosition, data.fText, data.fTextAlignment, boxSize, data.fTextBoxColor,
False)
572 drawManager.endDrawable()
574 elif data.fUIType == kLine:
575 drawManager.beginDrawable(data.fSelectability)
577 drawManager.setColor(data.fColor)
578 drawManager.setLineWidth(data.fLineWidth)
579 drawManager.setLineStyle(data.fLineStyle)
582 drawManager.line2d(data.fLineStartPoint, data.fLineEndPoint)
585 drawManager.line(data.fLineStartPoint, data.fLineEndPoint)
587 drawManager.endDrawable()
589 elif data.fUIType == kPoint:
590 drawManager.beginDrawable(data.fSelectability)
592 drawManager.setColor(data.fColor)
593 drawManager.setPointSize(data.fPointSize)
596 drawManager.point2d(data.fPosition)
599 drawManager.point(data.fPosition)
601 drawManager.endDrawable()
603 elif data.fUIType == kRect:
604 drawManager.beginDrawable(data.fSelectability)
606 drawManager.setColor(data.fColor)
607 drawManager.setLineWidth(data.fLineWidth)
608 drawManager.setLineStyle(data.fLineStyle)
614 drawManager.rect2d(data.fPosition, data.fRectUp, data.fRectScale[0], data.fRectScale[1], data.fIsFilled)
618 drawManager.rect(data.fPosition, data.fRectUp, data.fRectNormal, data.fRectScale[0], data.fRectScale[1], data.fIsFilled)
620 drawManager.endDrawable()
622 elif data.fUIType == kQuad:
624 drawManager.beginDrawable(data.fSelectability)
626 drawManager.setColor(data.fColor)
627 drawManager.setLineWidth(data.fLineWidth)
628 drawManager.setLineStyle(data.fLineStyle)
631 mode = omr.MUIDrawManager.kClosedLine
633 mode = omr.MUIDrawManager.kTriStrip
636 position = om.MPointArray()
637 index = om.MUintArray()
639 position.append(data.fQuadVertex[i])
642 if not data.fIsFilled:
647 drawManager.mesh2d(mode, position,
None, index)
650 drawManager.mesh(mode, position,
None,
None, index)
652 drawManager.endDrawable()
654 elif data.fUIType == kSphere:
655 drawManager.beginDrawable(data.fSelectability)
657 drawManager.setColor(data.fColor)
658 drawManager.setLineWidth(data.fLineWidth)
659 drawManager.setLineStyle(data.fLineStyle)
661 drawManager.sphere(data.fPosition, data.fRadius, data.fIsFilled)
663 drawManager.endDrawable()
665 elif data.fUIType == kCircle:
666 drawManager.beginDrawable(data.fSelectability)
668 drawManager.setColor(data.fColor)
669 drawManager.setLineWidth(data.fLineWidth)
670 drawManager.setLineStyle(data.fLineStyle)
674 drawManager.circle2d(data.fPosition, data.fRadius, data.fIsFilled)
677 drawManager.circle(data.fPosition, data.fCircleNormal, data.fRadius, data.fIsFilled)
679 drawManager.endDrawable()
681 elif data.fUIType == kArc:
682 drawManager.beginDrawable(data.fSelectability)
684 drawManager.setColor(data.fColor)
685 drawManager.setLineWidth(data.fLineWidth)
686 drawManager.setLineStyle(data.fLineStyle)
691 drawManager.arc2d(data.fPosition, data.fArcStart, data.fArcEnd, data.fRadius, data.fIsFilled)
696 drawManager.arc(data.fPosition, data.fArcStart, data.fArcEnd, data.fArcNormal, data.fRadius, data.fIsFilled)
698 drawManager.endDrawable()
701 sys.stderr.write(
"unhandled ui type.\n")
704 def initializePlugin(obj):
705 plugin = om.MFnPlugin(obj,
"Autodesk",
"3.0",
"Any")
707 plugin.registerNode(
"uiDrawManager", uiDrawManager.id, uiDrawManager.creator, uiDrawManager.initialize, om.MPxNode.kLocatorNode, uiDrawManager.drawDbClassification)
709 sys.stderr.write(
"Failed to register node\n")
713 omr.MDrawRegistry.registerDrawOverrideCreator(uiDrawManager.drawDbClassification, uiDrawManager.drawRegistrantId, uiDrawManagerDrawOverride.creator)
715 sys.stderr.write(
"Failed to register override\n")
718 def uninitializePlugin(obj):
719 plugin = om.MFnPlugin(obj)
721 plugin.deregisterNode(uiDrawManager.id)
723 sys.stderr.write(
"Failed to deregister node\n")
727 omr.MDrawRegistry.deregisterGeometryOverrideCreator(uiDrawManager.drawDbClassification, uiDrawManager.drawRegistrantId)
729 sys.stderr.write(
"Failed to deregister override\n")