Beispiel #1
0
def start_background_check(*args):
    # print '# Starting publish background check...'
    defer_to_main_thread(_update_buttons, None)

    references = call_in_main_thread(cmds.file, q=True, reference=True)
    geocaches = call_in_main_thread(geocache_utils.get_existing_cache_mappings).keys()
    threading.Thread(target=_background_check, args=[references + geocaches]).start()
Beispiel #2
0
def start_background_check(*args):
    # print '# Starting publish background check...'
    defer_to_main_thread(_update_buttons, None)

    references = call_in_main_thread(cmds.file, q=True, reference=True)
    geocaches = call_in_main_thread(
        geocache_utils.get_existing_cache_mappings).keys()
    threading.Thread(target=_background_check,
                     args=[references + geocaches]).start()
Beispiel #3
0
def requires_maya(func=None, gui=False):

    # Function as a decorator constructor.
    if not func:
        return functools.partial(requires_maya, gui=gui)

    # Start it up.
    if _has_maya and not hasattr(maya_cmds, 'about'):
        from maya import standalone
        standalone.initialize()

    _is_batch = _has_maya and threads.call_in_main_thread(maya_cmds.about, batch=True)

    if not _has_maya or (gui and _is_batch):
        @functools.wraps(func)
        def _skipper(*args, **kwargs):
            from nose.exc import SkipTest
            raise SkipTest
        return _skipper

    # Not in batch mode, so we need to run in the main thread.
    if not _is_batch:
        trampoliner = trampoline.decorate(threads.call_in_main_thread)
        return trampoliner(func)

    # Pass it through.
    return func
Beispiel #4
0
def requires_maya(func=None, gui=False):

    # Function as a decorator constructor.
    if not func:
        return functools.partial(requires_maya, gui=gui)

    # Start it up.
    if _has_maya and not hasattr(maya_cmds, 'about'):
        from maya import standalone
        standalone.initialize()

    _is_batch = _has_maya and threads.call_in_main_thread(maya_cmds.about,
                                                          batch=True)

    if not _has_maya or (gui and _is_batch):

        @functools.wraps(func)
        def _skipper(*args, **kwargs):
            from nose.exc import SkipTest
            raise SkipTest

        return _skipper

    # Not in batch mode, so we need to run in the main thread.
    if not _is_batch:
        trampoliner = trampoline.decorate(threads.call_in_main_thread)
        return trampoliner(func)

    # Pass it through.
    return func