Commit: 8f798afbddfd18c42e94ed1ba89ecf4a78d997c3
Author: Bastien Montagne
Date:   Thu Oct 8 17:18:15 2020 +0200
Branches: master
https://developer.blender.org/rB8f798afbddfd18c42e94ed1ba89ecf4a78d997c3

Cleanup/refactor: move init of MovieClip to proper place.

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

M       source/blender/blenkernel/intern/collection.c
M       source/blender/blenkernel/intern/movieclip.c

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

diff --git a/source/blender/blenkernel/intern/collection.c 
b/source/blender/blenkernel/intern/collection.c
index ed89a964237..b4db33b1c48 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -89,8 +89,6 @@ static void collection_init_data(ID *id)
   BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(collection, id));
 
   MEMCPY_STRUCT_AFTER(collection, DNA_struct_default_get(Collection), id);
-
-  collection->color_tag = COLLECTION_COLOR_NONE;
 }
 
 /**
diff --git a/source/blender/blenkernel/intern/movieclip.c 
b/source/blender/blenkernel/intern/movieclip.c
index 854a421146d..40b12d8a777 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -38,6 +38,8 @@
 /* Allow using deprecated functionality for .blend file I/O. */
 #define DNA_DEPRECATED_ALLOW
 
+#include "DNA_defaults.h"
+
 #include "DNA_constraint_types.h"
 #include "DNA_gpencil_types.h"
 #include "DNA_movieclip_types.h"
@@ -86,6 +88,17 @@
 
 static void free_buffers(MovieClip *clip);
 
+static void movie_clip_init_data(ID *id)
+{
+  MovieClip *movie_clip = (MovieClip *)id;
+  BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(movie_clip, id));
+
+  MEMCPY_STRUCT_AFTER(movie_clip, DNA_struct_default_get(MovieClip), id);
+
+  BKE_tracking_settings_init(&movie_clip->tracking);
+  BKE_color_managed_colorspace_settings_init(&movie_clip->colorspace_settings);
+}
+
 static void movie_clip_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID 
*id_src, const int flag)
 {
   MovieClip *movie_clip_dst = (MovieClip *)id_dst;
@@ -335,7 +348,7 @@ IDTypeInfo IDType_ID_MC = {
     .translation_context = BLT_I18NCONTEXT_ID_MOVIECLIP,
     .flags = 0,
 
-    .init_data = NULL,
+    .init_data = movie_clip_init_data,
     .copy_data = movie_clip_copy_data,
     .free_data = movie_clip_free_data,
     .make_local = NULL,
@@ -923,19 +936,6 @@ static MovieClip *movieclip_alloc(Main *bmain, const char 
*name)
 
   clip = BKE_id_new(bmain, ID_MC, name);
 
-  clip->aspx = clip->aspy = 1.0f;
-
-  BKE_tracking_settings_init(&clip->tracking);
-  BKE_color_managed_colorspace_settings_init(&clip->colorspace_settings);
-
-  clip->proxy.build_size_flag = IMB_PROXY_25;
-  clip->proxy.build_tc_flag = IMB_TC_RECORD_RUN | IMB_TC_FREE_RUN |
-                              IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN | 
IMB_TC_RECORD_RUN_NO_GAPS;
-  clip->proxy.quality = 90;
-
-  clip->start_frame = 1;
-  clip->frame_offset = 0;
-
   return clip;
 }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to