[Bf-blender-cvs] [5575aba0256] master: Cleanup: simplify grease pencil type checks
Campbell Barton
noreply at git.blender.org
Wed Jun 9 18:23:50 CEST 2021
Commit: 5575aba0256b584d66d2492345cea5ad6cee0eb5
Author: Campbell Barton
Date: Thu Jun 10 01:55:43 2021 +1000
Branches: master
https://developer.blender.org/rB5575aba0256b584d66d2492345cea5ad6cee0eb5
Cleanup: simplify grease pencil type checks
===================================================================
M source/blender/editors/space_outliner/outliner_dragdrop.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 8e19f76ea16..7d889eed612 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -818,12 +818,7 @@ static bool datastack_drop_are_types_valid(StackDropData *drop_data)
switch (drop_data->drag_tselem->type) {
case TSE_MODIFIER_BASE:
case TSE_MODIFIER:
- if (ob_parent->type == OB_GPENCIL) {
- return ob_dst->type == OB_GPENCIL;
- }
- else if (ob_parent->type != OB_GPENCIL) {
- return ob_dst->type != OB_GPENCIL;
- }
+ return (ob_parent->type == OB_GPENCIL) == (ob_dst->type == OB_GPENCIL);
break;
case TSE_CONSTRAINT_BASE:
case TSE_CONSTRAINT:
@@ -1008,7 +1003,7 @@ static void datastack_drop_reorder(bContext *C, ReportList *reports, StackDropDa
drag_te, drop_te, insert_type, &ob->greasepencil_modifiers);
ED_object_gpencil_modifier_move_to_index(reports, ob, drop_data->drag_directdata, index);
}
- else if (ob->type != OB_GPENCIL) {
+ else {
index = outliner_get_insert_index(drag_te, drop_te, insert_type, &ob->modifiers);
ED_object_modifier_move_to_index(reports, ob, drop_data->drag_directdata, index);
}
More information about the Bf-blender-cvs
mailing list