Two additional fixes for node-tree + texture paint:
authorTon Roosendaal <ton@blender.org>
Fri, 4 Mar 2011 12:59:09 +0000 (12:59 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 4 Mar 2011 12:59:09 +0000 (12:59 +0000)
- "need exec" flag was cleared in wrong tree for preview renders
  (it should clear it in the copy, i did in original).
  This fixes projection paint on images with previews open
- Previews for nodes were copied always, now only for previews
  invoked by node editor itself.

source/blender/blenkernel/intern/node.c
source/blender/editors/render/render_preview.c

index 3cc2c673e8efc157d337ba26c6f611d2d1e1c777..46a7b9cbeec38f99b61a48ede336d24d79851a4c 100644 (file)
@@ -2815,14 +2815,14 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
        /* end animdata uglyness */
 
        /* ensures only a single output node is enabled */
-       ntreeSetOutput(ntree);
+       ntreeSetOutput(ltree);
 
        for(node= ntree->nodes.first; node; node= node->next) {
                
                /* store new_node pointer to original */
                node->new_node->new_node= node;
                /* ensure new user input gets handled ok */
-               node->need_exec= 0;
+               node->new_node->need_exec= 0;
                
                if(ntree->type==NTREE_COMPOSIT) {
                        /* move over the compbufs */
index 1a454341f014dbd7b9df568c7b88e0a2e2a67e81..33f81bb7d16701da076a757c553d251ef18e391f 100644 (file)
@@ -983,19 +983,20 @@ static void shader_preview_updatejob(void *spv)
        ShaderPreview *sp= spv;
        
        if(sp->id) {
-               if( GS(sp->id->name) == ID_MA) {
-                       Material *mat= (Material *)sp->id;
-                       
-                       if(sp->matcopy && mat->nodetree && sp->matcopy->nodetree)
-                               ntreeLocalSync(sp->matcopy->nodetree, mat->nodetree);
-               }
-               else if( GS(sp->id->name) == ID_TE) {
-                       Tex *tex= (Tex *)sp->id;
-                       
-                       if(sp->texcopy && tex->nodetree && sp->texcopy->nodetree)
-                               ntreeLocalSync(sp->texcopy->nodetree, tex->nodetree);
-               }
-               
+               if(sp->pr_method==PR_NODE_RENDER) {
+                       if( GS(sp->id->name) == ID_MA) {
+                               Material *mat= (Material *)sp->id;
+                               
+                               if(sp->matcopy && mat->nodetree && sp->matcopy->nodetree)
+                                       ntreeLocalSync(sp->matcopy->nodetree, mat->nodetree);
+                       }
+                       else if( GS(sp->id->name) == ID_TE) {
+                               Tex *tex= (Tex *)sp->id;
+                               
+                               if(sp->texcopy && tex->nodetree && sp->texcopy->nodetree)
+                                       ntreeLocalSync(sp->texcopy->nodetree, tex->nodetree);
+                       }
+               }               
        }
 }