[Bf-blender-cvs] [e6e81376b7e] vr_scene_inspection: Support forcing continuous gizmo redraws
Julian Eisel
noreply at git.blender.org
Sun Feb 16 19:33:36 CET 2020
Commit: e6e81376b7eb1d6b8499a7f38792eebbc8367814
Author: Julian Eisel
Date: Sun Feb 16 18:34:17 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rBe6e81376b7eb1d6b8499a7f38792eebbc8367814
Support forcing continuous gizmo redraws
===================================================================
M source/blender/makesrna/intern/rna_wm_gizmo.c
M source/blender/windowmanager/gizmo/WM_gizmo_types.h
M source/blender/windowmanager/intern/wm_draw.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index 0bd6769d3ad..fea65b3b6d4 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -1376,6 +1376,11 @@ static void rna_def_gizmogroup(BlenderRNA *brna)
0,
"Tool Init",
"Postpone running until tool operator run (when used with a tool)"},
+ {WM_GIZMOGROUPTYPE_CONTINUOUS_REDRAW,
+ "CONTINUOUS_REDRAW",
+ 0,
+ "Continuous Redraw",
+ "Redraw the group all the time (on each main loop iteration)"},
{0, NULL, 0, NULL, NULL},
};
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
index c667dd564f7..f51dc61f538 100644
--- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h
+++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
@@ -139,6 +139,8 @@ typedef enum eWM_GizmoFlagGroupTypeFlag {
* with click drag events by popping up under the cursor and catching the tweak event.
*/
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK = (1 << 8),
+
+ WM_GIZMOGROUPTYPE_CONTINUOUS_REDRAW = (1 << 9),
} eWM_GizmoFlagGroupTypeFlag;
/**
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 6dba11ce8cb..8f3131c283e 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -193,6 +193,11 @@ static void wm_region_test_gizmo_do_draw(ARegion *ar, bool tag_redraw)
wmGizmoMap *gzmap = ar->gizmo_map;
for (wmGizmoGroup *gzgroup = WM_gizmomap_group_list(gzmap)->first; gzgroup;
gzgroup = gzgroup->next) {
+ /* TODO should use ED_region_tag_redraw_editor_overlays() here. */
+ if (tag_redraw && (gzgroup->type->flag & WM_GIZMOGROUPTYPE_CONTINUOUS_REDRAW)) {
+ ED_region_tag_redraw_no_rebuild(ar);
+ }
+
for (wmGizmo *gz = gzgroup->gizmos.first; gz; gz = gz->next) {
if (gz->do_draw) {
if (tag_redraw) {
More information about the Bf-blender-cvs
mailing list