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:
authorJanne Karhu <jhkarh@gmail.com>2011-02-08 17:29:48 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-02-08 17:29:48 +0300
commit811a1b910ca8f699ce499645ab99552fc2c83937 (patch)
tree9086296cbb58a943b9a95b6ed9f4aef9ecfe5194 /source/blender/editors/space_buttons/buttons_context.c
parent9e73ac2b9f6ba34c95e7146f346009363eb46a4d (diff)
Texture context selector for texture panel:
* Texture context was previously determined by going to the appropriate panel, for example "world panel -> texture panel" to access world textures. Additionally there was a separate button to access brush textures. * Now the texture context can be selected directly through an expanded icon menu, which shows the available context options. * This context selector is now at the top of the texture panel, but this could later be perhaps integrated to the context path somehow to be more intuitive.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index b0b1c23cbc0..d075958ffef 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -66,6 +66,7 @@ typedef struct ButsContextPath {
PointerRNA ptr[8];
int len;
int flag;
+ int tex_ctx;
} ButsContextPath;
static int set_pointer_type(ButsContextPath *path, bContextDataResult *result, StructRNA *type)
@@ -368,7 +369,7 @@ static int buttons_context_path_texture(ButsContextPath *path)
return 1;
}
/* try brush */
- if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(path)) {
+ if((path->tex_ctx == SB_TEXC_BRUSH) && buttons_context_path_brush(path)) {
br= path->ptr[path->len-1].data;
if(br) {
@@ -380,7 +381,7 @@ static int buttons_context_path_texture(ButsContextPath *path)
}
}
/* try world */
- if((path->flag & SB_WORLD_TEX) && buttons_context_path_world(path)) {
+ if((path->tex_ctx == SB_TEXC_WORLD) && buttons_context_path_world(path)) {
wo= path->ptr[path->len-1].data;
if(wo && GS(wo->id.name)==ID_WO) {
@@ -442,6 +443,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
memset(path, 0, sizeof(*path));
path->flag= flag;
+ path->tex_ctx = sbuts->texture_context;
/* if some ID datablock is pinned, set the root pointer */
if(sbuts->pinid) {
@@ -534,13 +536,12 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
{
ButsContextPath *path;
PointerRNA *ptr;
- int a, pflag, flag= 0;
+ int a, pflag= 0, flag= 0;
if(!sbuts->path)
sbuts->path= MEM_callocN(sizeof(ButsContextPath), "ButsContextPath");
path= sbuts->path;
- pflag= (sbuts->flag & (SB_WORLD_TEX|SB_BRUSH_TEX));
/* for each context, see if we can compute a valid path to it, if
* this is the case, we know we have to display the button */