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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-10-08 09:07:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-08 09:07:56 +0300
commitebe216f532845069bc5bb7b45e2eda03756b81cc (patch)
treee7b4431caf75e1d5432a7e76c8c52ae1974029d4 /source
parentde07bf2b13e8239b5175e9c4b79fc09f096b1b86 (diff)
Sequencer: add option to toggle gizmos
Use shortcut matching the 3D view & popover in the header
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/ED_image.h6
-rw-r--r--source/blender/editors/interface/view2d_gizmo_navigate.c15
-rw-r--r--source/blender/editors/space_image/image_edit.c6
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c4
-rw-r--r--source/blender/editors/transform/transform_gizmo_2d.c16
-rw-r--r--source/blender/makesdna/DNA_space_types.h16
-rw-r--r--source/blender/makesrna/intern/rna_space.c21
7 files changed, 72 insertions, 12 deletions
diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h
index 9532035a1cd..f0e8f7f0a39 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -112,9 +112,9 @@ void ED_image_point_pos__reverse(struct SpaceImage *sima,
float r_co[2]);
bool ED_image_slot_cycle(struct Image *image, int direction);
-bool ED_space_image_show_render(struct SpaceImage *sima);
-bool ED_space_image_show_paint(struct SpaceImage *sima);
-bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
+bool ED_space_image_show_render(const struct SpaceImage *sima);
+bool ED_space_image_show_paint(const struct SpaceImage *sima);
+bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit);
bool ED_space_image_paint_curve(const struct bContext *C);
diff --git a/source/blender/editors/interface/view2d_gizmo_navigate.c b/source/blender/editors/interface/view2d_gizmo_navigate.c
index 30b4a7c097a..3ff5b471731 100644
--- a/source/blender/editors/interface/view2d_gizmo_navigate.c
+++ b/source/blender/editors/interface/view2d_gizmo_navigate.c
@@ -127,11 +127,24 @@ struct NavigateWidgetGroup {
int region_size[2];
};
-static bool WIDGETGROUP_navigate_poll(const bContext *UNUSED(C), wmGizmoGroupType *UNUSED(gzgt))
+static bool WIDGETGROUP_navigate_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
{
if ((U.uiflag & USER_SHOW_GIZMO_NAVIGATE) == 0) {
return false;
}
+ ScrArea *area = CTX_wm_area(C);
+ if (area == NULL) {
+ return false;
+ }
+ switch (area->spacetype) {
+ case SPACE_SEQ: {
+ const SpaceSeq *sseq = area->spacedata.first;
+ if (sseq->gizmo_flag & (SEQ_GIZMO_HIDE | SEQ_GIZMO_HIDE_NAVIGATE)) {
+ return false;
+ }
+ break;
+ }
+ }
return true;
}
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 2174a4b9dc1..9081f0dfcf3 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -445,12 +445,12 @@ void ED_space_image_scopes_update(const struct bContext *C,
&scene->display_settings);
}
-bool ED_space_image_show_render(SpaceImage *sima)
+bool ED_space_image_show_render(const SpaceImage *sima)
{
return (sima->image && ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE));
}
-bool ED_space_image_show_paint(SpaceImage *sima)
+bool ED_space_image_show_paint(const SpaceImage *sima)
{
if (ED_space_image_show_render(sima)) {
return false;
@@ -459,7 +459,7 @@ bool ED_space_image_show_paint(SpaceImage *sima)
return (sima->mode == SI_MODE_PAINT);
}
-bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
+bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
{
if (sima) {
if (ED_space_image_show_render(sima)) {
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 4c4c908ea3c..978ac9a3404 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -816,7 +816,9 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
DRW_draw_cursor_2d_ex(region, cursor_pixel);
}
- WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D);
+ if ((sseq->gizmo_flag & SEQ_GIZMO_HIDE) == 0) {
+ WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D);
+ }
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) {
const rcti *rect = ED_region_visible_rect(region);
diff --git a/source/blender/editors/transform/transform_gizmo_2d.c b/source/blender/editors/transform/transform_gizmo_2d.c
index b25a182926e..a0ca7b84c48 100644
--- a/source/blender/editors/transform/transform_gizmo_2d.c
+++ b/source/blender/editors/transform/transform_gizmo_2d.c
@@ -76,13 +76,27 @@ static bool gizmo2d_generic_poll(const bContext *C, wmGizmoGroupType *gzgt)
}
ScrArea *area = CTX_wm_area(C);
+ if (area == NULL) {
+ return false;
+ }
+
+ /* NOTE: below this is assumed to be a tool gizmo.
+ * If there are cases that need to check other flags - this function could be split. */
switch (area->spacetype) {
case SPACE_IMAGE: {
- SpaceImage *sima = area->spacedata.first;
+ const SpaceImage *sima = area->spacedata.first;
Object *obedit = CTX_data_edit_object(C);
if (!ED_space_image_show_uvedit(sima, obedit)) {
return false;
}
+ break;
+ }
+ case SPACE_SEQ: {
+ const SpaceSeq *sseq = area->spacedata.first;
+ if (sseq->gizmo_flag & (SEQ_GIZMO_HIDE | SEQ_GIZMO_HIDE_TOOL)) {
+ return false;
+ }
+ break;
}
}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index f6ce71dad54..ac55fa0df01 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -641,10 +641,11 @@ typedef struct SpaceSeq {
/** Deprecated, handled by View2D now. */
float zoom DNA_DEPRECATED;
/** See SEQ_VIEW_* below. */
- int view;
- int overlay_type;
+ char view;
+ char overlay_type;
/** Overlay an image of the editing on below the strips. */
- int draw_flag;
+ char draw_flag;
+ char gizmo_flag;
char _pad[4];
/** 2D cursor for transform. */
@@ -729,6 +730,15 @@ typedef struct MaskSpaceInfo {
char _pad3[5];
} MaskSpaceInfo;
+/** #SpaceSeq.gizmo_flag */
+enum {
+ /** All gizmos. */
+ SEQ_GIZMO_HIDE = (1 << 0),
+ SEQ_GIZMO_HIDE_NAVIGATE = (1 << 1),
+ SEQ_GIZMO_HIDE_CONTEXT = (1 << 2),
+ SEQ_GIZMO_HIDE_TOOL = (1 << 3),
+};
+
/* SpaceSeq.mainb */
typedef enum eSpaceSeq_OverlayType {
SEQ_DRAW_OVERLAY_RECT = 0,
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 9d8e06b3c56..fcaf53da81b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -5670,6 +5670,27 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Transform Preview", "Show preview of the transformed frames");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+ /* Gizmo toggles. */
+ prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", SEQ_GIZMO_HIDE);
+ RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+
+ prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", SEQ_GIZMO_HIDE_NAVIGATE);
+ RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+
+ prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", SEQ_GIZMO_HIDE_CONTEXT);
+ RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+
+ prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", SEQ_GIZMO_HIDE_TOOL);
+ RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
+
/* Overlay settings. */
prop = RNA_def_property(srna, "show_strip_overlay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_OVERLAY);