Fix T46332: Can't select an object with OpenSubdiv enabled
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 30 Sep 2015 15:59:19 +0000 (20:59 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 30 Sep 2015 15:59:19 +0000 (20:59 +0500)
The issue was introduced by a wrong fix for T46247. Now both reports should
be properly solved.

source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c

index 39669fd76d784d16248a3ae94f3bb065676c7f15..9d5ef1079b8c035e64bf3aacf9901bd82690f7dd 100644 (file)
@@ -911,6 +911,10 @@ void ccgSubSurf_getMinMax(CCGSubSurf *ss, float r_min[3], float r_max[3])
 {
        int i;
        BLI_assert(ss->skip_grids == true);
+       if (ss->osd_num_coarse_coords == 0) {
+               zero_v3(r_min);
+               zero_v3(r_max);
+       }
        for (i = 0; i < ss->osd_num_coarse_coords; i++) {
                /* Coarse coordinates has normals interleaved into the array. */
                DO_MINMAX(ss->osd_coarse_coords[2 * i], r_min, r_max);