diff options
author | Robin Allen <roblovski@gmail.com> | 2009-08-19 04:46:06 +0400 |
---|---|---|
committer | Robin Allen <roblovski@gmail.com> | 2009-08-19 04:46:06 +0400 |
commit | e21c1dde810b3447eaa1f6a667ae027978b18d9b (patch) | |
tree | 81ffd3f7b150f6caef9c59a1dc5a64a44d0c3dbd | |
parent | d37d6738946bfecd2cf15f13e3067325bb227542 (diff) |
Texture node previews: Well and truly fixed.
(Probably.)
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 6 | ||||
-rw-r--r-- | source/blender/nodes/intern/TEX_util.c | 12 |
3 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 93e7505693f..f3df7a29c2e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -609,7 +609,6 @@ static void do_node_internal_buttons(bContext *C, void *node_v, int event) } else if(snode->treetype==NTREE_TEXTURE) { WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id); - ntreeTexUpdatePreviews(snode->nodetree); } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 07277fe878d..20873566867 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -46,6 +46,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_node.h" #include "ED_previewrender.h" #include "ED_space_api.h" @@ -181,6 +182,11 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) if(scene->use_nodes) snode_composite_job(C, sa); } + else if(snode->treetype==NTREE_TEXTURE) { + Tex *tex= (Tex *)snode->id; + if(tex->use_nodes) + ntreeTexUpdatePreviews(tex->nodetree); + } } } diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index 0bb9d887ae3..a6a5877722b 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -246,14 +246,12 @@ void ntreeTexUpdatePreviews(bNodeTree* nodetree) for(tex= G.main->tex.first; tex; tex= tex->id.next) if(tex->nodetree == nodetree) break; - if(!tex) return; - - dummy_texres.nor = 0; - - ntreeBeginExecTree(nodetree); - ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); - ntreeEndExecTree(nodetree); + if(tex) { + dummy_texres.nor = 0; + ntreeBeginExecTree(nodetree); + ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); + } } char* ntreeTexOutputMenu(bNodeTree *ntree) |