fix remaining crash from [#27035] 3 problems: crash and enum "REGION" not found in...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 09:58:17 +0000 (09:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 09:58:17 +0000 (09:58 +0000)
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c

index fc57bad35b4b073362c69242f56d9d9a16795fd6..8d37b7aeabb807ab9c1f56a4a0bb03a282b142f9 100644 (file)
@@ -5323,7 +5323,7 @@ void createTransData(bContext *C, TransInfo *t)
                        sort_trans_data_dist(t);
                }
 
-               if (t->ar->regiontype == RGN_TYPE_WINDOW)
+               if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW))
                {
                        View3D *v3d = t->view;
                        RegionView3D *rv3d = CTX_wm_region_view3d(C);
index 8c7a39e5dff3ad986b3080a6eb16fd68b4e5a410..67e04bbd34e0a968d7ec83a307043146287911ca 100644 (file)
@@ -1039,9 +1039,14 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else
        {
-               // XXX for now, get View2D  from the active region
-               t->view = &ar->v2d;
-               // XXX for now, the center point is the midpoint of the data
+               if(ar) {
+                       // XXX for now, get View2D  from the active region
+                       t->view = &ar->v2d;
+                       // XXX for now, the center point is the midpoint of the data
+               }
+               else {
+                       t->view= NULL;
+               }
                t->around = V3D_CENTER;
        }