Exemplo 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)
Exemplo 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)
Exemplo 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])
Exemplo 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])
Exemplo 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
Exemplo 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
Exemplo 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)
Exemplo 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)
Exemplo n.º 9
0
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(), collapsedNode = self.coralNode())
Exemplo n.º 10
0
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(),
                            collapsedNode=self.coralNode())