[Bf-blender-cvs] [4d09a692e22] blender-v3.0-release: Fix T92847: Meta-strip corrupt

Richard Antalik noreply at git.blender.org
Fri Nov 19 06:17:53 CET 2021


Commit: 4d09a692e22add0a8341916d2d79a594bff076a3
Author: Richard Antalik
Date:   Fri Nov 19 06:10:26 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB4d09a692e22add0a8341916d2d79a594bff076a3

Fix T92847: Meta-strip corrupt

Offsets for meta strip were invalid. No steps to reproduce the issue are
available, but it is quite possible that there are files with incorrect
state after issues with meta strips were fixed.

Ensure correct offsets for meta strips in versioning code.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13257

===================================================================

M	source/blender/blenloader/intern/versioning_300.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 9009eb36585..f8a46f205d4 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -68,6 +68,7 @@
 
 #include "SEQ_iterator.h"
 #include "SEQ_sequencer.h"
+#include "SEQ_time.h"
 
 #include "RNA_access.h"
 
@@ -1272,6 +1273,15 @@ static void version_geometry_nodes_set_position_node_offset(bNodeTree *ntree)
   }
 }
 
+static bool version_fix_seq_meta_range(Sequence *seq, void *user_data)
+{
+  Scene *scene = (Scene *)user_data;
+  if (seq->type == SEQ_TYPE_META) {
+    SEQ_time_update_meta_strip_range(scene, seq);
+  }
+  return true;
+}
+
 /* NOLINTNEXTLINE: readability-function-size */
 void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
 {
@@ -2193,5 +2203,14 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
         }
       }
     }
+
+    LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+      Editing *ed = SEQ_editing_get(scene);
+      /* Make sure range of meta strips is correct.
+       * It was possible to save .blend file with incorrect state of meta strip
+       * range. The root cause is expected to be fixed, but need to ensure files
+       * with invalid meta strip range are corrected. */
+      SEQ_for_each_callback(&ed->seqbase, version_fix_seq_meta_range, scene);
+    }
   }
 }



More information about the Bf-blender-cvs mailing list