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

Function add_node_parent

perro_editor/res/scripts/scene/editor_nodes.rs:1023–1041  ·  view source on GitHub ↗
(
    doc: &SceneDoc,
    selected_key: Option<u32>,
    as_sibling: bool,
)

Source from the content-addressed store, hash-verified

1021 doc.normalize_links();
1022 set_state_scene_doc(state, &doc);
1023 state.selected_key = Some(next_id);
1024 state.add_node_as_sibling = false;
1025 push_recent_node_type(state, node_type.name());
1026 if let Some(mode) = viewport_mode_for_node_type(node_type) {
1027 state.viewport_mode = mode.to_string();
1028 }
1029 state.dirty = true;
1030 if let Some(path) = state.open_paths.get(state.active_open).cloned()
1031 && !state.dirty_scene_paths.iter().any(|item| item == &path)
1032 {
1033 state.dirty_scene_paths.push(path);
1034 }
1035 state.log = match auto_bind {
1036 Some(binding) => format!("add node\n{name}: {}\n{binding}", node_type.name()),
1037 None => format!("add node\n{name}: {}", node_type.name()),
1038 };
1039 msg = state.log.clone();
1040 });
1041 set_log(ctx, &msg);
1042 rebuild_preview(ctx);
1043 refresh_all(ctx);
1044}

Callers 1

picker_parent_node_kindFunction · 0.85

Calls 3

findMethod · 0.80
as_u32Method · 0.45
iterMethod · 0.45

Tested by

no test coverage detected