Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-04-28 19:20:52 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-04-28 19:20:52 +0400
commit428debd9c8af81ed5870c70466d46a60646f49e3 (patch)
treee0c5ed8607273a33293764eb203d02e559fbfba5 /source/blender/editors/space_buttons/buttons_context.c
parent85a4938c101ab5d50b2313ffeddf8af198e40074 (diff)
Fix for "new" Cycles handling of textures, UI code assumed all texture users use "texture" as prop name, but at least WeightVG modifiers do not.
Fixed by adding a "texture_user_property" member to spacebuts' context, and using it to get the prop identifier in ui script. Thanks to Brecht for its advice!
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 564f0589b58..7b93eb2ff70 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -685,7 +685,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
const char *buttons_context_dir[] = {
"texture_slot", "world", "object", "mesh", "armature", "lattice", "curve",
"meta_ball", "lamp", "speaker", "camera", "material", "material_slot",
- "texture", "texture_user", "bone", "edit_bone",
+ "texture", "texture_user", "texture_user_property", "bone", "edit_bone",
"pose_bone", "particle_system", "particle_system_editable", "particle_settings",
"cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", NULL
};
@@ -795,6 +795,19 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
+ else if (CTX_data_equals(member, "texture_user_property")) {
+ ButsContextTexture *ct = sbuts->texuser;
+
+ if (!ct)
+ return -1; /* old shading system (found but not available) */
+
+ if (ct->user && ct->user->ptr.data) {
+ ButsTextureUser *user = ct->user;
+ CTX_data_pointer_set(result, NULL, &RNA_Property, user->prop);
+ }
+
+ return 1;
+ }
else if (CTX_data_equals(member, "texture_node")) {
ButsContextTexture *ct = sbuts->texuser;