Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 8
0
def _clearAllClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow
    
    if MainWindow.okCancelDialog("Clear the current network?"):
        coralApp.newNetwork()
Esempio n. 9
0
def _openVisualDebuggerClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("visual debugger")
Esempio n. 10
0
def _openViewportClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("viewport")
Esempio n. 11
0
def _openNodeInspectorClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    MainWindow.openRegisteredWidget("node inspector")
Esempio n. 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")
Esempio n. 13
0
def _aboutClicked():
    from coral.coralUi.mainWindow import MainWindow
    
    mainWin = MainWindow.globalInstance()
    mainWin.about()
Esempio n. 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())
Esempio n. 15
0
def _openScriptEditorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("script editor")
Esempio n. 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())
Esempio n. 17
0
def _openVisualDebuggerClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("visual debugger")
Esempio n. 18
0
def _openViewportClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("viewport")
Esempio n. 19
0
def _openNodeInspectorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("node inspector")
Esempio n. 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")
Esempio n. 21
0
def _aboutClicked():
    from coral.coralUi.mainWindow import MainWindow

    mainWin = MainWindow.globalInstance()
    mainWin.about()
Esempio n. 22
0
def _clearAllClicked():
    from coral import coralApp
    from coral.coralUi.mainWindow import MainWindow

    if MainWindow.okCancelDialog("Clear the current network?"):
        coralApp.newNetwork()
Esempio n. 23
0
def _openScriptEditorClicked():
    from coral.coralUi.mainWindow import MainWindow

    MainWindow.openRegisteredWidget("script editor")