[Bf-blender-cvs] [f765e0cd21c] master: Remove Deform Delay armature option

Sergey Sharybin noreply at git.blender.org
Fri Jun 7 10:47:26 CEST 2019


Commit: f765e0cd21c29e0a8130ab719ddaa989d85fd4ce
Author: Sergey Sharybin
Date:   Fri Jun 7 10:44:18 2019 +0200
Branches: master
https://developer.blender.org/rBf765e0cd21c29e0a8130ab719ddaa989d85fd4ce

Remove Deform Delay armature option

This option can not be supported by a new granular dependency graph,
and, especially, copy-on-write.

It was always doing full update ever since initial commit of new dependency
graph which we are using here in the studio for the past years and lack of
this option was never brought up.

Fixes T65557: Delay refresh option in armatures is broken

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

M	release/scripts/startup/bl_ui/properties_data_armature.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/makesdna/DNA_armature_types.h
M	source/blender/makesrna/intern/rna_armature.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index a87f09b4699..9df767d50c7 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -96,8 +96,6 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
         if ob:
             col = flow.column()
             col.prop(ob, "show_in_front", text="In Front")
-        col = flow.column()
-        col.prop(arm, "use_deform_delay", text="Delay Refresh")
 
 
 class DATA_MT_bone_group_context_menu(Menu):
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 152cde0c0dc..8d0c41674e0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3068,8 +3068,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
 
     LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
-      arm->flag &= ~(ARM_FLAG_UNUSED_1 | ARM_FLAG_UNUSED_5 | ARM_FLAG_UNUSED_7 |
-                     ARM_FLAG_UNUSED_12);
+      arm->flag &= ~(ARM_FLAG_UNUSED_1 | ARM_FLAG_UNUSED_5 | ARM_FLAG_UNUSED_6 |
+                     ARM_FLAG_UNUSED_7 | ARM_FLAG_UNUSED_12);
     }
 
     LISTBASE_FOREACH (Text *, text, &bmain->texts) {
@@ -3506,5 +3506,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                                             COLLECTION_RESTRICT_RENDER);
       }
     }
+
+    LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
+      arm->flag &= ~(ARM_FLAG_UNUSED_6);
+    }
   }
 }
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index 4bcfdc700b3..96ba6212992 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1165,16 +1165,7 @@ static void poselib_preview_apply(bContext *C, wmOperator *op)
       RNA_int_set(op->ptr, "pose_index", -2); /* -2 means don't apply any pose */
     }
 
-    /* old optimize trick... this enforces to bypass the depsgraph
-     * - note: code copied from transform_generics.c -> recalcData()
-     */
-    // FIXME: shouldn't this use the builtin stuff?
-    if ((pld->arm->flag & ARM_DELAYDEFORM) == 0) {
-      DEG_id_tag_update(&pld->ob->id, ID_RECALC_GEOMETRY); /* sets recalc flags */
-    }
-    else {
-      BKE_pose_where_is(CTX_data_depsgraph(C), pld->scene, pld->ob);
-    }
+    DEG_id_tag_update(&pld->ob->id, ID_RECALC_GEOMETRY);
   }
 
   /* do header print - if interactively previewing */
@@ -1709,7 +1700,6 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
   Scene *scene = pld->scene;
   Object *ob = pld->ob;
   bPose *pose = pld->pose;
-  bArmature *arm = pld->arm;
   bAction *act = pld->act;
   TimeMarker *marker = pld->marker;
 
@@ -1724,15 +1714,7 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
   if (pld->state == PL_PREVIEW_CANCEL) {
     poselib_backup_restore(pld);
 
-    /* old optimize trick... this enforces to bypass the depgraph
-     * - note: code copied from transform_generics.c -> recalcData()
-     */
-    if ((arm->flag & ARM_DELAYDEFORM) == 0) {
-      DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); /* sets recalc flags */
-    }
-    else {
-      BKE_pose_where_is(CTX_data_depsgraph(C), scene, ob);
-    }
+    DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
   }
   else if (pld->state == PL_PREVIEW_CONFIRM) {
     /* tag poses as appropriate */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 19a61e1daa7..2dad3aef320 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -7426,12 +7426,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 
     FOREACH_TRANS_DATA_CONTAINER (t, tc) {
 
-      bArmature *arm;
       bPoseChannel *pchan;
       short targetless_ik = 0;
 
       ob = tc->poseobj;
-      arm = ob->data;
 
       if ((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) {
         /* when running transform non-interactively (operator exec),
@@ -7470,14 +7468,6 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
         autokeyframe_pose(C, t->scene, ob, t->mode, targetless_ik);
         DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
       }
-      else if (arm->flag & ARM_DELAYDEFORM) {
-        /* TODO(sergey): Armature is already updated by recalcData(), so we
-         * might save some time by skipping re-evaluating it. But this isn't
-         * possible yet within new dependency graph, and also other contexts
-         * might need to update their CoW copies.
-         */
-        DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
-      }
       else {
         DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
       }
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index d6c09716a63..4a9584ed9be 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1046,7 +1046,6 @@ static void recalcData_objects(TransInfo *t)
 
     FOREACH_TRANS_DATA_CONTAINER (t, tc) {
       Object *ob = tc->poseobj;
-      bArmature *arm = ob->data;
       bPose *pose = ob->pose;
 
       if (pose->flag & POSE_MIRROR_EDIT) {
@@ -1083,15 +1082,7 @@ static void recalcData_objects(TransInfo *t)
         BLI_gset_insert(motionpath_updates, ob);
       }
 
-      /* old optimize trick... this enforces to bypass the depgraph */
-      if (!(arm->flag & ARM_DELAYDEFORM)) {
-        DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); /* sets recalc flags */
-        /* transformation of pose may affect IK tree, make sure it is rebuilt */
-        BIK_clear_data(ob->pose);
-      }
-      else {
-        BKE_pose_where_is(t->depsgraph, t->scene, ob);
-      }
+      DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
     }
 
     /* Update motion paths once for all transformed bones in an object. */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 589b657e5b8..088fd96a5ae 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -147,7 +147,7 @@ typedef enum eArmature_Flag {
   ARM_DRAWNAMES = (1 << 3),
   ARM_POSEMODE = (1 << 4),
   ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
-  ARM_DELAYDEFORM = (1 << 6),
+  ARM_FLAG_UNUSED_6 = (1 << 6), /* cleared */
   ARM_FLAG_UNUSED_7 = (1 << 7),
   ARM_MIRROR_EDIT = (1 << 8),
   ARM_FLAG_UNUSED_9 = (1 << 9),
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index d0081894c41..c470cbeb090 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -1411,12 +1411,6 @@ static void rna_def_armature(BlenderRNA *brna)
   RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
   RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
 
-  prop = RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
-  RNA_def_property_ui_text(
-      prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
-  RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
   prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
   RNA_def_property_ui_text(



More information about the Bf-blender-cvs mailing list