MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / can_edit

Function can_edit

editor/docks/groups_editor.cpp:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53#include "scene/resources/packed_scene.h"
54
55static bool can_edit(Node *p_node, const String &p_group) {
56 Node *n = p_node;
57 bool can_edit = true;
58 while (n) {
59 Ref<SceneState> ss = (n == EditorNode::get_singleton()->get_edited_scene()) ? n->get_scene_inherited_state() : n->get_scene_instance_state();
60 if (ss.is_valid()) {
61 int path = ss->find_node_by_path(n->get_path_to(p_node));
62 if (path != -1) {
63 if (ss->is_node_in_group(path, p_group)) {
64 can_edit = false;
65 break;
66 }
67 }
68 }
69 n = n->get_owner();
70 }
71 return can_edit;
72}
73
74struct _GroupInfoComparator {
75 bool operator()(const Node::GroupInfo &p_a, const Node::GroupInfo &p_b) const {

Callers 2

_load_scene_groupsMethod · 0.85
_update_treeMethod · 0.85

Calls 8

get_path_toMethod · 0.80
is_node_in_groupMethod · 0.80
get_edited_sceneMethod · 0.45
is_validMethod · 0.45
find_node_by_pathMethod · 0.45
get_ownerMethod · 0.45

Tested by

no test coverage detected