Пример #1
0
def _saveAsNetworkClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    filename = MainWindow.saveFileDialog("save network file", "Coral Network (*.crl)")
    if filename:
        coralApp.saveNetworkFile(filename)
Пример #2
0
def _openNetworkClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    filename = MainWindow.openFileDialog("open network file", "Coral Network (*.crl)")
    if filename:
        coralApp.openNetworkFile(filename)
Пример #3
0
def _openNetworkClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    filename = MainWindow.openFileDialog("open network file", "Coral Network (*.crl)")
    if filename:
        coralApp.openNetworkFile(filename)
Пример #4
0
def _saveNetworkClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    filename = MainWindow.saveFileDialog("save network file", "Coral Network (*.crl)")
    if filename:
        coralApp.saveNetworkFile(filename)
Пример #5
0
def _saveCollapsedNodeClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    
    filename = MainWindow.saveFileDialog("save collapsed node", "Coral CollapsedNode (*.py)")
    sel = NodeEditor.selectedNodes()
    if filename and sel:
        coralApp.saveCollapsedNodeFile(sel[0], filename)
Пример #6
0
def _saveNetworkClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow

    filename = coralApp.CoralAppData.currentNetworkDir
    if filename == "":
        filename = MainWindow.saveFileDialog("save network file", "Coral Network (*.crl)")
    if filename:
        coralApp.saveNetworkFile(filename)
Пример #7
0
def _saveCollapsedNodeClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    
    filename = MainWindow.saveFileDialog("save collapsed node", "Coral CollapsedNode (*.py)")
    sel = NodeEditor.selectedNodes()
    if filename and sel:
        coralApp.saveCollapsedNodeFile(sel[0], filename)
Пример #8
0
def _clearAllClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    if MainWindow.okCancelDialog("Clear the current network?"):
        coralApp.newNetwork()
Пример #9
0
def _openVisualDebuggerClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("visual debugger")
Пример #10
0
def _openViewportClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("viewport")
Пример #11
0
def _openNodeInspectorClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("node inspector")
Пример #12
0
def _openNodeBoxClicked():
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeBox import NodeBox
    
    if NodeBox.globalInstance() is None:
        MainWindow.openRegisteredWidget("node box")
Пример #13
0
def _aboutClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    mainWin = MainWindow.globalInstance()
    mainWin.about()
Пример #14
0
def apply():
    #imports here to avoid cycles
    from coral.coralUi import coralUi
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral.coralUi.nodeBox import NodeBox
    from coral.coralUi.nodeInspector.nodeInspector import NodeInspector
    from coral.coralUi.scriptEditor import ScriptEditor
    from coral.coralUi.viewport import ViewportWidget
    from coral.coralUi.visualDebugger import VisualDebugger
    
    coralUi.application().setApplicationName("coralMaya")
    
    mainWin = MainWindow.globalInstance()
    mainWin.setWindowTitle("coralMaya")
    
    nodeBox = NodeBox(mainWin)
    nodeBoxDock = mainWin.dockWidget(nodeBox, QtCore.Qt.LeftDockWidgetArea)
    
    nodeEditor = NodeEditor(mainWin)
    mainWin.setCentralWidget(nodeEditor)
    nodeEditor.nodeView().centerOn(0.0, 0.0)
    
    nodeInspector = NodeInspector(mainWin)
    mainWin.dockWidget(nodeInspector, QtCore.Qt.RightDockWidgetArea)
    
    mainWin.registerWidget("node editor", NodeEditor)
    mainWin.registerWidget("node box", NodeBox)
    mainWin.registerWidget("node inspector", NodeInspector)
    mainWin.registerWidget("viewport", ViewportWidget)
    mainWin.registerWidget("script editor", ScriptEditor)
    mainWin.registerWidget("visual debugger", VisualDebugger)
    
    # menu config
    fileMenu = mainWin.menuBar().addMenu("File")
    fileMenu.addAction("Clear All...", _clearAllClicked)
    fileMenu.addAction("Save Netwok...", _saveNetworkClicked)
    fileMenu.addAction("Open Network...", _openNetworkClicked)
    fileMenu.addSeparator()
    fileMenu.addAction("Save CollapsedNode...", _saveCollapsedNodeClicked)
    
    editMenu = mainWin.menuBar().addMenu("Edit")
    editMenu.addAction("Collpase Nodes", _collapseClicked)
    editMenu.addAction("Explode Collapsed Node", _explodeClicked)
    editMenu.addSeparator()
    
    windowMenu = mainWin.menuBar().addMenu("Window")
    windowMenu.addAction("About", _aboutClicked)
    windowMenu.addAction("Open Node Editor", _openNodeEditorClicked)
    windowMenu.addAction("Open Node Box", _openNodeBoxClicked)
    windowMenu.addAction("Open Node Inspector", _openNodeInspectorClicked)
    windowMenu.addAction("Open Script Editor", _openScriptEditorClicked)
    windowMenu.addAction("Open Viewport", _openViewportClicked)
    windowMenu.addAction("Open Visual Debugger", _openVisualDebuggerClicked)
    
    # shortcuts
    shprtcutsMap = {
        "Shift+G": _explodeClicked,
        "G": _collapseClicked,
        "Ctrl+S": _saveNetworkClicked,
        "Ctrl+O": _openNetworkClicked,
        "Ctrl+X": _clearAllClicked,
        "Tab": _nodeBoxSearch}
    
    mainWin.setShortcutsMap(shprtcutsMap)
    
    mainWin.restoreSettings()
    
    from coral import coralApp
    coralApp.logInfo("running " + mainWin.windowTitle())
Пример #15
0
def _openScriptEditorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("script editor")
Пример #16
0
def apply():
    #imports here to avoid cycles
    from coral.coralUi import coralUi
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeEditor.nodeEditor import NodeEditor
    from coral.coralUi.nodeBox import NodeBox
    from coral.coralUi.nodeInspector.nodeInspector import NodeInspector
    from coral.coralUi.scriptEditor import ScriptEditor
    from coral.coralUi.viewport import ViewportWidget
    from coral.coralUi.visualDebugger import VisualDebugger

    mainWin = MainWindow.globalInstance()
    mainWin.setWindowTitle("coral standalone")

    settingsStored = mainWin.settings().value("settingsStored").toBool()
    if not settingsStored:
        nodeBox = NodeBox(mainWin)
        nodeBoxDock = mainWin.dockWidget(nodeBox, QtCore.Qt.LeftDockWidgetArea)

        nodeInspector = NodeInspector(mainWin)
        mainWin.dockWidget(nodeInspector, QtCore.Qt.RightDockWidgetArea)

    nodeEditor = NodeEditor(mainWin)
    mainWin.setCentralWidget(nodeEditor)
    nodeEditor.nodeView().centerOn(0.0, 0.0)

    mainWin.registerWidget("node editor", NodeEditor)
    mainWin.registerWidget("node box", NodeBox)
    mainWin.registerWidget("node inspector", NodeInspector)
    mainWin.registerWidget("viewport", ViewportWidget)
    mainWin.registerWidget("script editor", ScriptEditor)
    mainWin.registerWidget("visual debugger", VisualDebugger)

    # menu config
    fileMenu = mainWin.menuBar().addMenu("File")
    fileMenu.addAction("Clear All...", _clearAllClicked)
    fileMenu.addAction("Save Netwok...", _saveNetworkClicked)
    fileMenu.addAction("Open Network...", _openNetworkClicked)
    fileMenu.addSeparator()
    fileMenu.addAction("Save CollapsedNode...", _saveCollapsedNodeClicked)

    editMenu = mainWin.menuBar().addMenu("Edit")
    editMenu.addAction("Collpase Nodes", _collapseClicked)
    editMenu.addAction("Explode Collapsed Node", _explodeClicked)
    editMenu.addSeparator()

    windowMenu = mainWin.menuBar().addMenu("Window")
    windowMenu.addAction("About", _aboutClicked)
    windowMenu.addAction("Open Node Editor", _openNodeEditorClicked)
    windowMenu.addAction("Open Node Box", _openNodeBoxClicked)
    windowMenu.addAction("Open Node Inspector", _openNodeInspectorClicked)
    windowMenu.addAction("Open Script Editor", _openScriptEditorClicked)
    windowMenu.addAction("Open Viewport", _openViewportClicked)
    windowMenu.addAction("Open Visual Debugger", _openVisualDebuggerClicked)

    # shortcuts
    shprtcutsMap = {
        "Shift+G": _explodeClicked,
        "Ctrl+S": _saveNetworkClicked,
        "Ctrl+O": _openNetworkClicked,
        "Shift+Tab": _nodeBoxSearch,
        "H": _toggleGrid
    }

    mainWin.setShortcutsMap(shprtcutsMap)

    mainWin.restoreSettings()

    mainWin.show()

    from coral import coralApp
    coralApp.logInfo("coral v" + coralApp.version())
Пример #17
0
def _openVisualDebuggerClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("visual debugger")
Пример #18
0
def _openViewportClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("viewport")
Пример #19
0
def _openNodeInspectorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("node inspector")
Пример #20
0
def _openNodeBoxClicked():
    from coral.coralUi.mainWindow import MainWindow
    from coral.coralUi.nodeBox import NodeBox

    if NodeBox.globalInstance() is None:
        MainWindow.openRegisteredWidget("node box")
Пример #21
0
def _aboutClicked():
    from coral.coralUi.mainWindow import MainWindow

    mainWin = MainWindow.globalInstance()
    mainWin.about()
Пример #22
0
def _clearAllClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow

    if MainWindow.okCancelDialog("Clear the current network?"):
        coralApp.newNetwork()
Пример #23
0
def _openScriptEditorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("script editor")