Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <mont29>2022-02-03 19:57:40 +0300
committerBastien Montagne <bastien@blender.org>2022-02-04 11:30:44 +0300
commite9fc25835f2091cf6533d92379a31c0656b4aafb (patch)
tree90b4bbfb87172abc08483c91200809d9a2545c8c /source/blender/editors
parent5a4eadc2e7cd607c83f7039609d8a27495efb20a (diff)
Remove internal proxy code, and deprecate related DNA data.
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/pose_edit.c34
-rw-r--r--source/blender/editors/armature/pose_group.c4
-rw-r--r--source/blender/editors/interface/interface_templates.c81
-rw-r--r--source/blender/editors/object/object_add.c12
-rw-r--r--source/blender/editors/object/object_constraint.c15
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.cc3
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.cc4
7 files changed, 12 insertions, 141 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 8bd6c9f54fd..cc99027c470 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -149,36 +149,6 @@ bool ED_object_posemode_exit(bContext *C, Object *ob)
return ok;
}
-/* if a selected or active bone is protected, throw error (only if warn == 1) and return 1 */
-/* only_selected == 1: the active bone is allowed to be protected */
-#if 0 /* UNUSED 2.5 */
-static bool pose_has_protected_selected(Object *ob, short warn)
-{
- /* check protection */
- if (ob->proxy) {
- bPoseChannel *pchan;
- bArmature *arm = ob->data;
-
- for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
- if (pchan->bone && BKE_pose_is_layer_visible(arm, pchan)) {
- if (pchan->bone->layer & arm->layer_protected) {
- if (pchan->bone->flag & BONE_SELECTED) {
- break;
- }
- }
- }
- }
- if (pchan) {
- if (warn) {
- error("Cannot change Proxy protected bones");
- }
- return 1;
- }
- }
- return 0;
-}
-#endif
-
/* ********************************************** */
/* Motion Paths */
@@ -1056,10 +1026,6 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
Object *ob_iter = objects[ob_index];
bArmature *arm = ob_iter->data;
- if (ob_iter->proxy != NULL) {
- BKE_report(op->reports, RPT_INFO, "Undo of hiding can only be done with Reveal Selected");
- }
-
bool changed = bone_looper(ob_iter, arm->bonebase.first, hide_select_p, hide_pose_bone_fn) !=
0;
if (changed) {
diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c
index 38d15d8b880..466c423c27c 100644
--- a/source/blender/editors/armature/pose_group.c
+++ b/source/blender/editors/armature/pose_group.c
@@ -62,8 +62,8 @@ static bool pose_group_poll(bContext *C)
}
Object *obpose = ED_pose_object_from_context(C);
- if ((obpose->proxy != NULL) || (obpose->proxy_group != NULL) || ID_IS_OVERRIDE_LIBRARY(obpose)) {
- CTX_wm_operator_poll_msg_set(C, "Cannot edit bone groups for proxies or library overrides");
+ if (ID_IS_OVERRIDE_LIBRARY(obpose)) {
+ CTX_wm_operator_poll_msg_set(C, "Cannot edit bone groups for library overrides");
return false;
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 8330f8c0db7..d605847c270 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2672,18 +2672,6 @@ static void constraint_ops_extra_draw(bContext *C, uiLayout *layout, void *con_v
static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *con)
{
- bPoseChannel *pchan = BKE_pose_channel_active_if_layer_visible(ob);
- short proxy_protected, xco = 0, yco = 0;
- // int rb_col; // UNUSED
-
- /* determine whether constraint is proxy protected or not */
- if (BKE_constraints_proxylocked_owner(ob, pchan)) {
- proxy_protected = (con->flag & CONSTRAINT_PROXY_LOCAL) == 0;
- }
- else {
- proxy_protected = 0;
- }
-
/* unless button has own callback, it adds this callback to button */
uiBlock *block = uiLayoutGetBlock(layout);
UI_block_func_set(block, constraint_active_func, ob, con);
@@ -2708,72 +2696,23 @@ static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *co
uiLayout *row = uiLayoutRow(layout, true);
- if (proxy_protected == 0) {
- uiItemR(row, &ptr, "name", 0, "", ICON_NONE);
- }
- else {
- uiItemL(row, IFACE_(con->name), ICON_NONE);
- }
-
- /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */
- if (proxy_protected) {
- UI_block_emboss_set(block, UI_EMBOSS_NONE);
-
- /* draw a ghost icon (for proxy) and also a lock beside it,
- * to show that constraint is "proxy locked" */
- uiDefIconBut(block,
- UI_BTYPE_BUT,
- 0,
- ICON_GHOST_ENABLED,
- xco + 12.2f * UI_UNIT_X,
- yco,
- 0.95f * UI_UNIT_X,
- 0.95f * UI_UNIT_Y,
- NULL,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- TIP_("Proxy Protected"));
- uiDefIconBut(block,
- UI_BTYPE_BUT,
- 0,
- ICON_LOCKED,
- xco + 13.1f * UI_UNIT_X,
- yco,
- 0.95f * UI_UNIT_X,
- 0.95f * UI_UNIT_Y,
- NULL,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- TIP_("Proxy Protected"));
+ uiItemR(row, &ptr, "name", 0, "", ICON_NONE);
- UI_block_emboss_set(block, UI_EMBOSS);
- }
- else {
- /* Enabled eye icon. */
- uiItemR(row, &ptr, "enabled", 0, "", ICON_NONE);
+ /* Enabled eye icon. */
+ uiItemR(row, &ptr, "enabled", 0, "", ICON_NONE);
- /* Extra operators menu. */
- uiItemMenuF(row, "", ICON_DOWNARROW_HLT, constraint_ops_extra_draw, con);
+ /* Extra operators menu. */
+ uiItemMenuF(row, "", ICON_DOWNARROW_HLT, constraint_ops_extra_draw, con);
- /* Close 'button' - emboss calls here disable drawing of 'button' behind X */
- sub = uiLayoutRow(row, false);
- uiLayoutSetEmboss(sub, UI_EMBOSS_NONE);
- uiLayoutSetOperatorContext(sub, WM_OP_INVOKE_DEFAULT);
- uiItemO(sub, "", ICON_X, "CONSTRAINT_OT_delete");
- }
+ /* Close 'button' - emboss calls here disable drawing of 'button' behind X */
+ sub = uiLayoutRow(row, false);
+ uiLayoutSetEmboss(sub, UI_EMBOSS_NONE);
+ uiLayoutSetOperatorContext(sub, WM_OP_INVOKE_DEFAULT);
+ uiItemO(sub, "", ICON_X, "CONSTRAINT_OT_delete");
/* Some extra padding at the end, so the 'x' icon isn't too close to drag button. */
uiItemS(layout);
- /* Set but-locks for protected settings (magic numbers are used here!) */
- if (proxy_protected) {
- UI_block_lock_set(block, true, TIP_("Cannot edit Proxy-Protected Constraint"));
- }
-
/* clear any locks set up for proxies/lib-linking */
UI_block_lock_clear(block);
}
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 8a493eb0743..0f1b0f5bdc0 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -2347,11 +2347,6 @@ static void make_object_duplilist_real(bContext *C,
BKE_animdata_free(&ob_dst->id, true);
ob_dst->adt = NULL;
- /* Proxies are not to be copied. */
- ob_dst->proxy_from = NULL;
- ob_dst->proxy_group = NULL;
- ob_dst->proxy = NULL;
-
ob_dst->parent = NULL;
BKE_constraints_free(&ob_dst->constraints);
ob_dst->runtime.curve_cache = NULL;
@@ -2466,13 +2461,6 @@ static void make_object_duplilist_real(bContext *C,
}
if (base->object->transflag & OB_DUPLICOLLECTION && base->object->instance_collection) {
- LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
- if (ob->proxy_group == base->object) {
- ob->proxy = NULL;
- ob->proxy_from = NULL;
- DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
- }
- }
base->object->instance_collection = NULL;
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 91a512ae8e9..7ef17689912 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1356,15 +1356,6 @@ void ED_object_constraint_update(Main *bmain, Object *ob)
static void object_pose_tag_update(Main *bmain, Object *ob)
{
BKE_pose_tag_recalc(bmain, ob->pose); /* Checks & sort pose channels. */
- if (ob->proxy && ob->adt) {
- /* We need to make use of ugly #POSE_ANIMATION_WORKAROUND here too,
- * else anim data are not reloaded after calling `BKE_pose_rebuild()`,
- * which causes T43872.
- * Note that this is a bit wide here, since we cannot be sure whether there are some locked
- * proxy bones or not.
- * XXX Temp hack until new depsgraph hopefully solves this. */
- DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION);
- }
}
void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
@@ -2453,12 +2444,6 @@ static int constraint_add_exec(
if ((ob->type == OB_ARMATURE) && (pchan)) {
BKE_pose_tag_recalc(bmain, ob->pose); /* sort pose channels */
- if (BKE_constraints_proxylocked_owner(ob, pchan) && ob->adt) {
- /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too,
- * else anim data are not reloaded after calling `BKE_pose_rebuild()`, which causes T43872.
- * XXX Temp hack until new depsgraph hopefully solves this. */
- DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION);
- }
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_TRANSFORM);
}
else {
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index 5fd7559370f..259fdd4e009 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -2480,9 +2480,6 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
case TSE_POSE_CHANNEL:
data.icon = ICON_BONE_DATA;
break;
- case TSE_PROXY:
- data.icon = ICON_GHOST_ENABLED;
- break;
case TSE_R_LAYER_BASE:
data.icon = ICON_RENDERLAYERS;
break;
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc
index d8fe17a570f..4e16fe64988 100644
--- a/source/blender/editors/space_outliner/outliner_tree.cc
+++ b/source/blender/editors/space_outliner/outliner_tree.cc
@@ -302,10 +302,6 @@ static void outliner_add_object_contents(SpaceOutliner *space_outliner,
/* FIXME: add a special type for this. */
outliner_add_element(space_outliner, &te->subtree, ob->poselib, te, TSE_SOME_ID, 0);
- if (ob->proxy && !ID_IS_LINKED(ob)) {
- outliner_add_element(space_outliner, &te->subtree, ob->proxy, te, TSE_PROXY, 0);
- }
-
outliner_add_element(space_outliner, &te->subtree, ob->data, te, TSE_SOME_ID, 0);
if (ob->pose) {