diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-14 21:08:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-14 21:08:27 +0300 |
commit | fcdf2d694f29d9a5a2a4b0edb79db8904f8f2721 (patch) | |
tree | 596e61c8c8e06cd876b8718ab8e9bf4665e1d09f /source/blender/blenkernel/intern/texture.c | |
parent | a8e899335546b91ebb5526d7136297167db0306e (diff) |
Fix for bug #8555: geometry node front/bake was broken.
Fix for bug #7418: texture ipo's didn't show for textures in node materials.
Fix for part of bug #6758: node materials in other node materials could
miss texture coordinates.
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 3b8292a791c..ab0aecdd363 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -55,6 +55,7 @@ #include "DNA_image_types.h" #include "DNA_world_types.h" #include "DNA_brush_types.h" +#include "DNA_node_types.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -75,6 +76,7 @@ #include "BKE_icons.h" #include "BKE_ipo.h" #include "BKE_brush.h" +#include "BKE_node.h" /* ------------------------------------------------------------------------- */ @@ -729,6 +731,7 @@ Tex *give_current_texture(Object *ob, int act) Lamp *la = 0; MTex *mtex = 0; Tex *tex = 0; + bNode *node; if(ob==0) return 0; if(ob->totcol==0) return 0; @@ -739,7 +742,6 @@ Tex *give_current_texture(Object *ob, int act) mtex= la->mtex[(int)(la->texact)]; if(mtex) tex= mtex->tex; } - else tex= 0; } else { if(act>ob->totcol) act= ob->totcol; else if(act==0) act= 1; @@ -752,13 +754,25 @@ Tex *give_current_texture(Object *ob, int act) if(matarar && *matarar) ma= (*matarar)[act-1]; else ma= 0; - + } + + if(ma && ma->use_nodes && ma->nodetree) { + node= nodeGetActiveID(ma->nodetree, ID_TE); + + if(node) { + tex= (Tex *)node->id; + ma= NULL; + } + else { + node= nodeGetActiveID(ma->nodetree, ID_MA); + if(node) + ma= (Material*)node->id; + } } if(ma) { mtex= ma->mtex[(int)(ma->texact)]; if(mtex) tex= mtex->tex; } - else tex= 0; } return tex; |