From 69c29f598ad1a0e3fe99692f0ec3547dfd8feab2 Mon Sep 17 00:00:00 2001 From: xianyu Date: Mon, 14 Sep 2026 17:15:57 +0800 Subject: [PATCH] feat(assets): copy project-relative paths Assisted-by: OpenAI GPT-5 --- RELEASE_NOTES.md | 1 + crates/renzora_asset_browser/src/menus.rs | 19 ++++++++++++++++++- docs/r1-alpha8/engine-core/asset-pipeline.md | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a1ec9830c..47cd461af 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,7 @@ # Renzora Engine `r1-alpha8` ## Unreleased +- feat(editor): asset context menus can copy project-relative paths - feat(marketplace): a plugin states the engine each release was built for, so you are offered the newest version your editor can actually run instead of one that will not load - feat(marketplace): the plugin store hides listings with no release for your engine, and shows the version you would get rather than the newest one published - feat(marketplace): the update check now says when a newer version exists but needs a newer editor, instead of showing nothing diff --git a/crates/renzora_asset_browser/src/menus.rs b/crates/renzora_asset_browser/src/menus.rs index f74787a33..7f7724037 100644 --- a/crates/renzora_asset_browser/src/menus.rs +++ b/crates/renzora_asset_browser/src/menus.rs @@ -8,7 +8,7 @@ use bevy::prelude::*; use renzora_ember::font::EmberFonts; use renzora_ember::widgets::{ - menu_card, menu_header, menu_item, menu_item_styled, menu_sep, screen_menu, + clipboard, menu_card, menu_header, menu_item, menu_item_styled, menu_sep, screen_menu, screen_menu_est_height, screen_menu_flip, screen_menu_under, trigger_rect, }; @@ -300,6 +300,23 @@ pub(crate) fn asset_context_menu( let path = path.clone(); move |_| duplicate_asset(&path) }), + menu_item( + &mut commands, + &fonts, + "clipboard", + &renzora::lang::t("assets.context.copy_path"), + { + let path = path.clone(); + move |world| { + if let Some(relative) = world + .get_resource::() + .and_then(|project| project.make_relative(&path)) + { + clipboard::set_text(&relative); + } + } + }, + ), menu_item(&mut commands, &fonts, "folder-open", &renzora::lang::t("assets.context.reveal"), { let path = path.clone(); move |_| reveal_in_explorer(&path) diff --git a/docs/r1-alpha8/engine-core/asset-pipeline.md b/docs/r1-alpha8/engine-core/asset-pipeline.md index c4603c3d4..162dc5d73 100644 --- a/docs/r1-alpha8/engine-core/asset-pipeline.md +++ b/docs/r1-alpha8/engine-core/asset-pipeline.md @@ -37,6 +37,9 @@ Paths are **project-relative** (e.g. `models/player.glb`) — the custom asset r `AssetRegistryPlugin` walks the project tree **once**, on `OnEnter(SplashState::Loading)`, and records one `AssetEntry` per file. It deliberately does **not** read, decode, or instantiate anything — that stays with Bevy's `AssetServer`. The index powers the asset browser, drag-and-drop previews, and icon picking. +In the Asset Browser, right-click a file or folder and select **Copy Path** to +copy its project-relative path with forward slashes. + ```rust pub struct AssetEntry { pub path: String, // project-relative, e.g. "models/player.glb"