Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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])
Esempio n. 4
0
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])
Esempio n. 5
0
 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
Esempio n. 6
0
    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
Esempio n. 7
0
    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)
Esempio n. 8
0
    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)
Esempio n. 9
0
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(), collapsedNode = self.coralNode())
Esempio n. 10
0
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(),
                            collapsedNode=self.coralNode())