diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:39:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:39:04 +0300 |
commit | 95011f6d484b369db92ae13c674a6522d664ea8f (patch) | |
tree | 91ba2719c9f3096fad0f1f768aa7b1c4d79aa32a /source/blender/editors/space_buttons | |
parent | 0911acb5cf49c5ba05b1df045b41697704aa288a (diff) | |
parent | 44505b38df557a5711703613685a1dec9fc2c3d9 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_buttons')
4 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index cfaa7bf91bd..9caf381c93d 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -144,7 +144,7 @@ static int buttons_context_path_world(ButsContextPath *path) else if (buttons_context_path_scene(path)) { scene = path->ptr[path->len - 1].data; world = scene->world; - + if (world) { RNA_id_pointer_create(&scene->world->id, &path->ptr[path->len]); path->len++; @@ -421,7 +421,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path if (!ct->user) return 0; - + id = ct->user->id; if (id) { @@ -572,7 +572,7 @@ static int buttons_shading_context(const bContext *C, int mainb) return 1; if (mainb == BCONTEXT_DATA && ob && ELEM(ob->type, OB_LAMP, OB_CAMERA)) return 1; - + return 0; } @@ -586,7 +586,7 @@ static int buttons_shading_new_context(const bContext *C, int flag) return BCONTEXT_DATA; else if (flag & (1 << BCONTEXT_WORLD)) return BCONTEXT_WORLD; - + return BCONTEXT_RENDER; } @@ -858,7 +858,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r else if (CTX_data_equals(member, "particle_settings")) { /* only available when pinned */ PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSettings); - + if (ptr && ptr->data) { CTX_data_pointer_set(result, ptr->id.data, &RNA_ParticleSettings, ptr->data); return 1; @@ -866,7 +866,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r else { /* get settings from active particle system instead */ ptr = get_pointer_type(path, &RNA_ParticleSystem); - + if (ptr && ptr->data) { ParticleSettings *part = ((ParticleSystem *)ptr->data)->part; CTX_data_pointer_set(result, ptr->id.data, &RNA_ParticleSettings, part); @@ -906,7 +906,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } } - + else if (CTX_data_equals(member, "smoke")) { PointerRNA *ptr = get_pointer_type(path, &RNA_Object); @@ -963,7 +963,7 @@ static void pin_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) } else sbuts->pinid = NULL; - + ED_area_tag_redraw(CTX_wm_area(C)); } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 8198650fd8a..813f4202a49 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -86,7 +86,7 @@ void BUTTONS_OT_toolbox(wmOperatorType *ot) ot->name = "Toolbox"; ot->description = "Display button panel toolbox"; ot->idname = "BUTTONS_OT_toolbox"; - + /* api callbacks */ ot->invoke = toolbox_invoke; ot->poll = ED_operator_buttons_active; @@ -106,10 +106,10 @@ static int file_browse_exec(bContext *C, wmOperator *op) ID *id; char *str, path[FILE_MAX]; const char *path_prop = RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; - + if (RNA_struct_property_is_set(op->ptr, path_prop) == 0 || fbo == NULL) return OPERATOR_CANCELLED; - + str = RNA_string_get_alloc(op->ptr, path_prop, NULL, 0); /* add slash for directories, important for some properties */ @@ -119,7 +119,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) BLI_strncpy(path, str, FILE_MAX); BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name); - + if (BLI_is_dir(path)) { /* do this first so '//' isnt converted to '//\' on windows */ BLI_add_slash(path); @@ -255,7 +255,7 @@ void BUTTONS_OT_file_browse(wmOperatorType *ot) ot->name = "Accept"; ot->description = "Open a file browser, Hold Shift to open the file, Alt to browse containing directory"; ot->idname = "BUTTONS_OT_file_browse"; - + /* api callbacks */ ot->invoke = file_browse_invoke; ot->exec = file_browse_exec; diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 8beb163cf98..5feb74edef7 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -78,7 +78,7 @@ /************************* Texture User **************************/ -static void buttons_texture_user_property_add(ListBase *users, ID *id, +static void buttons_texture_user_property_add(ListBase *users, ID *id, PointerRNA ptr, PropertyRNA *prop, const char *category, int icon, const char *name) { @@ -95,7 +95,7 @@ static void buttons_texture_user_property_add(ListBase *users, ID *id, BLI_addtail(users, user); } -static void buttons_texture_user_node_add(ListBase *users, ID *id, +static void buttons_texture_user_node_add(ListBase *users, ID *id, bNodeTree *ntree, bNode *node, const char *category, int icon, const char *name) { @@ -122,10 +122,10 @@ static void buttons_texture_users_find_nodetree(ListBase *users, ID *id, if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) { PointerRNA ptr; /* PropertyRNA *prop; */ /* UNUSED */ - + RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); /* prop = RNA_struct_find_property(&ptr, "texture"); */ /* UNUSED */ - + buttons_texture_user_node_add(users, id, ntree, node, category, RNA_struct_ui_icon(ptr.type), node->name); } @@ -449,7 +449,7 @@ static void template_texture_show(bContext *C, void *data_p, void *prop_p) for (user = ct->users.first; user; user = user->next) if (user->ptr.data == data_p && user->prop == prop_p) break; - + if (user) { /* select texture */ template_texture_select(C, user, NULL); @@ -479,12 +479,12 @@ void uiTemplateTextureShow(uiLayout *layout, bContext *C, PointerRNA *ptr, Prope for (user = ct->users.first; user; user = user->next) if (user->ptr.data == ptr->data && user->prop == prop) break; - + /* draw button */ if (user) { uiBlock *block = uiLayoutGetBlock(layout); uiBut *but; - + but = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_BUTS, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Show texture in texture tab")); UI_but_func_set(but, template_texture_show, user->ptr.data, user->prop); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 5b027883a4b..11857dd0b27 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -60,7 +60,7 @@ static SpaceLink *buttons_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s { ARegion *ar; SpaceButs *sbuts; - + sbuts = MEM_callocN(sizeof(SpaceButs), "initbuts"); sbuts->spacetype = SPACE_BUTS; sbuts->align = BUT_VERTICAL; @@ -69,11 +69,11 @@ static SpaceLink *buttons_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s /* header */ ar = MEM_callocN(sizeof(ARegion), "header for buts"); - + BLI_addtail(&sbuts->regionbase, ar); ar->regiontype = RGN_TYPE_HEADER; ar->alignment = RGN_ALIGN_TOP; - + #if 0 /* context region */ ar = MEM_callocN(sizeof(ARegion), "context region for buts"); @@ -84,7 +84,7 @@ static SpaceLink *buttons_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s /* main region */ ar = MEM_callocN(sizeof(ARegion), "main region for buts"); - + BLI_addtail(&sbuts->regionbase, ar); ar->regiontype = RGN_TYPE_WINDOW; @@ -93,12 +93,12 @@ static SpaceLink *buttons_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s /* not spacelink itself */ static void buttons_free(SpaceLink *sl) -{ +{ SpaceButs *sbuts = (SpaceButs *) sl; if (sbuts->path) MEM_freeN(sbuts->path); - + if (sbuts->texuser) { ButsContextTexture *ct = sbuts->texuser; BLI_freelistN(&ct->users); @@ -123,11 +123,11 @@ static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) static SpaceLink *buttons_duplicate(SpaceLink *sl) { SpaceButs *sbutsn = MEM_dupallocN(sl); - + /* clear or remove stuff from old */ sbutsn->path = NULL; sbutsn->texuser = NULL; - + return (SpaceLink *)sbutsn; } @@ -306,7 +306,7 @@ static void buttons_operatortypes(void) static void buttons_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap = WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0); - + WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0); } @@ -355,7 +355,7 @@ static void buttons_header_region_message_subscribe( static void buttons_area_redraw(ScrArea *sa, short buttons) { SpaceButs *sbuts = sa->spacedata.first; - + /* if the area's current button set is equal to the one to redraw */ if (sbuts->mainb == buttons) ED_area_tag_redraw(sa); @@ -613,10 +613,10 @@ void ED_spacetype_buttons(void) { SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype buttons"); ARegionType *art; - + st->spaceid = SPACE_BUTS; strncpy(st->name, "Buttons", BKE_ST_MAXNAME); - + st->new = buttons_new; st->free = buttons_free; st->init = buttons_init; @@ -640,13 +640,13 @@ void ED_spacetype_buttons(void) BLI_addhead(&st->regiontypes, art); buttons_context_register(art); - + /* regions: header */ art = MEM_callocN(sizeof(ARegionType), "spacetype buttons region"); art->regionid = RGN_TYPE_HEADER; art->prefsizey = HEADERY; art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER; - + art->init = buttons_header_region_init; art->draw = buttons_header_region_draw; art->message_subscribe = buttons_header_region_message_subscribe; |