diff options
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r-- | editor/animation_track_editor.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 19e0647fb7..0c2b230786 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1400,12 +1400,26 @@ void AnimationTimelineEdit::_anim_loop_pressed() { undo_redo->add_undo_method(this, "update_values"); undo_redo->commit_action(); } else { - String base_path = animation->get_path(); - if (FileAccess::exists(base_path + ".import")) { - EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from imported scene.")); + String base = animation->get_path(); + int srpos = base.find("::"); + if (srpos != -1) { + base = animation->get_path().substr(0, srpos); + } + + if (FileAccess::exists(base + ".import")) { + if (ResourceLoader::get_resource_type(base) == "PackedScene") { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported scene.\n\nTo change this animation's loop mode, navigate to the scene's Advanced Import settings and select the animation.\nYou can then change the loop mode from the inspector menu.")); + } else { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation instanced from an imported resource.")); + } } else { - EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene.")); + if (ResourceLoader::get_resource_type(base) == "PackedScene") { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another scene.\n\nYou must open this scene and change the animation's loop mode from there.")); + } else { + EditorNode::get_singleton()->show_warning(TTR("Can't change loop mode on animation embedded in another resource.")); + } } + update_values(); } } |