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:
authorMatt Ebb <matt@mke3.net>2006-11-20 08:12:58 +0300
committerMatt Ebb <matt@mke3.net>2006-11-20 08:12:58 +0300
commit5428f2eb6c33b970d66f06dc5b08bc70bf98f3fb (patch)
treee17b31c8327f34fa463816a15dc286345b1c75c7 /source/blender/src/interface_icons.c
parente435fbc3c5a00e5b63c1cd2609ab6828187660d3 (diff)
* Object level restrictions in outliner
This adds the ability to restrict an individual object from: - being visible in the 3D View - being selectable in the 3D View - being renderable with 3 columns of buttons in the outliner. These restrictions are further down the hierarchy than layers, so for example if an object is in an invisible layer, it will be invisible regardless of whether the object's own visibility setting is on or off. This works on a different conceptual level than layers, being better for more quick interaction (like temporarily making a mesh unselectable while you're posing its armature), rather than so much for scene organisation. The 3 columns of icons can be turned off in the Outliner View menu. Along with this is some small cleaning up in interface_icons.c and outliner.c.
Diffstat (limited to 'source/blender/src/interface_icons.c')
-rw-r--r--source/blender/src/interface_icons.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c
index 65930a53417..3fb6caf15b5 100644
--- a/source/blender/src/interface_icons.c
+++ b/source/blender/src/interface_icons.c
@@ -94,6 +94,13 @@
#define ICON_RENDERSIZE 32
#define ICON_MIPMAPS 8
+#define ICON_GRID_COLS 25
+#define ICON_GRID_ROWS 12
+
+#define ICON_GRID_MARGIN 5
+#define ICON_GRID_W 15
+#define ICON_GRID_H 16
+
typedef struct DrawInfo {
int w;
int h;
@@ -457,29 +464,33 @@ static void clear_transp_rect_soft(unsigned char *transp, unsigned char *rect, i
}
#endif
-static void clear_transp_rect(unsigned char *transp, unsigned char *rect, int w, int h, int rowstride)
+static void clear_icon_grid_margins(unsigned char *rect, int w, int h)
{
- int x,y;
+ int x, y;
+ int xoffs=ICON_GRID_W+ICON_GRID_MARGIN;
+ int yoffs=ICON_GRID_H+ICON_GRID_MARGIN;
+
for (y=0; y<h; y++) {
- unsigned char *row= &rect[y*rowstride];
+ unsigned char *row= &rect[y*w*4];
+
for (x=0; x<w; x++) {
unsigned char *pxl= &row[x*4];
- if (*((unsigned int*) pxl)==*((unsigned int*) transp)) {
- pxl[3]= 0;
- }
+
+ if ((x % xoffs < ICON_GRID_MARGIN-2) || (x % xoffs > ICON_GRID_W+2))
+ pxl[3] = 0; //alpha channel == x+3
+ else if ((y % yoffs < ICON_GRID_MARGIN-2) || (y % yoffs > ICON_GRID_H+2))
+ pxl[3] = 0;
}
}
}
static void prepare_internal_icons(ImBuf *bbuf)
{
- int rowstride= bbuf->x*4;
+
char *back= (char *)bbuf->rect;
- unsigned char transp[4];
- /* this sets blueish outside of icon to zero alpha */
- QUATCOPY(transp, back);
- clear_transp_rect(transp, back, bbuf->x, bbuf->y, rowstride);
+ /* this sets the icon grid margin area outside of icon to zero alpha */
+ clear_icon_grid_margins(back, bbuf->x, bbuf->y);
/* hack! */
#if 0
@@ -507,9 +518,11 @@ static void init_internal_icons()
prepare_internal_icons(bbuf);
- for (y=0; y<12; y++) {
- for (x=0; x<21; x++) {
- def_internal_icon(bbuf, BIFICONID_FIRST + y*21 + x, x*20+3, y*21+3);
+ for (y=0; y<ICON_GRID_ROWS; y++) {
+ for (x=0; x<ICON_GRID_COLS; x++) {
+ def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x,
+ x*(ICON_GRID_W+ICON_GRID_MARGIN)+3,
+ y*(ICON_GRID_H+ICON_GRID_MARGIN)+3);
}
}