diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 11:21:12 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 11:21:12 -0300 |
commit | 3c33b705d1348aab082317126b94fc445960b8ae (patch) | |
tree | c93b52a78546cbeb976457ba4b97c07a2f1f7475 /tools/editor | |
parent | 5e2f327d4beadf98fa9f2af30882e18fb817249a (diff) |
added option to add_child, to use the same deduplication convention as in the editor, closes #3017
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/animation_editor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 4ccb612a39..b8aa5874d1 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -961,7 +961,7 @@ void AnimationKeyEditor::_cleanup_animation(Ref<Animation> p_animation) { Object *obj=NULL; RES res; - Node *node = root->get_node_and_resource(animation->track_get_path(i),res); + Node *node = root->get_node_and_resource(p_animation->track_get_path(i),res); if (res.is_valid()) { obj=res.ptr(); @@ -969,32 +969,32 @@ void AnimationKeyEditor::_cleanup_animation(Ref<Animation> p_animation) { obj=node; } - if (obj && animation->track_get_type(i)==Animation::TYPE_VALUE) { - valid_type=obj->get_static_property_type(animation->track_get_path(i).get_property(),&prop_exists); + if (obj && p_animation->track_get_type(i)==Animation::TYPE_VALUE) { + valid_type=obj->get_static_property_type(p_animation->track_get_path(i).get_property(),&prop_exists); } if (!obj && cleanup_tracks->is_pressed()) { - animation->remove_track(i); + p_animation->remove_track(i); i--; continue; } - if (!prop_exists || animation->track_get_type(i)!=Animation::TYPE_VALUE || cleanup_keys->is_pressed()==false) + if (!prop_exists || p_animation->track_get_type(i)!=Animation::TYPE_VALUE || cleanup_keys->is_pressed()==false) continue; - for(int j=0;j<animation->track_get_key_count(i);j++) { + for(int j=0;j<p_animation->track_get_key_count(i);j++) { - Variant v = animation->track_get_key_value(i,j); + Variant v = p_animation->track_get_key_value(i,j); if (!Variant::can_convert(v.get_type(),valid_type)) { - animation->track_remove_key(i,j); + p_animation->track_remove_key(i,j); j--; } } - if (animation->track_get_key_count(i)==0 && cleanup_tracks->is_pressed()) { - animation->remove_track(i); + if (p_animation->track_get_key_count(i)==0 && cleanup_tracks->is_pressed()) { + p_animation->remove_track(i); i--; } } |