diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-22 01:35:45 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-22 01:35:45 +0400 |
commit | c26a4be5c013650f339f446185339aa71f2b88c4 (patch) | |
tree | 6879a4f3030d1e75206a4cb50ed4c00343b91247 /source/blender/makesrna | |
parent | 2a5b6d9c8f167724d2ddd2bf1a2b59036121ac81 (diff) |
Fix [#36530] Texture tab refreshing problem
That was not really a bug (code working as expected), but the way tex context was handled was a bit raw, now it is much smarter:
* Default fallback context (when current one is no more valid) will now choose "most specific" ones first (i.e. material/lamp/particules before world and "others").
* When using that default fallback context, previous one is stored and we try to revive it later, if possible. Thus e.g. object[mat tex ctxt] -> empty[default world ctxt] -> object[mat tex ctxt] is now working as expected.
* However, when user explicitely or implicitely (through e.g. going to Material context...) sets a tex context, previous one is not stored, so that only default fallback context switch may later automatically revive a previous (presumably user-set) context.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f7a0d865274..7b72a29e3bf 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -959,6 +959,14 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, return item; } +static void rna_SpaceProperties_texture_context_set(PointerRNA *ptr, int value) +{ + SpaceButs *sbuts = (SpaceButs *)(ptr->data); + + /* User action, no need to keep "better" value in prev here! */ + sbuts->texture_context = sbuts->texture_context_prev = value; +} + /* Space Console */ static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value) { @@ -2194,7 +2202,8 @@ static void rna_def_space_buttons(BlenderRNA *brna) prop = RNA_def_property(srna, "texture_context", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, buttons_texture_context_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceProperties_texture_context_itemf"); + RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_texture_context_set", + "rna_SpaceProperties_texture_context_itemf"); RNA_def_property_ui_text(prop, "Texture Context", "Type of texture data to display and edit"); RNA_def_property_update(prop, NC_TEXTURE, NULL); |