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

Function insert_panim_object

perro_editor/res/scripts/scene/editor_animation.rs:295–304  ·  view source on GitHub ↗
(text: &str, object: &str, node_type: &str)

Source from the content-addressed store, hash-verified

293 if !panim_frame_has_object(&out, 0, object) {
294 out = insert_panim_frame0_object(&out, object);
295 }
296 out
297}
298
299pub fn insert_panim_object(text: &str, object: &str, node_type: &str) -> String {
300 if let Some(pos) = text.find("[/Objects]") {
301 let mut out = String::with_capacity(text.len() + object.len() + node_type.len() + 8);
302 out.push_str(&text[..pos]);
303 out.push_str(&format!("{object} = {node_type}\n"));
304 out.push_str(&text[pos..]);
305 return out;
306 }
307 format!("{text}\n[Objects]\n{object} = {node_type}\n[/Objects]\n")

Callers 1

add_panim_track_textFunction · 0.85

Calls 2

findMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected