예제 #1
0
def startup(restart=False, *args, **kwargs):
    if restart:
        close_all_instances()

    env_inst.ui_super = mf.get_maya_window()

    try:
        main_tab = mf.get_maya_dock_window()[0]
        main_tab.show()
        main_tab.raise_()
        main_tab.raise_window()
    except:

        # def server_ping_agent():
        #     return tc.server_ping()
        #
        # ping_worker, thread_pool = gf.get_thread_worker(
        #     server_ping_agent,
        #     finished_func=lambda: create_ui(None),
        #     error_func=create_ui
        # )
        #
        # thread_pool.start(ping_worker)

        env_inst.start_pools()

        worker = env_inst.server_pool.add_task(tc.server_ping)

        worker.finished.connect(create_ui)
        worker.error.connect(create_ui)
        worker.start()
예제 #2
0
def close_all_instances():
    try:
        main_docks = mf.get_maya_dock_window()
        for dock in main_docks:
            dock.close()
            dock.deleteLater()
            if env_inst.ui_main:
                env_inst.ui_main.close()
    except:
        raise
예제 #3
0
def close_all_instances():

    try:
        main_docks = mf.get_maya_dock_window()
        for dock in main_docks:
            dock.writeSettings()
            dock.close()
            dock.deleteLater()
            if env_inst.ui_main:
                env_inst.ui_main.close()

        if cmds.workspaceControl('TacticHandlerDockWorkspaceControl',
                                 e=True,
                                 exists=True):
            cmds.deleteUI('TacticHandlerDockWorkspaceControl', control=True)
    except:
        raise
예제 #4
0
def startup(restart=False, *args, **kwargs):
    if restart:
        close_all_instances()

    env_inst.ui_super = mf.get_maya_window()

    try:
        main_tab = mf.get_maya_dock_window()[0]
        main_tab.show()
        main_tab.raise_()
    except:

        def server_ping_agent():
            return tc.server_ping()

        ping_worker = gf.get_thread_worker(
            server_ping_agent,
            finished_func=lambda: create_ui(None),
            error_func=create_ui)

        ping_worker.start()
예제 #5
0
def startup(restart=False, hotkeys=None):
    if restart:
        close_all_instances()

    env_inst.ui_super = mf.get_maya_window()

    try:
        main_tab = mf.get_maya_dock_window()[0]
        main_tab.hotkeys_dict = hotkeys
        main_tab.handle_hotkeys()
        main_tab.show()
        main_tab.raise_()
    except:

        def server_ping_agent():
            return tc.server_ping()

        ping_worker = gf.get_thread_worker(
            server_ping_agent,
            finished_func=lambda: create_ui(ping_worker, hotkeys))
        ping_worker.try_start()