diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:59:39 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:59:39 +0300 |
commit | b8ab411185c11ce98e7e791b0d30a9d9b1ce6d69 (patch) | |
tree | 9c219e06fc6a1f9b09d6fbf7d86c8526cfa6d775 /source/blender/editors/space_buttons/space_buttons.c | |
parent | 209686f1c8189bc01f91d14a922651844df8b201 (diff) | |
parent | dc2d841b7c50565302af2986d62ddbd29c332acd (diff) |
Merge branch 'hair_guides' into hair_guides_groominghair_guides_grooming
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 6f7a4ca971a..0350e3fcd14 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -180,6 +180,9 @@ static void buttons_main_region_layout_properties(const bContext *C, SpaceButs * case BCONTEXT_MODIFIER: contexts[0] = "modifier"; break; + case BCONTEXT_SHADERFX: + contexts[0] = "shaderfx"; + break; case BCONTEXT_CONSTRAINT: contexts[0] = "constraint"; break; @@ -200,8 +203,9 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) const char *contexts[3] = {NULL}; const WorkSpace *workspace = CTX_wm_workspace(C); + const int mode = CTX_data_mode_enum(C); + if (workspace->tools_space_type == SPACE_VIEW3D) { - const int mode = CTX_data_mode_enum(C); switch (mode) { case CTX_MODE_EDIT_MESH: ARRAY_SET_ITEMS(contexts, ".mesh_edit"); @@ -240,17 +244,44 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) ARRAY_SET_ITEMS(contexts, ".paint_common", ".imagepaint"); break; case CTX_MODE_PARTICLE: - ARRAY_SET_ITEMS(contexts, ".particlemode"); + ARRAY_SET_ITEMS(contexts, ".paint_common", ".particlemode"); break; case CTX_MODE_OBJECT: ARRAY_SET_ITEMS(contexts, ".objectmode"); break; + case CTX_MODE_GPENCIL_PAINT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_paint"); + break; + case CTX_MODE_GPENCIL_SCULPT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt"); + break; + case CTX_MODE_GPENCIL_WEIGHT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_weight"); + break; } } else if (workspace->tools_space_type == SPACE_IMAGE) { /* TODO */ } + /* for grease pencil we don't use tool system yet, so we need check outside + * workspace->tools_space_type because this value is not available + */ + switch (mode) { + case CTX_MODE_GPENCIL_PAINT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_paint"); + break; + case CTX_MODE_GPENCIL_SCULPT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt"); + break; + case CTX_MODE_GPENCIL_WEIGHT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_weight"); + break; + case CTX_MODE_GPENCIL_EDIT: + ARRAY_SET_ITEMS(contexts, ".greasepencil_edit"); + break; + } + const bool vertical = true; ED_region_panels_layout_ex(C, ar, contexts, -1, vertical); } @@ -495,6 +526,14 @@ static void buttons_area_listener( break; } break; + case NC_GPENCIL: + switch (wmn->data) { + case ND_DATA: + if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED)) + ED_area_tag_redraw(sa); + break; + } + break; case NC_NODE: if (wmn->action == NA_SELECTED) { ED_area_tag_redraw(sa); |