diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 17:17:05 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-12 17:17:05 +0300 |
commit | ec4ce908db6124037c4dfd927f22a9eec0ba4d52 (patch) | |
tree | 3318aa5a1103c0b88e16703bbb05794f2a5dac11 /source/blender/editors/space_view3d | |
parent | a6585fa4b1a7a4dd4b5ea21efcee36c8460ff5ec (diff) |
Fix T55452: Crash on saving with visible particle system.
Missing Main pointer in recent refactor/cleanup of G.main usages...
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index b82a841f40e..bf92fcfff33 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2672,7 +2672,7 @@ static void gpu_update_lamps_shadows_world(Main *bmain, Scene *scene, View3D *v3 /* no need to call ED_view3d_draw_offscreen_init since shadow buffers were already updated */ ED_view3d_draw_offscreen( - scene, v3d, &ar, winsize, winsize, viewmat, winmat, + bmain, scene, v3d, &ar, winsize, winsize, viewmat, winmat, false, false, true, NULL, NULL, NULL, NULL); GPU_lamp_shadow_buffer_unbind(shadow->lamp); @@ -2827,11 +2827,14 @@ void ED_view3d_update_viewmat( */ static void view3d_draw_objects( const bContext *C, + Main *bmain, Scene *scene, View3D *v3d, ARegion *ar, const char **grid_unit, const bool do_bgpic, const bool draw_offscreen, GPUFX *fx) { - Main *bmain = CTX_data_main(C); + if (bmain == NULL) { + bmain = CTX_data_main(C); + } RegionView3D *rv3d = ar->regiondata; Base *base; const bool do_camera_frame = !draw_offscreen; @@ -3168,7 +3171,7 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) * stuff like shadow buffers */ void ED_view3d_draw_offscreen( - Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, + Main *bmain, Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[4][4], float winmat[4][4], bool do_bgpic, bool do_sky, bool is_persp, const char *viewname, GPUFX *fx, GPUFXSettings *fx_settings, @@ -3237,7 +3240,7 @@ void ED_view3d_draw_offscreen( } /* main drawing call */ - view3d_draw_objects(NULL, scene, v3d, ar, NULL, do_bgpic, true, do_compositing ? fx : NULL); + view3d_draw_objects(NULL, bmain, scene, v3d, ar, NULL, do_bgpic, true, do_compositing ? fx : NULL); /* post process */ if (do_compositing) { @@ -3371,7 +3374,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf( if ((samples && use_full_sample) == 0) { /* Single-pass render, common case */ ED_view3d_draw_offscreen( - scene, v3d, ar, sizex, sizey, NULL, winmat, + bmain, scene, v3d, ar, sizex, sizey, NULL, winmat, draw_background, draw_sky, !is_ortho, viewname, fx, &fx_settings, ofs); @@ -3397,7 +3400,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf( /* first sample buffer, also initializes 'rv3d->persmat' */ ED_view3d_draw_offscreen( - scene, v3d, ar, sizex, sizey, NULL, winmat, + bmain, scene, v3d, ar, sizex, sizey, NULL, winmat, draw_background, draw_sky, !is_ortho, viewname, fx, &fx_settings, ofs); GPU_offscreen_read_pixels(ofs, GL_UNSIGNED_BYTE, rect_temp); @@ -3416,7 +3419,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf( (jit_ofs[j][1] * 2.0f) / sizey); ED_view3d_draw_offscreen( - scene, v3d, ar, sizex, sizey, NULL, winmat_jitter, + bmain, scene, v3d, ar, sizex, sizey, NULL, winmat_jitter, draw_background, draw_sky, !is_ortho, viewname, fx, &fx_settings, ofs); GPU_offscreen_read_pixels(ofs, GL_UNSIGNED_BYTE, rect_temp); @@ -3918,7 +3921,7 @@ static void view3d_main_region_draw_objects(const bContext *C, Scene *scene, Vie } /* main drawing call */ - view3d_draw_objects(C, scene, v3d, ar, grid_unit, true, false, do_compositing ? rv3d->compositor : NULL); + view3d_draw_objects(C, bmain, scene, v3d, ar, grid_unit, true, false, do_compositing ? rv3d->compositor : NULL); /* post process */ if (do_compositing) { |