Fix T78308: Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work.

Some modes were working by mere chance in that ugly 'reversed' case, but
the to/from selection modes were not properly swapped...

Should also be safe for 2.83.
This commit is contained in:
Bastien Montagne 2020-07-27 18:12:40 +02:00
parent 960ce1e394
commit 1ae8855f8e
Notes: blender-bot 2023-02-14 10:11:54 +01:00
Referenced by issue #78308, Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 6 additions and 2 deletions

View File

@ -420,8 +420,8 @@ static int data_transfer_exec(bContext *C, wmOperator *op)
const float ray_radius = RNA_float_get(op->ptr, "ray_radius");
const float islands_precision = RNA_float_get(op->ptr, "islands_precision");
const int layers_src = RNA_enum_get(op->ptr, "layers_select_src");
const int layers_dst = RNA_enum_get(op->ptr, "layers_select_dst");
int layers_src = RNA_enum_get(op->ptr, "layers_select_src");
int layers_dst = RNA_enum_get(op->ptr, "layers_select_dst");
int layers_select_src[DT_MULTILAYER_INDEX_MAX] = {0};
int layers_select_dst[DT_MULTILAYER_INDEX_MAX] = {0};
const int fromto_idx = BKE_object_data_transfer_dttype_to_srcdst_index(data_type);
@ -447,6 +447,10 @@ static int data_transfer_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (reverse_transfer) {
SWAP(int, layers_src, layers_dst);
}
if (fromto_idx != DT_MULTILAYER_INDEX_INVALID) {
layers_select_src[fromto_idx] = layers_src;
layers_select_dst[fromto_idx] = layers_dst;