Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::editor_actions Struct Reference

#include <editor_actions.h>

Static Public Member Functions

static auto new_scene (rtti::context &ctx) -> bool
 
static auto open_scene (rtti::context &ctx) -> bool
 
static auto open_scene_from_asset (rtti::context &ctx, const asset_handle< scene_prefab > &asset) -> bool
 
static auto save_scene (rtti::context &ctx) -> bool
 
static auto save_scene_as (rtti::context &ctx) -> bool
 
static auto prompt_save_scene (rtti::context &ctx, const std::function< void()> &on_continue) -> bool
 
static auto load_scene_from_asset (rtti::context &ctx, const asset_handle< scene_prefab > &asset, std::string *error=nullptr) -> bool
 Non-modal scene load (shared by File menu + MCP). Clears edit state, loads asset, syncs prefabs, clears unsaved flag, and updates project opened_scene. Returns false on failure.
 
static auto new_scene_from_preset (rtti::context &ctx, defaults::scene_preset preset) -> bool
 Non-modal new scene from preset (shared by create-scene modal + MCP). Cancels any pending create-scene modal, builds defaults::create_scene_from_preset, clears opened_scene.
 
static auto save_scene_to_path (rtti::context &ctx, const fs::path &path, bool update_source=true, bool show_notification=true) -> bool
 Atomic-save active scene to path/key. When update_source is true, sets scene.source and project opened_scene. Returns false on play mode or write failure.
 
static auto close_project (rtti::context &ctx) -> bool
 
static auto reload_project (rtti::context &ctx) -> bool
 
static void run_project (const fs::path &executable_path)
 
static auto deploy_project (rtti::context &ctx, const deploy_settings &params) -> std::map< std::string, tpp::shared_future< void > >
 
static auto can_deploy_project (rtti::context &ctx, const deploy_settings &params) -> bool
 
static void recompile_shaders (const std::string &group="")
 
static void recompile_textures (const std::string &group="")
 
static void recompile_ui (const std::string &group="")
 
static void recompile_scripts (const std::string &group="")
 
static void recompile_meshes (const std::string &group="")
 
static void recompile_all (const std::string &group="")
 
static void generate_script_workspace ()
 
static void open_workspace_on_file (const fs::path &file, int line=0)
 
static auto rebuild_reflection_probes (rtti::context &ctx, bool force_full_first_frame=true) -> size_t
 Flags every reflection probe across all loaded scenes for rebuild.
 
static auto can_enter_play (rtti::context &ctx, std::string *error=nullptr) -> bool
 
static auto get_play_state (rtti::context &ctx) -> play_state_info
 
static auto set_play_active (rtti::context &ctx, bool active, bool allow_splash=true, std::string *error=nullptr) -> bool
 
static auto toggle_play (rtti::context &ctx, bool allow_splash=true, std::string *error=nullptr) -> bool
 
static auto set_play_paused (rtti::context &ctx, bool paused, std::string *error=nullptr) -> bool
 
static auto skip_play_frame (rtti::context &ctx, std::string *error=nullptr) -> bool
 
static auto get_selection (rtti::context &ctx) -> selection_info
 
static auto set_selection (rtti::context &ctx, const std::vector< std::string > &entity_ids, bool add=false, std::string *error=nullptr) -> bool
 
static void clear_selection (rtti::context &ctx)
 
static auto get_recent_logs (rtti::context &ctx, level::level_enum min_level, size_t max_count, uint64_t after_id=0) -> std::vector< log_query_entry >
 
static auto inspect_entity (rtti::context &ctx, const std::string &entity_id, bool include_components, std::string *error=nullptr) -> std::string
 
static auto focus_scene_panel (rtti::context &ctx, std::string *error=nullptr) -> bool
 
static auto focus_game_panel (rtti::context &ctx, std::string *error=nullptr) -> bool
 
static auto request_main_window_focus (rtti::context &ctx, std::string *error=nullptr) -> bool
 Focus/raise the OS main window so asset watcher and similar focus-gated work can run (e.g. after MCP creates materials while Cursor has focus).
 
static auto import_files (rtti::context &ctx, const std::vector< std::string > &paths, const fs::path &target_path, bool async=true) -> std::vector< import_files_item >
 Copy external files/folders into target_path (content-browser Import parity).
 
static auto wait_import_jobs (std::vector< import_files_item > &items, std::chrono::milliseconds timeout) -> bool
 Block until all import copy jobs complete or timeout elapses.
 

Detailed Description

Definition at line 61 of file editor_actions.h.

Member Function Documentation

◆ can_deploy_project()

auto unravel::editor_actions::can_deploy_project ( rtti::context & ctx,
const deploy_settings & params ) -> bool
static

Definition at line 1325 of file editor_actions.cpp.

◆ can_enter_play()

auto unravel::editor_actions::can_enter_play ( rtti::context & ctx,
std::string * error = nullptr ) -> bool
static

Definition at line 1874 of file editor_actions.cpp.

◆ clear_selection()

void unravel::editor_actions::clear_selection ( rtti::context & ctx)
static

Definition at line 2044 of file editor_actions.cpp.

◆ close_project()

auto unravel::editor_actions::close_project ( rtti::context & ctx) -> bool
static

Definition at line 1278 of file editor_actions.cpp.

◆ deploy_project()

auto unravel::editor_actions::deploy_project ( rtti::context & ctx,
const deploy_settings & params ) -> std::map<std::string, tpp::shared_future<void>>
static

Definition at line 1335 of file editor_actions.cpp.

◆ focus_game_panel()

auto unravel::editor_actions::focus_game_panel ( rtti::context & ctx,
std::string * error = nullptr ) -> bool
static

Definition at line 2176 of file editor_actions.cpp.

◆ focus_scene_panel()

auto unravel::editor_actions::focus_scene_panel ( rtti::context & ctx,
std::string * error = nullptr ) -> bool
static

Definition at line 2160 of file editor_actions.cpp.

◆ generate_script_workspace()

void unravel::editor_actions::generate_script_workspace ( )
static

Definition at line 1682 of file editor_actions.cpp.

◆ get_play_state()

auto unravel::editor_actions::get_play_state ( rtti::context & ctx) -> play_state_info
static

Definition at line 1893 of file editor_actions.cpp.

◆ get_recent_logs()

auto unravel::editor_actions::get_recent_logs ( rtti::context & ctx,
level::level_enum min_level,
size_t max_count,
uint64_t after_id = 0 ) -> std::vector<log_query_entry>
static

Definition at line 2049 of file editor_actions.cpp.

◆ get_selection()

auto unravel::editor_actions::get_selection ( rtti::context & ctx) -> selection_info
static

Definition at line 1984 of file editor_actions.cpp.

◆ import_files()

auto unravel::editor_actions::import_files ( rtti::context & ctx,
const std::vector< std::string > & paths,
const fs::path & target_path,
bool async = true ) -> std::vector<import_files_item>
static

Copy external files/folders into target_path (content-browser Import parity).

When async is true (default), schedules thread-pool copy jobs and returns immediately — call wait_import_jobs before treating destinations as present. When async is false, copies synchronously and sets each item's future to a ready result (preferred for MCP / automation). Asset compilation remains asynchronous via the asset watcher after files land on disk.

Definition at line 2230 of file editor_actions.cpp.

◆ inspect_entity()

auto unravel::editor_actions::inspect_entity ( rtti::context & ctx,
const std::string & entity_id,
bool include_components,
std::string * error = nullptr ) -> std::string
static

Definition at line 2077 of file editor_actions.cpp.

◆ load_scene_from_asset()

auto unravel::editor_actions::load_scene_from_asset ( rtti::context & ctx,
const asset_handle< scene_prefab > & asset,
std::string * error = nullptr ) -> bool
static

Non-modal scene load (shared by File menu + MCP). Clears edit state, loads asset, syncs prefabs, clears unsaved flag, and updates project opened_scene. Returns false on failure.

Definition at line 1059 of file editor_actions.cpp.

◆ new_scene()

auto unravel::editor_actions::new_scene ( rtti::context & ctx) -> bool
static

Definition at line 1039 of file editor_actions.cpp.

◆ new_scene_from_preset()

auto unravel::editor_actions::new_scene_from_preset ( rtti::context & ctx,
defaults::scene_preset preset ) -> bool
static

Non-modal new scene from preset (shared by create-scene modal + MCP). Cancels any pending create-scene modal, builds defaults::create_scene_from_preset, clears opened_scene.

Definition at line 1091 of file editor_actions.cpp.

◆ open_scene()

auto unravel::editor_actions::open_scene ( rtti::context & ctx) -> bool
static

Definition at line 1162 of file editor_actions.cpp.

◆ open_scene_from_asset()

auto unravel::editor_actions::open_scene_from_asset ( rtti::context & ctx,
const asset_handle< scene_prefab > & asset ) -> bool
static

Definition at line 1190 of file editor_actions.cpp.

◆ open_workspace_on_file()

void unravel::editor_actions::open_workspace_on_file ( const fs::path & file,
int line = 0 )
static

Definition at line 1721 of file editor_actions.cpp.

◆ prompt_save_scene()

auto unravel::editor_actions::prompt_save_scene ( rtti::context & ctx,
const std::function< void()> & on_continue ) -> bool
static

Definition at line 1243 of file editor_actions.cpp.

◆ rebuild_reflection_probes()

auto unravel::editor_actions::rebuild_reflection_probes ( rtti::context & ctx,
bool force_full_first_frame = true ) -> size_t
static

Flags every reflection probe across all loaded scenes for rebuild.

Mirrors Unreal's "Build > Build Reflection Captures" menu. When force_full_first_frame is true, each probe bakes all six faces in a single frame for instant visible results; when false, bakes are time-sliced to avoid editor hitches.

Returns
Number of probes that were flagged.

Definition at line 1859 of file editor_actions.cpp.

◆ recompile_all()

void unravel::editor_actions::recompile_all ( const std::string & group = "")
static

Definition at line 1844 of file editor_actions.cpp.

◆ recompile_meshes()

void unravel::editor_actions::recompile_meshes ( const std::string & group = "")
static

Definition at line 1789 of file editor_actions.cpp.

◆ recompile_scripts()

void unravel::editor_actions::recompile_scripts ( const std::string & group = "")
static

Definition at line 1830 of file editor_actions.cpp.

◆ recompile_shaders()

void unravel::editor_actions::recompile_shaders ( const std::string & group = "")
static

Definition at line 1759 of file editor_actions.cpp.

◆ recompile_textures()

void unravel::editor_actions::recompile_textures ( const std::string & group = "")
static

Definition at line 1774 of file editor_actions.cpp.

◆ recompile_ui()

void unravel::editor_actions::recompile_ui ( const std::string & group = "")
static

Definition at line 1804 of file editor_actions.cpp.

◆ reload_project()

auto unravel::editor_actions::reload_project ( rtti::context & ctx) -> bool
static

Definition at line 1295 of file editor_actions.cpp.

◆ request_main_window_focus()

auto unravel::editor_actions::request_main_window_focus ( rtti::context & ctx,
std::string * error = nullptr ) -> bool
static

Focus/raise the OS main window so asset watcher and similar focus-gated work can run (e.g. after MCP creates materials while Cursor has focus).

Definition at line 2192 of file editor_actions.cpp.

◆ run_project()

void unravel::editor_actions::run_project ( const fs::path & executable_path)
static

Definition at line 1320 of file editor_actions.cpp.

◆ save_scene()

auto unravel::editor_actions::save_scene ( rtti::context & ctx) -> bool
static

Definition at line 1202 of file editor_actions.cpp.

◆ save_scene_as()

auto unravel::editor_actions::save_scene_as ( rtti::context & ctx) -> bool
static

Definition at line 1234 of file editor_actions.cpp.

◆ save_scene_to_path()

auto unravel::editor_actions::save_scene_to_path ( rtti::context & ctx,
const fs::path & path,
bool update_source = true,
bool show_notification = true ) -> bool
static

Atomic-save active scene to path/key. When update_source is true, sets scene.source and project opened_scene. Returns false on play mode or write failure.

Definition at line 1113 of file editor_actions.cpp.

◆ set_play_active()

auto unravel::editor_actions::set_play_active ( rtti::context & ctx,
bool active,
bool allow_splash = true,
std::string * error = nullptr ) -> bool
static

Definition at line 1925 of file editor_actions.cpp.

◆ set_play_paused()

auto unravel::editor_actions::set_play_paused ( rtti::context & ctx,
bool paused,
std::string * error = nullptr ) -> bool
static

Definition at line 1946 of file editor_actions.cpp.

◆ set_selection()

auto unravel::editor_actions::set_selection ( rtti::context & ctx,
const std::vector< std::string > & entity_ids,
bool add = false,
std::string * error = nullptr ) -> bool
static

Definition at line 2002 of file editor_actions.cpp.

◆ skip_play_frame()

auto unravel::editor_actions::skip_play_frame ( rtti::context & ctx,
std::string * error = nullptr ) -> bool
static

Definition at line 1961 of file editor_actions.cpp.

◆ toggle_play()

auto unravel::editor_actions::toggle_play ( rtti::context & ctx,
bool allow_splash = true,
std::string * error = nullptr ) -> bool
static

Definition at line 1935 of file editor_actions.cpp.

◆ wait_import_jobs()

auto unravel::editor_actions::wait_import_jobs ( std::vector< import_files_item > & items,
std::chrono::milliseconds timeout ) -> bool
static

Block until all import copy jobs complete or timeout elapses.

Returns
true when every job finished successfully within timeout.

Definition at line 2295 of file editor_actions.cpp.


The documentation for this struct was generated from the following files: