diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 23:57:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 23:57:56 +0400 |
commit | dff1738765aba649b07f3174ed807e7df8e38eee (patch) | |
tree | 0b71525891f28b3c1a1284b0c8d0f357755c5248 /source/blender/editors/space_view3d/space_view3d.c | |
parent | efed73598f7d571aa57468b31748c5777dbfc41f (diff) |
bugfix for exitmode verts being unselectable. caused by view3d_project_short_clip/noclip being used by selecton code outside of object drawing (which isnt supposed to happen according to view3d_project_short_* comments).
Deal with this by adding ED_view3d_init_mats_rv3d(ob, r3d) which initialized the region mat's and is used in mesh_foreachScreenVert, mesh_foreachScreenEdge etc.
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e1bd48e002f..d017e11e783 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -158,6 +158,24 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) return rv3d; } +/* Most of the time this isn't needed since you could assume the view matrix was + * set while drawing, however when functions like mesh_foreachScreenVert are + * called by selection tools, we can't be sure this object was the last. + * + * for example, transparent objects are drawn after editmode and will cause + * the rv3d mat's to change and break selection. + * + * 'ED_view3d_init_mats_rv3d' should be called before + * view3d_project_short_clip and view3d_project_short_noclip in cases where + * these functions are not used during draw_object + */ +void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d) +{ + wmMultMatrix(ob->obmat); + /* local viewmat and persmat, to calculate projections */ + wmGetMatrix(rv3d->viewmatob); + wmGetSingleMatrix(rv3d->persmatob); +} /* ******************** default callbacks for view3d space ***************** */ |