Ejemplo n.º 1
0
    def __init__(self, appController, item):
        PrimContextMenuItem.__init__(self, appController, item)
        from common import GetEnclosingModelPrim

        if len(self._selectionDataModel.getPrims()) == 1:
            self._modelPrim = GetEnclosingModelPrim(
                self._selectionDataModel.getFocusPrim())
        else:
            self._modelPrim = None
Ejemplo n.º 2
0
    def IsEnabled(self):
        from common import GetEnclosingModelPrim

        for p in self._currentNodes:
            if GetEnclosingModelPrim(p) is not None:
                return True
        return False
Ejemplo n.º 3
0
    def IsEnabled(self):
        from common import GetEnclosingModelPrim

        for p in self._selectionDataModel.getPrims():
            if GetEnclosingModelPrim(p) is not None:
                return True
        return False
Ejemplo n.º 4
0
class CopyModelPathMenuItem(NodeContextMenuItem):
    def __init__(self, mainWindow, item):
        NodeContextMenuItem.__init__(self, mainWindow, item)
        from common import GetEnclosingModelPrim

        self._modelPrim = GetEnclosingModelPrim(self._currentNodes[0]) if \
            len(self._currentNodes) == 1 else None

    def IsEnabled(self):
        return self._modelPrim

    def GetText(self):
        name = ("(%s)" % self._modelPrim.GetName()) if self._modelPrim else ""
        return "Copy Enclosing Model %s Path" % name

    def RunCommand(self):
        modelPath = str(self._modelPrim.GetPath())
        cb = QtGui.QApplication.clipboard()
        cb.setText(modelPath, QtGui.QClipboard.Selection)
        cb.setText(modelPath, QtGui.QClipboard.Clipboard)
Ejemplo n.º 5
0
class CopyModelPathMenuItem(PrimContextMenuItem):
    def __init__(self, appController, item):
        PrimContextMenuItem.__init__(self, appController, item)
        from common import GetEnclosingModelPrim

        if len(self._selectionDataModel.getPrims()) == 1:
            self._modelPrim = GetEnclosingModelPrim(
                self._selectionDataModel.getFocusPrim())
        else:
            self._modelPrim = None

    def IsEnabled(self):
        return self._modelPrim

    def GetText(self):
        name = ("(%s)" % self._modelPrim.GetName()) if self._modelPrim else ""
        return "Copy Enclosing Model %s Path" % name

    def RunCommand(self):
        modelPath = str(self._modelPrim.GetPath())
        cb = QtWidgets.QApplication.clipboard()
        cb.setText(modelPath, QtGui.QClipboard.Selection)
        cb.setText(modelPath, QtGui.QClipboard.Clipboard)
Ejemplo n.º 6
0
    def __init__(self, mainWindow, item):
        NodeContextMenuItem.__init__(self, mainWindow, item)
        from common import GetEnclosingModelPrim

        self._modelPrim = GetEnclosingModelPrim(self._currentNodes[0]) if \
            len(self._currentNodes) == 1 else None
Ejemplo n.º 7
0
    def __init__(self, appController, item):
        PrimContextMenuItem.__init__(self, appController, item)
        from common import GetEnclosingModelPrim

        self._modelPrim = GetEnclosingModelPrim(self._currentPrims[0]) if \
            len(self._currentPrims) == 1 else None