Test code for Brecht:
Added a function that quickly extracts a full main dbase from an undo buffer, to pass on to render code. This will efficiently then make a render using only own memory, allowing real threading and running multiple renders at once.
This commit is contained in:
@@ -41,7 +41,9 @@ struct ListBase;
|
||||
struct MemFile;
|
||||
struct bContext;
|
||||
struct ReportList;
|
||||
|
||||
struct Scene;
|
||||
struct Main;
|
||||
|
||||
#define BLENDER_VERSION 250
|
||||
#define BLENDER_SUBVERSION 17
|
||||
|
||||
@@ -70,6 +72,7 @@ extern void BKE_reset_undo(void);
|
||||
extern char *BKE_undo_menu_string(void);
|
||||
extern void BKE_undo_number(struct bContext *C, int nr);
|
||||
extern void BKE_undo_save_quit(void);
|
||||
extern struct Main *BKE_undo_get_main(struct Scene **scene);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -421,6 +421,7 @@ int BKE_read_file_from_memfile(bContext *C, MemFile *memfile, ReportList *report
|
||||
return (bfd?1:0);
|
||||
}
|
||||
|
||||
|
||||
/* ***************** testing for break ************* */
|
||||
|
||||
static void (*blender_test_break_cb)(void)= NULL;
|
||||
@@ -710,3 +711,20 @@ void BKE_undo_save_quit(void)
|
||||
else printf("Saved session recovery to %s\n", str);
|
||||
}
|
||||
|
||||
/* sets curscene */
|
||||
Main *BKE_undo_get_main(Scene **scene)
|
||||
{
|
||||
Main *mainp= NULL;
|
||||
BlendFileData *bfd= BLO_read_from_memfile(G.main, G.sce, &curundo->memfile, NULL);
|
||||
|
||||
if(bfd) {
|
||||
mainp= bfd->main;
|
||||
if(scene)
|
||||
*scene= bfd->curscene;
|
||||
|
||||
MEM_freeN(bfd);
|
||||
}
|
||||
|
||||
return mainp;
|
||||
}
|
||||
|
||||
|
||||
@@ -3123,6 +3123,7 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec
|
||||
static void render_startjob(void *rjv, short *stop, short *do_update)
|
||||
{
|
||||
RenderJob *rj= rjv;
|
||||
// Main *mainp= BKE_undo_get_main(&rj->scene);
|
||||
|
||||
rj->stop= stop;
|
||||
rj->do_update= do_update;
|
||||
@@ -3136,6 +3137,9 @@ static void render_startjob(void *rjv, short *stop, short *do_update)
|
||||
RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step, rj->reports);
|
||||
else
|
||||
RE_BlenderFrame(rj->re, rj->scene, rj->srl, rj->scene->r.cfra);
|
||||
|
||||
// if(mainp)
|
||||
// free_main(mainp);
|
||||
}
|
||||
|
||||
/* called by render, check job 'stop' value or the global */
|
||||
|
||||
Reference in New Issue
Block a user