From 7bc5246156e0eba3992317f8ca1b4642de324689 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 11 Jun 2021 21:42:36 +0200 Subject: Overlays: Make flash on mode transfer an operator property This moves the flash on mode transfer effect option from the overlays to an operator property of the mode transfer operator. - This effect is intended to show the target object when no overlays or a minimal set of overlays is enabled. Making it part of the whole set of overlays invalidates this use case. - The effect is not intended to be configurable per viewport, it should be a global option. The effect is still implemented using the overlay engine (instead of a draw modal callback) due to performance and drawing artifacts. Having it implemented as an overlay with runtime timer data in the objects makes also possible to run multiple animations at the same time without any visual glitches. Reviewed By: campbellbarton, JulienKaspar Differential Revision: https://developer.blender.org/D11519 --- source/blender/editors/object/object_modes.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 3d1a5ac2d62..ed06cd2a217 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -484,7 +484,9 @@ static bool object_transfer_mode_to_base(bContext *C, wmOperator *op, Base *base ob_dst_orig = DEG_get_original_object(ob_dst); ED_object_mode_set_ex(C, last_mode, true, op->reports); - object_overlay_mode_transfer_animation_start(C, ob_dst); + if (RNA_boolean_get(op->ptr, "use_flash_on_transfer")) { + object_overlay_mode_transfer_animation_start(C, ob_dst); + } WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); WM_toolsystem_update_from_context_view3d(C); @@ -578,6 +580,12 @@ void OBJECT_OT_transfer_mode(wmOperatorType *ot) false, "Use Eyedropper", "Pick the object to switch to using an eyedropper"); + + RNA_def_boolean(ot->srna, + "use_flash_on_transfer", + true, + "Flash On Transfer", + "Flash the target object when transfering the mode"); } /** \} */ -- cgit v1.2.3