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)
def mouseReleaseEvent(self, event): super(Pipe, self).mouseReleaseEvent(event) if self.isFloat: scene = self.scene() with GraphState.stopLiveUpdate(): self._unFloatSelf(event) scene.liveUpdateRequired()
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()
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 = []
def _loadSceneFromXml(self, xmlString): self.view._floatWidget.switchButton.setFormat('ung') with GraphState.stopLiveUpdate(): self.pasteNodesFromXml(xmlString, selected=False)
def deleteSelection(self): with GraphState.stopLiveUpdate(): self._deleteSelection() self.liveUpdateRequired()
def mousePressEvent(self, event): if event.button() == QtCore.Qt.LeftButton: with GraphState.stopLiveUpdate(): self._floatSelf(event) else: super(Pipe, self).mousePressEvent(event)
def mouseReleaseEvent(self, event): if event.button() == QtCore.Qt.LeftButton and self.findingPort: with GraphState.stopLiveUpdate(): self._connectToFoundPort(event) self.scene().liveUpdateRequired()
def resetScene(self): with GraphState.stopLiveUpdate(): self._resetScene()