From b5553f006fbb75e57c052c4a04b1a4e4358ea7ba Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 9 Nov 2012 17:12:39 +0000 Subject: Fix #30505: bpy.context.copy() gives error running in the properties editor with cycles as render engine. --- source/blender/editors/space_buttons/buttons_context.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 9c47c407bd9..2da70468f0c 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -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")) { -- cgit v1.2.3