Пример #1
0
    def applyChanges(self):
        stage = self._executeAllToStage()

        layerString = stage.GetRootLayer().ExportToString()
        self.layer.ImportFromString(layerString)

        GraphState.executeCallbacks('layerChangesApplied',
                                    layer=self.layer.realPath)
Пример #2
0
    def _loadSceneFromUng(self, ungFile):
        self.view._floatWidget.switchButton.setFormat('ung')

        with open(ungFile, 'r') as f:
            xmlString = f.read()
        with GraphState.stopLiveUpdate():
            self.pasteNodesFromXml(xmlString, selected=False)
Пример #3
0
 def mouseReleaseEvent(self, event):
     super(Pipe, self).mouseReleaseEvent(event)
     if self.isFloat:
         scene = self.scene()
         with GraphState.stopLiveUpdate():
             self._unFloatSelf(event)
         scene.liveUpdateRequired()
Пример #4
0
    def _loadSceneFromLayer(self):
        with GraphState.stopLiveUpdate():
            self.view._floatWidget.switchButton.setFormat('usd')

            primSpec = self.layer.GetPrimAtPath('/')

            rootNode = self.createNode('Root')
            self._addNodeToPrimPath(rootNode, '/')

            self._addLayerNodes(self.layer)
            self._getIntoPrim(primSpec, rootNode)

            # we need to connect shader nodes after all nodes are created
            self._connectShadeNodes()

            self.layoutNodes()
Пример #5
0
    def _connectToFoundPipe(self):
        if len(self.findPipes) > 0:
            with GraphState.stopLiveUpdate():

                for pipe in self.findPipes:
                    source = pipe.source
                    target = pipe.target

                    pipe.breakConnection()

                    self.inputPort.connectTo(source)
                    self.outputPort.connectTo(target)

            self.scene().liveUpdateRequired()

            self.findPipes = []
Пример #6
0
    def _loadSceneFromXml(self, xmlString):
        self.view._floatWidget.switchButton.setFormat('ung')

        with GraphState.stopLiveUpdate():
            self.pasteNodesFromXml(xmlString, selected=False)
Пример #7
0
def isEditable(realPath):
    if GraphState.hasFunction('isFileEditable') and realPath is not None:
        editAble = GraphState.executeFunction('isFileEditable', realPath)
        return editAble
    return True
Пример #8
0
 def liveUpdateRequired(self):
     if GraphState.isLiveUpdate():
         self.applyChanges()
Пример #9
0
 def deleteSelection(self):
     with GraphState.stopLiveUpdate():
         self._deleteSelection()
     self.liveUpdateRequired()
Пример #10
0
 def mousePressEvent(self, event):
     if event.button() == QtCore.Qt.LeftButton:
         with GraphState.stopLiveUpdate():
             self._floatSelf(event)
     else:
         super(Pipe, self).mousePressEvent(event)
Пример #11
0
 def mouseReleaseEvent(self, event):
     if event.button() == QtCore.Qt.LeftButton and self.findingPort:
         with GraphState.stopLiveUpdate():
             self._connectToFoundPort(event)
         self.scene().liveUpdateRequired()
Пример #12
0
 def resetScene(self):
     with GraphState.stopLiveUpdate():
         self._resetScene()