Bugfix #6211
authorTon Roosendaal <ton@blender.org>
Tue, 13 Mar 2007 12:20:55 +0000 (12:20 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 13 Mar 2007 12:20:55 +0000 (12:20 +0000)
Group nodes with animation nodes inside (like Time) did not get updated
correctly.

I also noticed that with time Nodes,  the hotkey "E" (execute) fails to do
a composite after frame changes, fixed that too.

source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node_composite.c
source/blender/src/headerbuttons.c

index 53b7cb9751d8d55bba70e337a33cab3a1cccabc1..e8fe21c0ae592c2d5cdbee1aac1bc88d692ff4a8 100644 (file)
@@ -277,7 +277,7 @@ extern bNodeType *node_all_composit[];
 /* API */
 struct CompBuf;
 void ntreeCompositTagRender(struct Scene *sce);
-void ntreeCompositTagAnimated(struct bNodeTree *ntree);
+int ntreeCompositTagAnimated(struct bNodeTree *ntree);
 void ntreeCompositTagGenerators(struct bNodeTree *ntree);
 void ntreeCompositForceHidden(struct bNodeTree *ntree);
 
index 06f8c40249078aa1d07adc68397f99527c0fd188..2ad849cc69a5597087ab1c7700f5ec2ac1852bb5 100644 (file)
@@ -6072,23 +6072,37 @@ void ntreeCompositTagRender(Scene *curscene)
 }
 
 /* tags nodes that have animation capabilities */
-void ntreeCompositTagAnimated(bNodeTree *ntree)
+int ntreeCompositTagAnimated(bNodeTree *ntree)
 {
        bNode *node;
+       int tagged= 0;
        
-       if(ntree==NULL) return;
+       if(ntree==NULL) return 0;
        
        for(node= ntree->nodes.first; node; node= node->next) {
                if(node->type==CMP_NODE_IMAGE) {
                        Image *ima= (Image *)node->id;
-                       if(ima && ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
+                       if(ima && ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                                NodeTagChanged(ntree, node);
+                               tagged= 1;
+                       }
                }
-               else if(node->type==CMP_NODE_TIME)
+               else if(node->type==CMP_NODE_TIME) {
                        NodeTagChanged(ntree, node);
-               else if(node->type==CMP_NODE_R_LAYERS)
+                       tagged= 1;
+               }
+               else if(node->type==CMP_NODE_R_LAYERS) {
                        NodeTagChanged(ntree, node);
+                       tagged= 1;
+               }
+               else if(node->type==NODE_GROUP) {
+                       if( ntreeCompositTagAnimated((bNodeTree *)node->id) ) {
+                               NodeTagChanged(ntree, node);
+                       }
+               }
        }
+       
+       return tagged;
 }
 
 
index c631fa0e4312262c1ab7a369ed7c43296b9db3ad..e185da56f5e276c42704fcf3d41e20e71d77a9cd 100644 (file)
 #include "BKE_material.h"
 #include "BKE_mball.h"
 #include "BKE_mesh.h"
+#include "BKE_node.h"
 #include "BKE_object.h"
 #include "BKE_packedFile.h"
 #include "BKE_sca.h"
@@ -418,9 +419,15 @@ static void do_update_for_newframe(int mute, int events)
        if ( (CFRA>1) && (!mute) && (G.scene->audio.flag & AUDIO_SCRUB)) 
                audiostream_scrub( CFRA );
        
+       /* 3d window, preview */
        BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
 
+       /* all movie/sequence images */
        BIF_image_update_frame();
+       
+       /* composite */
+       if(G.scene->use_nodes && G.scene->nodetree)
+               ntreeCompositTagAnimated(G.scene->nodetree);
 }
 
 void update_for_newframe(void)