diff options
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index c41d2521ee8..2da70468f0c 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -236,7 +236,7 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture) if (ma) { RNA_id_pointer_create(&ma->id, &path->ptr[path->len]); path->len++; - } + } return 1; } } @@ -680,9 +680,9 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts) /************************* Context Callback ************************/ const char *buttons_context_dir[] = { - "world", "object", "mesh", "armature", "lattice", "curve", + "texture_slot", "world", "object", "mesh", "armature", "lattice", "curve", "meta_ball", "lamp", "speaker", "camera", "material", "material_slot", - "texture", "texture_slot", "texture_user", "bone", "edit_bone", + "texture", "texture_user", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", "particle_settings", "cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", NULL }; @@ -697,7 +697,12 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r /* here we handle context, getting data from precomputed path */ if (CTX_data_dir(member)) { - CTX_data_dir_set(result, buttons_context_dir); + /* in case of new shading system we skip texture_slot, complex python + * UI script logic depends on checking if this is available */ + if (sbuts->texuser) + CTX_data_dir_set(result, buttons_context_dir + 1); + else + CTX_data_dir_set(result, buttons_context_dir); return 1; } else if (CTX_data_equals(member, "world")) { @@ -889,7 +894,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r else CTX_data_pointer_set(result, NULL, &RNA_ParticleSystem, NULL); return 1; - } + } else if (CTX_data_equals(member, "particle_settings")) { /* only available when pinned */ PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSettings); @@ -900,7 +905,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r } else { /* get settings from active particle system instead */ - PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSystem); + ptr = get_pointer_type(path, &RNA_ParticleSystem); if (ptr && ptr->data) { ParticleSettings *part = ((ParticleSystem *)ptr->data)->part; |