コード例 #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)
コード例 #2
0
ファイル: coralUi.py プロジェクト: BigMacchia/coral-repo
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)
コード例 #3
0
ファイル: coralUi.py プロジェクト: BigMacchia/coral-repo
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])
コード例 #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])
コード例 #5
0
ファイル: builtinUis.py プロジェクト: BigMacchia/coral-repo
 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
コード例 #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
コード例 #7
0
ファイル: builtinUis.py プロジェクト: achayan/coraline
    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)
コード例 #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)
コード例 #9
0
ファイル: builtinUis.py プロジェクト: BigMacchia/coral-repo
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(), collapsedNode = self.coralNode())
コード例 #10
0
 def _includeSelectedNodes(self):
     coralApp.collapseNodes(NodeEditor.selectedNodes(),
                            collapsedNode=self.coralNode())