aboutsummaryrefslogtreecommitdiff
path: root/scene/3d/skeleton.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-06-29 18:38:32 -0300
committerJuan Linietsky2016-06-29 18:39:29 -0300
commit449a28e75a57a52df50db2027bfbe18ba3d4a0ac (patch)
treed11f0386b727ce50b37ca3ad8b46ed9b270e5bc2 /scene/3d/skeleton.cpp
parentfe5ee68489ba2a7332fceddebdc1987bd3695276 (diff)
downloadgodot-449a28e75a57a52df50db2027bfbe18ba3d4a0ac.tar.gz
godot-449a28e75a57a52df50db2027bfbe18ba3d4a0ac.tar.zst
godot-449a28e75a57a52df50db2027bfbe18ba3d4a0ac.zip
Diffstat (limited to 'scene/3d/skeleton.cpp')
-rw-r--r--scene/3d/skeleton.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index d0b739e17..c996a8123 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -64,15 +64,17 @@ bool Skeleton::_set(const StringName& p_path, const Variant& p_value) {
else if (what=="bound_childs") {
Array children=p_value;
- bones[which].nodes_bound.clear();
+ if (is_inside_tree()) {
+ bones[which].nodes_bound.clear();
- for (int i=0;i<children.size();i++) {
+ for (int i=0;i<children.size();i++) {
- NodePath path=children[i];
- ERR_CONTINUE( path.operator String()=="" );
- Node *node = get_node(path);
- ERR_CONTINUE(!node);
- bind_child_node_to_bone(which,node);
+ NodePath path=children[i];
+ ERR_CONTINUE( path.operator String()=="" );
+ Node *node = get_node(path);
+ ERR_CONTINUE(!node);
+ bind_child_node_to_bone(which,node);
+ }
}
} else {
return false;