Fix T58125: UV Editor transform fails
authorCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2018 03:39:50 +0000 (14:39 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2018 03:45:48 +0000 (14:45 +1100)
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_gizmo_2d.c
source/blender/editors/transform/transform_snap.c

index ff3d52d7ddbb0489819aa0c5a7489c3e51bde917..c66cda57c57d0be2d58175319d8d6667f65cafb8 100644 (file)
@@ -1213,9 +1213,12 @@ void initTransDataContainers_FromObjectData(TransInfo *t, Object *obact, Object
                bool free_objects = false;
                if (objects == NULL) {
                        objects = BKE_view_layer_array_from_objects_in_mode(
-                               t->view_layer, t->view, &objects_len, {
+                               t->view_layer,
+                               (t->spacetype == SPACE_VIEW3D) ? t->view : NULL,
+                               &objects_len, {
                                    .object_mode = object_mode,
-                                   .no_dup_data = true});
+                                   .no_dup_data = true,
+                               });
                        free_objects = true;
                }
 
index 6a6764e7a0b0e0a44d89584c82fa806e97facdb9..7d0584e357195bfdd2b2671db48874f622ac27fe 100644 (file)
@@ -165,11 +165,10 @@ static void gizmo2d_calc_bounds(const bContext *C, float *r_center, float *r_min
        if (sa->spacetype == SPACE_IMAGE) {
                SpaceImage *sima = sa->spacedata.first;
                ViewLayer *view_layer = CTX_data_view_layer(C);
-               View3D *v3d = CTX_wm_view3d(C);
                Image *ima = ED_space_image(sima);
                uint objects_len = 0;
                Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
-                       view_layer, v3d, &objects_len);
+                       view_layer, NULL, &objects_len);
                if (!ED_uvedit_minmax_multi(CTX_data_scene(C), ima, objects, objects_len, r_min, r_max)) {
                        zero_v2(r_min);
                        zero_v2(r_max);
index c2aacafa589a0b38886345d8ddfa99a03accedb8..eb8bdb26450f914e07af13adec6a97b796b72d4b 100644 (file)
@@ -994,7 +994,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec))
 
                        uint objects_len = 0;
                        Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
-                                              t->view_layer, t->view, &objects_len);
+                               t->view_layer, NULL, &objects_len);
 
                        float dist_sq = FLT_MAX;
                        if (ED_uvedit_nearest_uv_multi(t->scene, ima, objects, objects_len, co, &dist_sq, t->tsnap.snapPoint)) {