Skip to content

Commit e3c5e79

Browse files
committed
avoid pymel import issue by using cmds for getPanel
1 parent 2872c4d commit e3c5e79

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ Once installed, the result should look like this:
2424
- [Quick Menus](/src/workflowtools/scripts/quickmenus/README.md)
2525
- [Resetter](/src/workflowtools/scripts/resetter/README.md)
2626
- [RMB Menu Hook](/src/workflowtools/scripts/rmbmenuhook/README.md)
27-
28-
## Known Issues
29-
30-
PyMel contains a bug that prevents using some commands in Python 3 due to old-style dynamic imports. This will cause issues when trying to run some functionality in the workflowtools. [This pull request](https://github.com/LumaPictures/pymel/pull/445) fixes issues, and is a fix you can make to the installed version of PyMel.

src/workflowtools/scripts/quickmenus/core.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
import logging
33

4+
from maya import cmds
45
import pymel.core as pm
56
import rmbmenuhook
67

@@ -317,9 +318,9 @@ def __init__(self):
317318
# variable to keep track of if this menu ever showed
318319
self.wasInvoked = False
319320
# the panel that the popup menu will be attached to
320-
self.panel = pm.getPanel(underPointer=True)
321+
self.panel = cmds.getPanel(underPointer=True)
321322
# the panel type, can be used when building to determine the menu's contents
322-
self.panelType = pm.getPanel(typeOf=self.panel)
323+
self.panelType = cmds.getPanel(typeOf=self.panel)
323324
LOG.debug("Panel: " + self.panel + ", Panel Type: " + self.panelType)
324325

325326
# the unique id for this popup menu, must be overridden in subclasses
@@ -390,9 +391,9 @@ class RMBMarkingMenu(rmbmenuhook.Menu):
390391
def __init__(self, menu, obj=None):
391392
rmbmenuhook.Menu.__init__(self, menu, obj)
392393
# the panel that the popup menu will be attached to
393-
self.panel = pm.getPanel(up=True)
394+
self.panel = cmds.getPanel(underPointer=True)
394395
# the panel type, can be used when building to determine the menu's contents
395-
self.panelType = pm.getPanel(typeOf=self.panel)
396+
self.panelType = cmds.getPanel(typeOf=self.panel)
396397

397398
def build(self):
398399
"""

0 commit comments

Comments
 (0)