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:
authorTon Roosendaal <ton@blender.org>2003-11-25 19:48:55 +0300
committerTon Roosendaal <ton@blender.org>2003-11-25 19:48:55 +0300
commit4501069c2759493d8462ad0554185bbef172d5c6 (patch)
tree080432b41856ec6898b37b809e9f5b32ce6e8f6b
parent5f0704c4f5426bb9ae4243c0600824062089890d (diff)
- the weird OB and ME buttons in 2nd Panel in MaterialButtons didnt work
properly. Also the "1 Mat 1" buttons didnt display in all situations.
-rw-r--r--source/blender/src/buttons_shading.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 603cc15209c..e37f4126852 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -2319,9 +2319,12 @@ static void material_panel_material(Object *ob, Material *ma)
if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */
-
uiBlockBeginAlign(block);
+ /* id is the block from which the material is used */
+ if( BTST(ob->colbits, ob->actcol-1) ) id= (ID *)ob;
+ else id= ob->data;
+
/* indicate which one is linking a material */
if(id) {
strncpy(str, id->name, 2);
@@ -2338,19 +2341,13 @@ static void material_panel_material(Object *ob, Material *ma)
uiDefButS(block, TOGN|BIT|(ob->actcol-1), B_MATFROM, str, 158,174,32,20, &ob->colbits, 0, 0, 0, 0, "Show the block the material is linked to");
uiBlockSetCol(block, TH_AUTO);
- if( id == NULL ) return;
- uiSetButLock(id->lib!=0, "Can't edit library data");
-
- /* id is the block from which the material is used */
- if( BTST(ob->colbits, ob->actcol-1) ) id= (ID *)ob;
- else id= ob->data;
-
sprintf(str, "%d Mat", ob->totcol);
if(ob->totcol) min= 1.0; else min= 0.0;
uiDefButC(block, NUM, B_ACTCOL, str, 191,174,114,20, &(ob->actcol), min, (float)ob->totcol, 0, 0, "Number of materials on object / Active material");
uiBlockEndAlign(block);
if(ob->totcol==0) return;
+ uiSetButLock(id->lib!=0, "Can't edit library data");
ma= give_current_material(ob, ob->actcol);
if(ma==0) return;