diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-02-28 00:27:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-02-28 00:27:03 +0300 |
commit | 71cedc8c1b6fcb4ef1fd28eb9a76abbb230e61c4 (patch) | |
tree | fb94cea8134218e2a381c41a0b52b5791c73ed3f /source/blender/editors/mesh/editmesh_add.c | |
parent | b992a449f1cf00321e103cace9a3247ae3592222 (diff) |
Running the OBJECT_OT_mesh_add operator outside the 3d view would crash.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 15b64a25321..aa4c132bf3a 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1267,13 +1267,13 @@ static float new_primitive_matrix(bContext *C, float primmat[][4]) Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); View3D *v3d =CTX_wm_view3d(C); - ARegion *ar= CTX_wm_region(C); + RegionView3D *rv3d= CTX_wm_region_view3d(C); float *curs, mat[3][3], vmat[3][3], cmat[3][3], imat[3][3]; Mat4One(primmat); - if(ar) - Mat3CpyMat4(vmat, ((RegionView3D *)ar->regiondata)->viewmat); + if(rv3d) + Mat3CpyMat4(vmat, rv3d->viewmat); else Mat3One(vmat); |