Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/space_buttons.c
| Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | case BCONTEXT_PHYSICS: | ||||
| contexts[0] = "physics"; | contexts[0] = "physics"; | ||||
| break; | break; | ||||
| case BCONTEXT_BONE: | case BCONTEXT_BONE: | ||||
| contexts[0] = "bone"; | contexts[0] = "bone"; | ||||
| break; | break; | ||||
| case BCONTEXT_MODIFIER: | case BCONTEXT_MODIFIER: | ||||
| contexts[0] = "modifier"; | contexts[0] = "modifier"; | ||||
| break; | break; | ||||
| case BCONTEXT_SHADERFX: | |||||
| contexts[0] = "shaderfx"; | |||||
| break; | |||||
| case BCONTEXT_CONSTRAINT: | case BCONTEXT_CONSTRAINT: | ||||
| contexts[0] = "constraint"; | contexts[0] = "constraint"; | ||||
| break; | break; | ||||
| case BCONTEXT_BONE_CONSTRAINT: | case BCONTEXT_BONE_CONSTRAINT: | ||||
| contexts[0] = "bone_constraint"; | contexts[0] = "bone_constraint"; | ||||
| break; | break; | ||||
| case BCONTEXT_TOOL: | case BCONTEXT_TOOL: | ||||
| contexts[0] = "tool"; | contexts[0] = "tool"; | ||||
| break; | break; | ||||
| } | } | ||||
| const bool vertical = true; | const bool vertical = true; | ||||
| ED_region_panels_layout_ex(C, ar, contexts, sbuts->mainb, vertical); | ED_region_panels_layout_ex(C, ar, contexts, sbuts->mainb, vertical); | ||||
| } | } | ||||
| static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) | static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) | ||||
| { | { | ||||
| const char *contexts[3] = {NULL}; | const char *contexts[3] = {NULL}; | ||||
| const WorkSpace *workspace = CTX_wm_workspace(C); | const WorkSpace *workspace = CTX_wm_workspace(C); | ||||
| if (workspace->tools_space_type == SPACE_VIEW3D) { | |||||
| const int mode = CTX_data_mode_enum(C); | const int mode = CTX_data_mode_enum(C); | ||||
| if (workspace->tools_space_type == SPACE_VIEW3D) { | |||||
| switch (mode) { | switch (mode) { | ||||
| case CTX_MODE_EDIT_MESH: | case CTX_MODE_EDIT_MESH: | ||||
| ARRAY_SET_ITEMS(contexts, ".mesh_edit"); | ARRAY_SET_ITEMS(contexts, ".mesh_edit"); | ||||
| break; | break; | ||||
| case CTX_MODE_EDIT_CURVE: | case CTX_MODE_EDIT_CURVE: | ||||
| ARRAY_SET_ITEMS(contexts, ".curve_edit"); | ARRAY_SET_ITEMS(contexts, ".curve_edit"); | ||||
| break; | break; | ||||
| case CTX_MODE_EDIT_SURFACE: | case CTX_MODE_EDIT_SURFACE: | ||||
| Show All 27 Lines | switch (mode) { | ||||
| ARRAY_SET_ITEMS(contexts, ".paint_common", ".imagepaint"); | ARRAY_SET_ITEMS(contexts, ".paint_common", ".imagepaint"); | ||||
| break; | break; | ||||
| case CTX_MODE_PARTICLE: | case CTX_MODE_PARTICLE: | ||||
| ARRAY_SET_ITEMS(contexts, ".particlemode"); | ARRAY_SET_ITEMS(contexts, ".particlemode"); | ||||
| break; | break; | ||||
| case CTX_MODE_OBJECT: | case CTX_MODE_OBJECT: | ||||
| ARRAY_SET_ITEMS(contexts, ".objectmode"); | ARRAY_SET_ITEMS(contexts, ".objectmode"); | ||||
| break; | 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) { | else if (workspace->tools_space_type == SPACE_IMAGE) { | ||||
| /* TODO */ | /* 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; | const bool vertical = true; | ||||
| ED_region_panels_layout_ex(C, ar, contexts, -1, vertical); | ED_region_panels_layout_ex(C, ar, contexts, -1, vertical); | ||||
| } | } | ||||
| static void buttons_main_region_layout(const bContext *C, ARegion *ar) | static void buttons_main_region_layout(const bContext *C, ARegion *ar) | ||||
| { | { | ||||
| /* draw entirely, view changes should be handled here */ | /* draw entirely, view changes should be handled here */ | ||||
| SpaceButs *sbuts = CTX_wm_space_buts(C); | SpaceButs *sbuts = CTX_wm_space_buts(C); | ||||
| ▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | switch (wmn->category) { | ||||
| case NC_ANIMATION: | case NC_ANIMATION: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_KEYFRAME: | case ND_KEYFRAME: | ||||
| if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED)) | if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED)) | ||||
| ED_area_tag_redraw(sa); | ED_area_tag_redraw(sa); | ||||
| break; | break; | ||||
| } | } | ||||
| 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: | case NC_NODE: | ||||
| if (wmn->action == NA_SELECTED) { | if (wmn->action == NA_SELECTED) { | ||||
| ED_area_tag_redraw(sa); | ED_area_tag_redraw(sa); | ||||
| /* new active node, update texture preview */ | /* new active node, update texture preview */ | ||||
| if (sbuts->mainb == BCONTEXT_TEXTURE) | if (sbuts->mainb == BCONTEXT_TEXTURE) | ||||
| sbuts->preview = 1; | sbuts->preview = 1; | ||||
| } | } | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||