[Bf-blender-cvs] [d794e6874f1] temp-T78835: Remove recently introduced explicit flags

Sergey Sharybin noreply at git.blender.org
Thu Jul 30 17:00:39 CEST 2020


Commit: d794e6874f1f85a8c226da2df930e6df9155f0c8
Author: Sergey Sharybin
Date:   Thu Jul 30 16:53:04 2020 +0200
Branches: temp-T78835
https://developer.blender.org/rBd794e6874f1f85a8c226da2df930e6df9155f0c8

Remove recently introduced explicit flags

After discussion with Brecht it seems to be more semantically correct
to rename NO_MAIN flag to something what resembles copy-on-write process.

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

M	source/blender/blenkernel/BKE_lib_id.h
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/blender/editors/space_sequencer/sequencer_edit.c

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

diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index 6f11b71b4ca..d46a03e90af 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -126,20 +126,6 @@ enum {
   /** Generate a local copy, outside of bmain, to work on (used by COW e.g.). */
   LIB_ID_COPY_LOCALIZE = LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT |
                          LIB_ID_CREATE_NO_DEG_TAG | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_CACHES,
-
-  /* Preserve session UUIDs when doing copy.
-   * Is used by aras dependency graph, or clipboard where placing something to the clipboard does
-   * not need to generate new UUIDs because objects are out of any database and hence no need to
-   * increment UUID counter. */
-  LIB_ID_COPY_KEEP_SESSION_UUID = (1 << 27),
-
-  /* Copying of the ID is requested by the dependency graph's Copy-on_Write mechanism.
-   * In this case some data will be shared between original and copied datablocks. For example:
-   * - Session UUIDs are not re-generated, which makes the dependency graph possible to match
-   *   original and copied data, preserving runtime caches.
-   * - Physics caches are shared between original and copied datablocks, avoiding duplicate of
-   *   the entire cache to appear multiple times in memory. */
-  LIB_ID_COPY_ON_WRITE = (LIB_ID_COPY_KEEP_SESSION_UUID),
 };
 
 void BKE_libblock_copy_ex(struct Main *bmain,
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index f02bdcbb417..1be330ee2ef 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -5672,7 +5672,7 @@ static Sequence *seq_dupli(const Scene *scene_src,
 {
   Sequence *seqn = MEM_dupallocN(seq);
 
-  if ((flag & LIB_ID_COPY_KEEP_SESSION_UUID) == 0) {
+  if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) {
     BKE_sequence_session_uuid_generate(seq);
   }
 
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 6959b4780ad..a4e88f4f8d2 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -289,10 +289,7 @@ bool id_copy_inplace_no_main(const ID *id, ID *newid)
 #endif
 
   bool result = BKE_id_copy_ex(
-      nullptr,
-      (ID *)id_for_copy,
-      &newid,
-      (LIB_ID_COPY_LOCALIZE | LIB_ID_CREATE_NO_ALLOCATE | LIB_ID_COPY_ON_WRITE));
+      nullptr, (ID *)id_for_copy, &newid, (LIB_ID_COPY_LOCALIZE | LIB_ID_CREATE_NO_ALLOCATE));
 
 #ifdef NESTED_ID_NASTY_WORKAROUND
   if (result) {
@@ -318,11 +315,8 @@ bool scene_copy_inplace_no_main(const Scene *scene, Scene *new_scene)
   id_for_copy = nested_id_hack_get_discarded_pointers(&id_hack_storage, &scene->id);
 #endif
 
-  bool result = BKE_id_copy_ex(nullptr,
-                               id_for_copy,
-                               (ID **)&new_scene,
-                               LIB_ID_COPY_LOCALIZE | LIB_ID_CREATE_NO_ALLOCATE |
-                                   LIB_ID_COPY_ON_WRITE);
+  bool result = BKE_id_copy_ex(
+      nullptr, id_for_copy, (ID **)&new_scene, LIB_ID_COPY_LOCALIZE | LIB_ID_CREATE_NO_ALLOCATE);
 
 #ifdef NESTED_ID_NASTY_WORKAROUND
   if (result) {
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index cb5742aef79..1e94b9110ae 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -3377,13 +3377,12 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
   /* NOTE: The UUID is re-generated on paste, so we can keep UUID in the clipboard since
    * nobody can reach them anyway.
    * This reduces chance or running out of UUIDs if a cat falls asleep on Ctrl-C. */
-  BKE_sequence_base_dupli_recursive(
-      scene,
-      scene,
-      &seqbase_clipboard,
-      ed->seqbasep,
-      0,
-      (LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_COPY_KEEP_SESSION_UUID));
+  BKE_sequence_base_dupli_recursive(scene,
+                                    scene,
+                                    &seqbase_clipboard,
+                                    ed->seqbasep,
+                                    0,
+                                    (LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_FREE_NO_MAIN));
 
   seqbase_clipboard_frame = scene->r.cfra;



More information about the Bf-blender-cvs mailing list