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
This commit is contained in:
Sergey Sharybin 2019-06-07 10:44:18 +02:00
parent b290695149
commit f765e0cd21
Notes: blender-bot 2023-02-14 06:23:08 +01:00
Referenced by issue #65557, Delay refresh option in armatures is broken
7 changed files with 10 additions and 51 deletions

View File

@ -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):

View File

@ -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);
}
}
}

View File

@ -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 */

View File

@ -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);
}

View File

@ -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. */

View File

@ -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),

View File

@ -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(