|
Unravel Engine C++ Reference
|
Classes | |
| struct | json_rpc_request |
| struct | material_apply_result |
| struct | mcp_tool |
| class | mcp_tool_registry |
| struct | tool_result |
| struct | transform_snapshot |
Typedefs | |
| using | tool_handler = std::function<tool_result(rtti::context& ctx, const simdjson::dom::object& args)> |
Functions | |
| auto | wait_for_file (const std::filesystem::path &path, std::chrono::milliseconds timeout, std::chrono::milliseconds poll_interval) -> bool |
| auto | read_file_bytes (const std::filesystem::path &path, std::string &error) -> std::vector< uint8_t > |
| auto | encode_base64 (const std::vector< uint8_t > &bytes) -> std::string |
| auto | make_temp_screenshot_stem (const std::string &tag) -> std::filesystem::path |
| auto | capture_fbo_screenshot (mcp_manager &mcp, rtti::context &ctx, const std::function< gfx::frame_buffer::ptr(rtti::context &)> &resolve_fbo, const std::string &tag, std::chrono::milliseconds wait_timeout) -> tool_result |
| auto | list_material_property_schema_json () -> std::string |
| auto | normalize_material_key (const std::string &path_or_key) -> std::string |
| auto | resolve_material_asset (rtti::context &ctx, const std::string &key, const std::string &uid, std::string &error) -> asset_handle< material > |
| auto | as_pbr_material (const material::sptr &mat, std::string &error) -> std::shared_ptr< pbr_material > |
| auto | material_to_json (const material &mat) -> std::string |
| auto | apply_material_properties (rtti::context &ctx, material::sptr mat, const simdjson::dom::object &properties) -> material_apply_result |
| auto | save_material_asset (rtti::context &ctx, const asset_handle< material > &handle, std::string &error) -> bool |
| auto | json_escape (const std::string &value) -> std::string |
| auto | make_json_string (const std::string &value) -> std::string |
| auto | make_json_rpc_result (const std::optional< std::string > &id_json, const std::string &result_json) -> std::string |
| auto | make_json_rpc_error (const std::optional< std::string > &id_json, int code, const std::string &message) -> std::string |
| auto | make_tool_result (const std::string &text, bool is_error) -> std::string |
| auto | make_tool_result (const tool_result &result) -> std::string |
| auto | parse_json_rpc_request (const std::string &body, json_rpc_request &out, std::string &error) -> bool |
| void | register_scene_tools (mcp_tool_registry ®istry) |
| void | register_scene_batch_tools (mcp_tool_registry ®istry) |
| void | register_ops_batch_tools (mcp_tool_registry ®istry) |
| void | register_asset_tools (mcp_tool_registry ®istry) |
| void | register_viewport_tools (mcp_tool_registry ®istry) |
| void | register_material_tools (mcp_tool_registry ®istry) |
| void | register_project_tools (mcp_tool_registry ®istry) |
| void | register_script_tools (mcp_tool_registry ®istry) |
| void | register_editor_tools (mcp_tool_registry ®istry) |
| auto | entity_id_string (entt::handle entity) -> std::string |
| auto | find_entity (scene &scn, const std::string &id) -> entt::handle |
| auto | require_edit_scene (rtti::context &ctx, scene *&out_scene, std::string &error) -> bool |
| auto | read_string (const simdjson::dom::object &args, const char *key, std::string &out) -> bool |
| auto | read_bool (const simdjson::dom::object &args, const char *key, bool &out) -> bool |
| auto | read_double (const simdjson::dom::object &args, const char *key, double &out) -> bool |
| auto | read_vec3 (const simdjson::dom::object &args, const char *key, math::vec3 &out) -> bool |
| auto | empty_object_schema () -> std::string |
| auto | require_not_play_mode (rtti::context &ctx, std::string &error) -> bool |
| auto | require_open_project (rtti::context &ctx, std::string &error) -> bool |
| auto | read_transform_space (const simdjson::dom::object &args, bool &out_is_local, std::string &error) -> bool |
| Parse transform space: "world" (default) or "local". Returns false on invalid values. | |
| auto | read_transform_snapshot (const simdjson::dom::object &obj, transform_snapshot &out) -> void |
| void | apply_pose_direct (entt::handle entity, const transform_snapshot &pose, bool is_local) |
| auto | read_wait_ms (const simdjson::dom::object &args, int64_t default_ms=1000) -> std::chrono::milliseconds |
| auto | sleep_worker (std::chrono::milliseconds wait_ms) -> void |
| auto | to_lower_ascii (std::string value) -> std::string |
| auto | contains_ci (std::string_view haystack, std::string_view needle) -> bool |
| auto | starts_with (std::string_view value, std::string_view prefix) -> bool |
| auto | bbox_to_json (const math::bbox &bounds) -> std::string |
| auto | normalize_asset_type_filter (std::string type) -> std::string |
| auto | protocol_to_group (const std::string &protocol) -> std::string |
| using unravel::mcp::tool_handler = std::function<tool_result(rtti::context& ctx, const simdjson::dom::object& args)> |
Definition at line 23 of file mcp_tool_registry.h.
| auto unravel::mcp::apply_material_properties | ( | rtti::context & | ctx, |
| material::sptr | mat, | ||
| const simdjson::dom::object & | properties ) -> material_apply_result |
Definition at line 329 of file mcp_material_utils.cpp.
|
inline |
Definition at line 181 of file mcp_tools_common.h.
| auto unravel::mcp::as_pbr_material | ( | const material::sptr & | mat, |
| std::string & | error ) -> std::shared_ptr< pbr_material > |
Definition at line 279 of file mcp_material_utils.cpp.
|
inline |
Definition at line 288 of file mcp_tools_common.h.
| auto unravel::mcp::capture_fbo_screenshot | ( | mcp_manager & | mcp, |
| rtti::context & | ctx, | ||
| const std::function< gfx::frame_buffer::ptr(rtti::context &)> & | resolve_fbo, | ||
| const std::string & | tag, | ||
| std::chrono::milliseconds | wait_timeout = std::chrono::milliseconds(3000) ) -> tool_result |
Action + wait: blit an offscreen FBO color attachment into a READ_BACK texture (bgfx::requestScreenShot only supports window surfaces), wait for GPU readback while frames pump, write PNG, and return an image tool_result.
Definition at line 127 of file mcp_async.cpp.
|
inline |
Definition at line 272 of file mcp_tools_common.h.
|
inline |
Definition at line 119 of file mcp_tools_common.h.
| auto unravel::mcp::encode_base64 | ( | const std::vector< uint8_t > & | bytes | ) | -> std::string |
Definition at line 113 of file mcp_async.cpp.
|
inline |
Definition at line 32 of file mcp_tools_common.h.
|
inline |
Definition at line 37 of file mcp_tools_common.h.
| auto unravel::mcp::json_escape | ( | const std::string & | value | ) | -> std::string |
Definition at line 11 of file mcp_protocol.cpp.
| auto unravel::mcp::list_material_property_schema_json | ( | ) | -> std::string |
Definition at line 200 of file mcp_material_utils.cpp.
| auto unravel::mcp::make_json_rpc_error | ( | const std::optional< std::string > & | id_json, |
| int | code, | ||
| const std::string & | message ) -> std::string |
Definition at line 66 of file mcp_protocol.cpp.
| auto unravel::mcp::make_json_rpc_result | ( | const std::optional< std::string > & | id_json, |
| const std::string & | result_json ) -> std::string |
Definition at line 60 of file mcp_protocol.cpp.
| auto unravel::mcp::make_json_string | ( | const std::string & | value | ) | -> std::string |
Definition at line 55 of file mcp_protocol.cpp.
| auto unravel::mcp::make_temp_screenshot_stem | ( | const std::string & | tag | ) | -> std::filesystem::path |
Definition at line 118 of file mcp_async.cpp.
| auto unravel::mcp::make_tool_result | ( | const std::string & | text, |
| bool | is_error ) -> std::string |
Definition at line 75 of file mcp_protocol.cpp.
| auto unravel::mcp::make_tool_result | ( | const tool_result & | result | ) | -> std::string |
Definition at line 83 of file mcp_protocol.cpp.
| auto unravel::mcp::material_to_json | ( | const material & | mat | ) | -> std::string |
Definition at line 295 of file mcp_material_utils.cpp.
|
inline |
Definition at line 308 of file mcp_tools_common.h.
| auto unravel::mcp::normalize_material_key | ( | const std::string & | path_or_key | ) | -> std::string |
Definition at line 224 of file mcp_material_utils.cpp.
| auto unravel::mcp::parse_json_rpc_request | ( | const std::string & | body, |
| json_rpc_request & | out, | ||
| std::string & | error ) -> bool |
Definition at line 97 of file mcp_protocol.cpp.
|
inline |
Definition at line 356 of file mcp_tools_common.h.
|
inline |
Definition at line 72 of file mcp_tools_common.h.
|
inline |
Definition at line 83 of file mcp_tools_common.h.
| auto unravel::mcp::read_file_bytes | ( | const std::filesystem::path & | path, |
| std::string & | error ) -> std::vector< uint8_t > |
Definition at line 87 of file mcp_async.cpp.
|
inline |
Definition at line 61 of file mcp_tools_common.h.
|
inline |
Definition at line 174 of file mcp_tools_common.h.
|
inline |
Parse transform space: "world" (default) or "local". Returns false on invalid values.
Definition at line 146 of file mcp_tools_common.h.
|
inline |
Definition at line 94 of file mcp_tools_common.h.
|
inline |
Definition at line 234 of file mcp_tools_common.h.
| void unravel::mcp::register_asset_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 212 of file mcp_tools_assets.cpp.
| void unravel::mcp::register_editor_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 83 of file mcp_tools_editor.cpp.
| void unravel::mcp::register_material_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 48 of file mcp_tools_materials.cpp.
| void unravel::mcp::register_ops_batch_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 77 of file mcp_tools_ops_batch.cpp.
| void unravel::mcp::register_project_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 47 of file mcp_tools_projects.cpp.
| void unravel::mcp::register_scene_batch_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 103 of file mcp_tools_scene_batch.cpp.
| void unravel::mcp::register_scene_tools | ( | mcp_tool_registry & | registry | ) |
| void unravel::mcp::register_script_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 126 of file mcp_tools_scripts.cpp.
| void unravel::mcp::register_viewport_tools | ( | mcp_tool_registry & | registry | ) |
Definition at line 184 of file mcp_tools_viewport.cpp.
|
inline |
Definition at line 42 of file mcp_tools_common.h.
|
inline |
Definition at line 124 of file mcp_tools_common.h.
|
inline |
Definition at line 135 of file mcp_tools_common.h.
| auto unravel::mcp::resolve_material_asset | ( | rtti::context & | ctx, |
| const std::string & | key, | ||
| const std::string & | uid, | ||
| std::string & | error ) -> asset_handle< material > |
Definition at line 245 of file mcp_material_utils.cpp.
| auto unravel::mcp::save_material_asset | ( | rtti::context & | ctx, |
| const asset_handle< material > & | handle, | ||
| std::string & | error ) -> bool |
Definition at line 554 of file mcp_material_utils.cpp.
|
inline |
Definition at line 252 of file mcp_tools_common.h.
|
inline |
Definition at line 283 of file mcp_tools_common.h.
|
inline |
Definition at line 260 of file mcp_tools_common.h.
| auto unravel::mcp::wait_for_file | ( | const std::filesystem::path & | path, |
| std::chrono::milliseconds | timeout = std::chrono::milliseconds(3000), | ||
| std::chrono::milliseconds | poll_interval = std::chrono::milliseconds(32) ) -> bool |
Poll until path exists and is non-empty, or timeout elapses. Call from an HTTP/worker thread — never from the main/render thread.
Definition at line 64 of file mcp_async.cpp.