def init(configModule=None): from nodeEditor.nodeEditor import NodeEditor coralApp.init() CoralUiData.app = QtCore.QCoreApplication.instance() if CoralUiData.app is None: CoralUiData.app = QtGui.QApplication(sys.argv) else: coralApp.logInfo("using existing QApplication") MainWindow._init() NodeEditor._init() import builtinUis loadPluginUiModule(builtinUis) import builtinDrawNodes coralApp.loadPluginModule(builtinDrawNodes) if configModule: configModule.apply() else: MainWindow.globalInstance().show() if os.environ.has_key("CORAL_STARTUP_SCRIPT"): startupScriptFile = os.environ["CORAL_STARTUP_SCRIPT"] if startupScriptFile: utils.runtimeImport(startupScriptFile)
def init(configModule = None): from nodeEditor.nodeEditor import NodeEditor coralApp.init() CoralUiData.app = QtCore.QCoreApplication.instance() if CoralUiData.app is None: CoralUiData.app = QtGui.QApplication(sys.argv) else: coralApp.logInfo("using existing QApplication") MainWindow._init() NodeEditor._init() import builtinUis loadPluginUiModule(builtinUis) import builtinDrawNodes coralApp.loadPluginModule(builtinDrawNodes) if configModule: configModule.apply() if os.environ.has_key("CORAL_STARTUP_SCRIPT"): startupScriptFile = os.environ["CORAL_STARTUP_SCRIPT"] if startupScriptFile: utils.runtimeImport(startupScriptFile)
def loadPluginUiModule(pluginUiModule): from nodeEditor.nodeEditor import NodeEditor from nodeInspector.nodeInspector import NodeInspector pluginUi = pluginUiModule.loadPluginUi() for attributeClassName in pluginUi._registeredAttributeUis.keys(): NodeEditor.registerAttributeUiClass(attributeClassName, pluginUi._registeredAttributeUis[attributeClassName]) for nodeClassName in pluginUi._registeredNodeUis.keys(): NodeEditor.registerNodeUiClass(nodeClassName, pluginUi._registeredNodeUis[nodeClassName]) for nestedObjectClassName in pluginUi._registeredInspectorWidgets.keys(): NodeInspector.registerInspectorWidget(nestedObjectClassName, pluginUi._registeredInspectorWidgets[nestedObjectClassName])
def loadPluginUiModule(pluginUiModule): from nodeEditor.nodeEditor import NodeEditor from nodeInspector.nodeInspector import NodeInspector pluginUi = pluginUiModule.loadPluginUi() for attributeClassName in pluginUi._registeredAttributeUis.keys(): NodeEditor.registerAttributeUiClass( attributeClassName, pluginUi._registeredAttributeUis[attributeClassName]) for nodeClassName in pluginUi._registeredNodeUis.keys(): NodeEditor.registerNodeUiClass( nodeClassName, pluginUi._registeredNodeUis[nodeClassName]) for nestedObjectClassName in pluginUi._registeredInspectorWidgets.keys(): NodeInspector.registerInspectorWidget( nestedObjectClassName, pluginUi._registeredInspectorWidgets[nestedObjectClassName])
def hooksColor(self, specialization): color = QtGui.QColor(100, 100, 100) processedAttributes = [] connectedAttribute = _findFirstConnectedAtributeNonPassThrough(self.coralAttribute(), processedAttributes) if connectedAttribute: connectedAttributeUi = NodeEditor.findAttributeUi(connectedAttribute.id()) if connectedAttributeUi: color = connectedAttributeUi.hooksColor(self.coralAttribute().specialization()) return color
def hooksColor(self, specialization): color = QtGui.QColor(100, 100, 100) processedAttributes = [] connectedAttribute = _findFirstConnectedAtributeNonPassThrough( self.coralAttribute(), processedAttributes) if connectedAttribute: connectedAttributeUi = NodeEditor.findAttributeUi( connectedAttribute.id()) if connectedAttributeUi: color = connectedAttributeUi.hooksColor( self.coralAttribute().specialization()) return color
def _collectNodesToUpdate(self, node, nodesToUpdate, walkedNodes): walkedNodes.append(node) if "ExecutableNode" in node.classNames(): uiNode = weakref.ref(NodeEditor.findNodeUi(node.id())) if uiNode not in nodesToUpdate: nodesToUpdate.append(uiNode) for inputAttr in node.inputAttributes(): connectedInput = inputAttr.input() if connectedInput: parentNode = connectedInput.parent() if parentNode not in walkedNodes: self._collectNodesToUpdate(parentNode, nodesToUpdate, walkedNodes) for childNode in node.nodes(): if childNode not in walkedNodes: self._collectNodesToUpdate(childNode, nodesToUpdate, walkedNodes)
def _includeSelectedNodes(self): coralApp.collapseNodes(NodeEditor.selectedNodes(), collapsedNode = self.coralNode())
def _includeSelectedNodes(self): coralApp.collapseNodes(NodeEditor.selectedNodes(), collapsedNode=self.coralNode())