diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-09 06:50:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-09 06:50:09 +0400 |
commit | ecd463d20da56fa8e7a5c2c0849459ff9e320829 (patch) | |
tree | 470b828e53928a11eff52bc1a29dbc4ff32bec40 | |
parent | eca9a4ff40fe2a500d300820f564f1a8bfcf4a97 (diff) |
fix an error rendering opengl weightpaint data wasn't working when python initialized opengl render on startup (needed for testing script).
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 3 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 42 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 2 |
4 files changed, 38 insertions, 17 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 0562f400700..438646feaa4 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -287,7 +287,8 @@ void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_ int ED_view3d_lock(struct RegionView3D *rv3d); uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d); -uint64_t ED_viewedit_datamask(struct bScreen *screen); +uint64_t ED_view3d_screen_datamask(struct bScreen *screen); +uint64_t ED_view3d_object_datamask(struct Scene *scene); /* camera lock functions */ int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d); diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index be4d54ae2e8..7b4650b61b5 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -309,7 +309,13 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->rv3d= CTX_wm_region_view3d(C); /* MUST be cleared on exit */ - oglrender->scene->customdata_mask_modal= ED_view3d_datamask(oglrender->scene, oglrender->v3d); + oglrender->scene->customdata_mask_modal = (ED_view3d_datamask(oglrender->scene, oglrender->v3d) | + ED_view3d_object_datamask(oglrender->scene) ); + + /* apply immediately incase we're rendeing from a script, + * running notifiers again will overwrite */ + oglrender->scene->customdata_mask |= oglrender->scene->customdata_mask_modal; + } /* create render */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d3a0ee27256..3b355177852 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2251,32 +2251,46 @@ CustomDataMask ED_view3d_datamask(Scene *scene, View3D *v3d) return mask; } + +CustomDataMask ED_view3d_object_datamask(Scene *scene) +{ + Object *ob= scene->basact ? scene->basact->object : NULL; + CustomDataMask mask= 0; + + if (ob) { + /* check if we need tfaces & mcols due to face select or texture paint */ + if (paint_facesel_test(ob) || (ob->mode & OB_MODE_TEXTURE_PAINT)) { + mask |= CD_MASK_MTFACE | CD_MASK_MCOL; + } + + /* check if we need mcols due to vertex paint or weightpaint */ + if (ob->mode & OB_MODE_VERTEX_PAINT) { + mask |= CD_MASK_MCOL; + } + + if (ob->mode & OB_MODE_WEIGHT_PAINT) { + mask |= CD_MASK_WEIGHT_MCOL; + } + } + + return mask; +} + /* goes over all modes and view3d settings */ -CustomDataMask ED_viewedit_datamask(bScreen *screen) +CustomDataMask ED_view3d_screen_datamask(bScreen *screen) { Scene *scene= screen->scene; - Object *ob= scene->basact ? scene->basact->object : NULL; CustomDataMask mask = CD_MASK_BAREMESH; ScrArea *sa; - /* check if we need tfaces & mcols due to face select or texture paint */ - if(paint_facesel_test(ob) || (ob && ob->mode & OB_MODE_TEXTURE_PAINT)) - mask |= CD_MASK_MTFACE | CD_MASK_MCOL; - /* check if we need tfaces & mcols due to view mode */ for(sa = screen->areabase.first; sa; sa = sa->next) { if(sa->spacetype == SPACE_VIEW3D) { mask |= ED_view3d_datamask(scene, (View3D *)sa->spacedata.first); } } - - /* check if we need mcols due to vertex paint or weightpaint */ - if(ob) { - if(ob->mode & OB_MODE_VERTEX_PAINT) - mask |= CD_MASK_MCOL; - if(ob->mode & OB_MODE_WEIGHT_PAINT) - mask |= CD_MASK_WEIGHT_MCOL; - } + + mask |= ED_view3d_object_datamask(scene); return mask; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 43ed2b3b2b9..4107356ca0e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -282,7 +282,7 @@ void wm_event_do_notifiers(bContext *C) /* combine datamasks so 1 win doesn't disable UV's in another [#26448] */ for(win= wm->windows.first; win; win= win->next) { - win_combine_v3d_datamask |= ED_viewedit_datamask(win->screen); + win_combine_v3d_datamask |= ED_view3d_screen_datamask(win->screen); } /* cached: editor refresh callbacks now, they get context */ |