diff options
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 47 | ||||
-rw-r--r-- | source/blender/src/editnode.c | 24 | ||||
-rw-r--r-- | source/blender/src/renderwin.c | 3 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 2 |
6 files changed, 57 insertions, 23 deletions
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index af39bd8dd1c..1b5b2d5940a 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -175,7 +175,7 @@ void RE_stats_draw_cb (struct Render *re, void (*f)(RenderStats *rs)); void RE_timecursor_cb (struct Render *re, void (*f)(int)); void RE_test_break_cb (struct Render *re, int (*f)(void)); void RE_test_return_cb (struct Render *re, int (*f)(void)); -void RE_error_cb (struct Render *re, void (*f)(const char *str)); +void RE_error_cb (struct Render *re, void (*f)(char *str)); /* should move to kernel once... still unsure on how/where */ float RE_filter_value(int type, float x); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index b5eb5eef313..504fc228a1a 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -177,7 +177,7 @@ struct Render int (*test_break)(void); int (*test_return)(void); - void (*error)(const char *str); + void (*error)(char *str); RenderStats i; }; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 3dbca3bcc96..5c8b292ec14 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -120,7 +120,7 @@ static void result_rcti_nothing(RenderResult *rr, volatile struct rcti *rect) {} static void stats_nothing(RenderStats *rs) {} static void int_nothing(int val) {} static int void_nothing(void) {return 0;} -static void print_error(const char *str) {printf("ERROR: %s\n", str);} +static void print_error(char *str) {printf("ERROR: %s\n", str);} static void stats_background(RenderStats *rs) { @@ -842,7 +842,7 @@ void RE_test_return_cb(Render *re, int (*f)(void)) { re->test_return= f; } -void RE_error_cb(Render *re, void (*f)(const char *str)) +void RE_error_cb(Render *re, void (*f)(char *str)) { re->error= f; } @@ -1097,6 +1097,10 @@ static void threaded_tile_processor(Render *re) else if(re->r.mode & R_PANORAMA) { if(nextpa==NULL && BLI_available_threads(&threads)==maxthreads) nextpa= find_next_pano_slice(re, &minx, &viewplane); + else { + PIL_sleep_ms(50); + drawtimer++; + } } else { PIL_sleep_ms(50); @@ -1179,6 +1183,7 @@ void render_one_frame(Render *re) RE_Database_Free(re); } +#if 0 /* accumulates osa frames */ static void do_render_blurred(Render *re, float frame) { @@ -1190,6 +1195,7 @@ static void do_render_fields(Render *re) { } +#endif /* within context of current Render *re, render another scene. it uses current render image size and disprect, but doesn't execute composite @@ -1222,11 +1228,11 @@ void RE_RenderScene(Render *re, Scene *sce, int cfra) resc->stats_draw= re->stats_draw; if(resc->r.mode & R_FIELDS) - do_render_fields(resc); + printf("No field render yet...\n"); //do_render_fields(resc); else if(resc->r.mode & R_MBLUR) - do_render_blurred(resc, resc->r.cfra); - else - render_one_frame(resc); + printf("No mblur render yet...\n"); //do_render_blurred(resc, resc->r.cfra); + //else + render_one_frame(resc); } @@ -1316,11 +1322,11 @@ static void do_render_final(Render *re) RE_SetCamera(re, re->scene->camera); if(re->r.mode & R_FIELDS) - do_render_fields(re); + printf("No field render yet...\n"); //do_render_fields(resc); else if(re->r.mode & R_MBLUR) - do_render_blurred(re, re->scene->r.cfra); - else - render_one_frame(re); + printf("No mblur render yet...\n"); //do_render_blurred(resc, resc->r.cfra); + //else + render_one_frame(re); } /* swap render result */ @@ -1379,6 +1385,27 @@ static int is_rendering_allowed(Render *re) } } + if(re->r.scemode & R_DOCOMP) { + if(re->scene->use_nodes) { + bNodeTree *ntree= re->scene->nodetree; + bNode *node; + + if(ntree==NULL) { + re->error("No Nodetree in Scene"); + return 0; + } + + for(node= ntree->nodes.first; node; node= node->next) + if(node->type==CMP_NODE_COMPOSITE) + break; + + if(node==NULL) { + re->error("No Render Output Node in Scene"); + return 0; + } + } + } + /* check valid camera */ if(re->scene->camera==NULL) re->scene->camera= scene_find_camera(re->scene); diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index 6f3a3a4fb15..f7cf5be5df4 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -333,7 +333,7 @@ void node_shader_default(Material *ma) /* called from shading buttons or header */ void node_composit_default(Scene *sce) { - bNode *in, *out; + bNode *in, *out1, *out2; bNodeSocket *fromsock, *tosock; /* but lets check it anyway */ @@ -344,27 +344,31 @@ void node_composit_default(Scene *sce) sce->nodetree= ntreeAddTree(NTREE_COMPOSIT); - out= nodeAddNodeType(sce->nodetree, CMP_NODE_VIEWER, NULL); - out->locx= 300.0f; out->locy= 300.0f; + out1= nodeAddNodeType(sce->nodetree, CMP_NODE_VIEWER, NULL); + out1->locx= 300.0f; out1->locy= 200.0f; + out2= nodeAddNodeType(sce->nodetree, CMP_NODE_COMPOSITE, NULL); + out2->locx= 300.0f; out2->locy= 500.0f; in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_RESULT, NULL); - in->locx= 10.0f; in->locy= 300.0f; + in->locx= 10.0f; in->locy= 400.0f; nodeSetActive(sce->nodetree, in); - /* only a link from color to color */ + /* links from color to color */ fromsock= in->outputs.first; - tosock= out->inputs.first; - nodeAddLink(sce->nodetree, in, fromsock, out, tosock); + tosock= out1->inputs.first; + nodeAddLink(sce->nodetree, in, fromsock, out1, tosock); + tosock= out2->inputs.first; + nodeAddLink(sce->nodetree, in, fromsock, out2, tosock); ntreeSolveOrder(sce->nodetree); /* needed for pointers */ - out->id= find_id("IM", "Compositor"); - if(out->id==NULL) { + out1->id= find_id("IM", "Compositor"); + if(out1->id==NULL) { Image *ima= alloc_libblock(&G.main->image, ID_IM, "Compositor"); strcpy(ima->name, "Compositor"); ima->ok= 1; ima->xrep= ima->yrep= 1; - out->id= &ima->id; + out1->id= &ima->id; } } diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c index 2562111e59f..e115857e893 100644 --- a/source/blender/src/renderwin.c +++ b/source/blender/src/renderwin.c @@ -80,6 +80,7 @@ #include "BIF_renderwin.h" #include "BIF_resources.h" #include "BIF_toets.h" +#include "BIF_toolbox.h" #include "BIF_writeimage.h" #include "BDR_editobject.h" @@ -1030,6 +1031,7 @@ static void end_test_break_callback() - set callbacks - cleanup */ +static void error_cb(char *str){error(str);} static void do_render(int anim) { @@ -1045,6 +1047,7 @@ static void do_render(int anim) RE_display_init_cb(re, renderwin_init_display_cb); RE_display_draw_cb(re, renderwin_progress_display_cb); RE_display_clear_cb(re, renderwin_clear_display_cb); + RE_error_cb(re, error_cb); init_test_break_callback(); RE_test_break_cb(re, test_break); RE_timecursor_cb(re, set_timecursor); diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 183884eb19d..a8d0d70f3f4 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -221,7 +221,7 @@ void error(char *fmt, ...) sprintf(nfmt, "%s", fmt); va_start(ap, fmt); - if (G.background || !G.curscreen || (G.rendering)) { + if (G.background || !G.curscreen) { vprintf(nfmt, ap); printf("\n"); } else { |