diff options
author | Ton Roosendaal <ton@blender.org> | 2006-07-13 17:19:27 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-07-13 17:19:27 +0400 |
commit | 3503ad47dc8b52e4422642eaced24db37237d5d6 (patch) | |
tree | a5e722a915e270e5ae89e91f6063d2ecc34c03b5 | |
parent | 464f3bd9667940b49c9bd2f8d5dfef6cef45ef74 (diff) |
fix #4675
Button "use nodes" was showing up when no material was visible in buttons.
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_shading.c | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 97731afb4ad..105218a0cab 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -129,7 +129,7 @@ typedef struct SpaceButs { short re_align; short oldkeypress; /* for keeping track of the sub tab key cycling */ - char use_nodes, flag; + char pad, flag; char texact, tab[7]; /* storing tabs for each context */ diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 8d6fb3d5b70..b35dbdfb2ea 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3181,7 +3181,7 @@ static void material_panel_links(Object *ob, Material *ma) bNode *node=NULL; float min; short xco; - char str[30], *cp; + char str[30]; block= uiNewBlock(&curarea->uiblocks, "material_panel_links", UI_EMBOSS, UI_HELV, curarea->win); /* 310 makes sorting code to put it right after preview panel */ @@ -3199,9 +3199,8 @@ static void material_panel_links(Object *ob, Material *ma) if(ma) uiSetButLock(ma->id.lib!=NULL, "Can't edit library data"); - if(ma) cp= &ma->use_nodes; else cp= &G.buts->use_nodes; - uiDefButC(block, TOG, B_MAT_USENODES, "Nodes", xco+5,160,300-xco-5,20, cp, 0.0f, 0.0f, 0, 0, ""); - G.buts->use_nodes= *cp; + if(ma) + uiDefButC(block, TOG, B_MAT_USENODES, "Nodes", xco+5,160,300-xco-5,20, &ma->use_nodes, 0.0f, 0.0f, 0, 0, ""); if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */ |