INNER CODE UNIT · Python

exec_tool_async

kevinpbuckley/VibeUE · Content/Python/vibeue.py:348

def exec_tool_async(toolset_name, tool_name, args=None, key=None):
    """Fire a genuinely-async ToolsetRegistry tool and stash its pending result for a later collect.

    Some engine tools (e.g. EditorAppToolset.CaptureAssetImage) never reach is_complete inside one
    execute_python_code call — the editor does not tick mid-script. Fire on one call with this, then
    collect_tool_result(key) on the NEXT call. Args are schema-filled exactly like exec_tool(). The
    raw result object is stored in the module-level _PENDING dict (which persists across calls) under
    `key`, defaulting to "<toolset>.<tool>". Returns the key.
    """
    args = dict(args or {})
    if key is None:
        key = "{}.{}".format(toolset_name, tool_name)
    tool_schema = _find_tool_schema(get_toolset_schema(toolset_name), tool_name)
    if tool_schema is not None:
        _fill_args_from_schema(tool_schema, args)
    _PENDING[key] = unreal.ToolsetRegistry.execute_tool(toolset_name, tool_name, json.dumps(args))
    return key

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…