MCPcopy Create free account
hub / github.com/PerroEngine/Perro / scene_node_badges

Function scene_node_badges

perro_editor/res/scripts/ui/editor_ui.rs:2997–3019  ·  view source on GitHub ↗
(node: &SceneNodeEntry)

Source from the content-addressed store, hash-verified

2995 state.active_glb_summary.clone()
2996 } else {
2997 "GLB asset\nopen row -> inspect meshes/materials/animations".to_string()
2998 };
2999 }
3000 if path.ends_with(".panim") {
3001 return panim_summary(&state.project_root, path);
3002 }
3003 if kind == "script" || (kind == "resource" && !path.ends_with(".panim")) {
3004 return text_asset_preview(&state.project_root, path);
3005 }
3006 if kind == "scene"
3007 && !state.doc_text.is_empty()
3008 && state.open_paths.get(state.active_open).map(String::as_str) == Some(path)
3009 {
3010 let doc = cached_scene_doc_shared(&state.doc_text);
3011 return format!(
3012 "nodes={}\nmode={}",
3013 doc.scene.nodes.len(),
3014 editor_scene::root_viewport_mode(&doc)
3015 );
3016 }
3017 format!("{kind} asset")
3018}
3019
3020pub fn text_asset_preview(project_root: &str, path: &str) -> String {
3021 let abs = res_to_abs(project_root, path);
3022 let Ok(text) = FileMod::load_string(&abs) else {

Callers 3

push_scene_tree_rowFunction · 0.85

Calls 6

selected_node_asset_refsFunction · 0.85
anyMethod · 0.80
scene_field_boolFunction · 0.50
pushMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected