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-05-17 11:10:10 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-05-17 11:10:10 +0400
commit9d567dd3662e5d79c98c64829f3d039e75697395 (patch)
treeaf8b0cd080b62b72f24729df0e15d3f38d61f64a /source/blender/makesdna
parent308d014b498be3aaf3fd74aeee0ed52947d0b6cc (diff)
This commit addresses the somewhat weak handling of stackless textures in Blender with default (BI) renderer. To do so, it's defining an "other" texture context, and when in this one, it switches to using the "new shading" texture handling already known with Cycles engine.
So now, in the new "other" tex context, you can (depending on active data) have direct access to modifiers', force's or brushes' textures... I also refactored a bit how texture contexts are handled (once again, we had some quite similar code in both space_buttons and RNA sources). This should also solve some harmless glitches like "no texture context selected in UI" sometimes when you remove data related to current texture (see e.g. after removing the material from default cube, in startup scene). This usage of two different systems for textures, and the handling of switches between them, has been a bit tricky to get working right, but it is OK now I think. I also had to add a bool flag to buttons space, SB_TEX_USER_LIMITED (use_limited_texture_context in RNA), which indicates "new shading" texture code whether it has to ignore materials, lamps etc. (BI) or not (Cycles). Btw, pinned textures from modifiers/force/etc. were also broken (showing nothing), now it should work too. Thanks to Brecht for reviewing.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_space_types.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 91987294572..6d7926b1e84 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -190,18 +190,22 @@ typedef enum eSpaceButtons_Context {
} eSpaceButtons_Context;
/* sbuts->flag */
-#define SB_PRV_OSA 1
-#define SB_PIN_CONTEXT 2
-//#define SB_WORLD_TEX 4 //not used anymore
-//#define SB_BRUSH_TEX 8 //not used anymore
-#define SB_SHADING_CONTEXT 16
+typedef enum eSpaceButtons_Flag {
+ SB_PRV_OSA = (1 << 0),
+ SB_PIN_CONTEXT = (1 << 1),
+ /* SB_WORLD_TEX = (1 << 2), */ /* not used anymore */
+ /* SB_BRUSH_TEX = (1 << 3), */ /* not used anymore */
+ SB_TEX_USER_LIMITED = (1 << 3), /* Do not add materials, particles, etc. in TemplateTextureUser list. */
+ SB_SHADING_CONTEXT = (1 << 4),
+} eSpaceButtons_Flag;
/* sbuts->texture_context */
typedef enum eSpaceButtons_Texture_Context {
- SB_TEXC_MAT_OR_LAMP = 0,
+ SB_TEXC_MATERIAL = 0,
SB_TEXC_WORLD = 1,
- SB_TEXC_BRUSH = 2,
+ SB_TEXC_LAMP = 2,
SB_TEXC_PARTICLES = 3,
+ SB_TEXC_OTHER = 4,
} eSpaceButtons_Texture_Context;
/* sbuts->align */
@@ -212,7 +216,7 @@ typedef enum eSpaceButtons_Align {
BUT_AUTO = 3,
} eSpaceButtons_Align;
-/* sbuts->scaflag */
+/* sbuts->scaflag */
#define BUTS_SENS_SEL 1
#define BUTS_SENS_ACT 2
#define BUTS_SENS_LINK 4