X Tutup
Skip to content

Fix animation loop import hints becoming lost#91634

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
jogly:gilley/fix-anim-loop-import
Nov 22, 2025
Merged

Fix animation loop import hints becoming lost#91634
Repiteo merged 1 commit intogodotengine:masterfrom
jogly:gilley/fix-anim-loop-import

Conversation

@jogly
Copy link
Contributor

@jogly jogly commented May 6, 2024

The scene importer settings dialog was not respecting the inferred loop mode of animation clips. As long as the scene is never reimported via the advanced settings dialog, the import settings for clips would be correct. Opening the advanced importer loads all animation settings with their default values, and confirming serializes those values. Even making zero changes will result in the animation clips reverting to all default values losing any import hints.

This change sets expected loop mode based on the clip information when creating AnimationData for a clip.

I confirmed this works as expected now by:

  1. making sure the advanced importer dialog shows Linear mode on first import,
  2. stays Linear on subsequent imports
  3. respects resetting clips to None despite the -loop import hint if set manually
  4. saves clips as looped when setting animation save paths (unrelated to the bug, but just to confirm it really does fix Set Animation Save Paths breaks looping #75912)

Fixes #75912

@jogly jogly requested review from a team as code owners May 6, 2024 20:48
@jogly jogly force-pushed the gilley/fix-anim-loop-import branch from 6ba3d88 to 72c15c5 Compare May 6, 2024 22:21
@jogly jogly force-pushed the gilley/fix-anim-loop-import branch from 72c15c5 to 5337886 Compare May 7, 2024 15:29
@KoBeWi KoBeWi modified the milestones: 4.3, 4.4 Jul 30, 2024
@TokageItLab TokageItLab requested review from fire and lyuma August 26, 2024 03:38
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent about 10 minutes looking around this file reviewing this change. Disclaimer: I'm not an expert in the SceneImportSettingsDialog code.

I looked around to see what was the intention here, to see what is the precedent for handling loading the settings, because I was suspicious as to why similar code did not exist next to this code, and why nothing else was altering the data after it was read from _load_default_subresource_settings.

It seems that the precedent is that... there was no existing code handling the same thing. "settings/loop_mode" is the only thing in here that behaves like this. As far as I can tell this is the only case where we need to round-trip read it back into the settings, because in most cases the dialog is the source of truth, but this is a special case where the animation looping can be set to true without the dialog's help.

Anyway, this seems correct, and the code looks very safe (it only changes the dialog's loop mode setting if it was not already set), so I'm approving this PR.

@Repiteo Repiteo modified the milestones: 4.4, 4.5 Feb 24, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 8, 2025
@Repiteo
Copy link
Contributor

Repiteo commented Nov 18, 2025

This got a bit lost in the folds, could you rebase this PR? See our pull request guidelines for more information

@fire fire moved this to Ready for review in Animation Team Issue Triage Nov 18, 2025
Copy link
Contributor

@lyuma lyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good based on aaron's explanation.

@Repiteo
Copy link
Contributor

Repiteo commented Nov 21, 2025

Just tested locally, and this will actually merge as-is, so I'm gonna say this is good to go!

@Repiteo Repiteo merged commit 3619c68 into godotengine:master Nov 22, 2025
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Animation Team Issue Triage Nov 22, 2025
@Repiteo
Copy link
Contributor

Repiteo commented Nov 22, 2025

Thanks! Congratulations on your first merged contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Set Animation Save Paths breaks looping

7 participants

X Tutup