diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-23 07:16:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-23 07:16:31 +0300 |
commit | c046ae14be2e0142c3ea9c5d81b946594043c3f7 (patch) | |
tree | 8c6d502768d872e245d42a45507075bc1ed5ab0a /source/blender/editors/space_view3d | |
parent | 86b89af5ddaede7bedf6a98f20e0b4f92e5796b2 (diff) |
Fix for multiple modifier stack calculations per frame.
Since 2.5x blender has been using CD_MASK_BAREMESH for updating objects since object_handle_update() no longer has access to G.curscreen to calculate the mask from viewports.
The problem with this is after an initial calculation, CD_MASK_MTFACE may be required on draw, so it would recalculate the modifier stack multiple times per frame.
One case which caused this is armature animated mesh with texface in a dupligroup.
Fix this by having customdata_mask member in the scene, this isn't great design but at least fixes the bug and only changes a few files.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 968579dbd1d..407ac6da2c5 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1950,8 +1950,10 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) /* *********************** customdata **************** */ /* goes over all modes and view3d settings */ -static CustomDataMask get_viewedit_datamask(bScreen *screen, Scene *scene, Object *ob) +CustomDataMask ED_viewedit_datamask(bScreen *screen) { + Scene *scene= screen->scene; + Object *ob= scene->basact ? scene->basact->object : NULL; CustomDataMask mask = CD_MASK_BAREMESH; ScrArea *sa; @@ -2301,11 +2303,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) Object *ob; float backcol[3]; unsigned int lay_used; - Object *obact = OBACT; const char *grid_unit= NULL; /* from now on all object derived meshes check this */ - v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), scene, obact); + v3d->customdata_mask= scene->customdata_mask; /* shadow buffers, before we setup matrices */ if(draw_glsl_material(scene, NULL, v3d, v3d->drawtype)) |