Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 30 Jun 2017 03:46:53 +0000 (13:46 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 30 Jun 2017 03:46:53 +0000 (13:46 +1000)
intern/elbeem/intern/isosurface.cpp
source/blender/blenkernel/intern/object_dupli.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/transform/transform.c

index fb61fb416b48efac20b175d7c73e2f4d4a555c30..b29c9e2035891a6abe33523f89da03cb2c92ee5b 100644 (file)
@@ -937,17 +937,10 @@ void IsoSurface::smoothSurface(float sigma, bool normSmooth)
                                                                                         ew[(j+2)%3]);
                        }
 
-                       // NT important, check this...
-#ifndef WIN32
-                       if(! finite(cornerareas[i][0]) ) cornerareas[i][0]=1e-6;
-                       if(! finite(cornerareas[i][1]) ) cornerareas[i][1]=1e-6;
-                       if(! finite(cornerareas[i][2]) ) cornerareas[i][2]=1e-6;
-#else // WIN32
-                       // FIXME check as well...
-                       if(! (cornerareas[i][0]>=0.0) ) cornerareas[i][0]=1e-6;
-                       if(! (cornerareas[i][1]>=0.0) ) cornerareas[i][1]=1e-6;
-                       if(! (cornerareas[i][2]>=0.0) ) cornerareas[i][2]=1e-6;
-#endif // WIN32
+                       // FIX T50887: ensure pointareas are finite
+                       if (!isfinite(cornerareas[i][0])) cornerareas[i][0] = 1e-6;
+                       if (!isfinite(cornerareas[i][1])) cornerareas[i][1] = 1e-6;
+                       if (!isfinite(cornerareas[i][2])) cornerareas[i][2] = 1e-6;
 
                        pointareas[mIndices[i*3+0]] += cornerareas[i][0];
                        pointareas[mIndices[i*3+1]] += cornerareas[i][1];
@@ -1096,17 +1089,10 @@ void IsoSurface::smoothNormals(float sigma) {
                                                                                         ew[(j+2)%3]);
                        }
 
-                       // NT important, check this...
-#ifndef WIN32
-                       if(! finite(cornerareas[i][0]) ) cornerareas[i][0]=1e-6;
-                       if(! finite(cornerareas[i][1]) ) cornerareas[i][1]=1e-6;
-                       if(! finite(cornerareas[i][2]) ) cornerareas[i][2]=1e-6;
-#else // WIN32
-                       // FIXME check as well...
-                       if(! (cornerareas[i][0]>=0.0) ) cornerareas[i][0]=1e-6;
-                       if(! (cornerareas[i][1]>=0.0) ) cornerareas[i][1]=1e-6;
-                       if(! (cornerareas[i][2]>=0.0) ) cornerareas[i][2]=1e-6;
-#endif // WIN32
+                       // FIX T50887: ensure pointareas are finite
+                       if (!isfinite(cornerareas[i][0])) cornerareas[i][0] = 1e-6;
+                       if (!isfinite(cornerareas[i][1])) cornerareas[i][1] = 1e-6;
+                       if (!isfinite(cornerareas[i][2])) cornerareas[i][2] = 1e-6;
 
                        pointareas[mIndices[i*3+0]] += cornerareas[i][0];
                        pointareas[mIndices[i*3+1]] += cornerareas[i][1];
index 774ddca061dc0c5cb4a7984c7861bb87146a594e..1f10ed252491aa08cf1ca1d01dd20aa317a94f7c 100644 (file)
@@ -545,10 +545,15 @@ static void make_duplis_verts(const DupliContext *ctx)
                BMEditMesh *em = BKE_editmesh_from_object(parent);
                CustomDataMask dm_mask = (use_texcoords ? CD_MASK_BAREMESH | CD_MASK_ORCO : CD_MASK_BAREMESH);
 
-               if (em)
+               if (ctx->eval_ctx->mode == DAG_EVAL_RENDER) {
+                       vdd.dm = mesh_create_derived_render(scene, parent, dm_mask);
+               }
+               else if (em) {
                        vdd.dm = editbmesh_get_derived_cage(scene, parent, em, dm_mask);
-               else
+               }
+               else {
                        vdd.dm = mesh_get_derived_final(scene, parent, dm_mask);
+               }
                vdd.edit_btmesh = me->edit_btmesh;
 
                if (use_texcoords)
@@ -808,10 +813,15 @@ static void make_duplis_faces(const DupliContext *ctx)
                BMEditMesh *em = BKE_editmesh_from_object(parent);
                CustomDataMask dm_mask = (use_texcoords ? CD_MASK_BAREMESH | CD_MASK_ORCO | CD_MASK_MLOOPUV : CD_MASK_BAREMESH);
 
-               if (em)
+               if (ctx->eval_ctx->mode == DAG_EVAL_RENDER) {
+                       fdd.dm = mesh_create_derived_render(scene, parent, dm_mask);
+               }
+               else if (em) {
                        fdd.dm = editbmesh_get_derived_cage(scene, parent, em, dm_mask);
-               else
+               }
+               else {
                        fdd.dm = mesh_get_derived_final(scene, parent, dm_mask);
+               }
 
                if (use_texcoords) {
                        CustomData *ml_data = fdd.dm->getLoopDataLayout(fdd.dm);
index b91ed13370d85845fcd10b60f4e5945a3a18e495..a87884f6615b62f5fe81e28f714f78dba6250b45 100644 (file)
@@ -1044,6 +1044,12 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                PointerRNA pptr, propptr, *ptr = (PointerRNA *)idv;
                PropertyRNA *prop, *iterprop;
                PropertyType proptype;
+
+               /* Don't display arrays larger, weak but index is stored as a short,
+                * also the outliner isn't intended for editing such large data-sets. */
+               BLI_STATIC_ASSERT(sizeof(te->index) == 2, "Index is no longer short!");
+               const int tot_limit = SHRT_MAX;
+
                int a, tot;
 
                /* we do lazy build, for speed and to avoid infinite recusion */
@@ -1065,6 +1071,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
 
                        iterprop = RNA_struct_iterator_property(ptr->type);
                        tot = RNA_property_collection_length(ptr, iterprop);
+                       CLAMP_MAX(tot, tot_limit);
 
                        /* auto open these cases */
                        if (!parent || (RNA_property_type(parent->directdata)) == PROP_POINTER)
@@ -1111,6 +1118,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                        }
                        else if (proptype == PROP_COLLECTION) {
                                tot = RNA_property_collection_length(ptr, prop);
+                               CLAMP_MAX(tot, tot_limit);
 
                                if (TSELEM_OPEN(tselem, soops)) {
                                        for (a = 0; a < tot; a++) {
@@ -1123,6 +1131,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                        }
                        else if (ELEM(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
                                tot = RNA_property_array_length(ptr, prop);
+                               CLAMP_MAX(tot, tot_limit);
 
                                if (TSELEM_OPEN(tselem, soops)) {
                                        for (a = 0; a < tot; a++)
index 87bf23fd710e5858ce032c1256f87f7ecf5d24e3..912fd56ab3df92a31bfd249d5d0584d4fb6482df 100644 (file)
@@ -4099,13 +4099,15 @@ static void initTrackball(TransInfo *t)
 static void applyTrackballValue(TransInfo *t, const float axis1[3], const float axis2[3], float angles[2])
 {
        TransData *td = t->data;
-       float mat[3][3], smat[3][3], totmat[3][3];
+       float mat[3][3];
+       float axis[3];
+       float angle;
        int i;
 
-       axis_angle_normalized_to_mat3(smat, axis1, angles[0]);
-       axis_angle_normalized_to_mat3(totmat, axis2, angles[1]);
-
-       mul_m3_m3m3(mat, smat, totmat);
+       mul_v3_v3fl(axis, axis1, angles[0]);
+       madd_v3_v3fl(axis, axis2, angles[1]);
+       angle = normalize_v3(axis);
+       axis_angle_normalized_to_mat3(mat, axis, angle);
 
        for (i = 0; i < t->total; i++, td++) {
                if (td->flag & TD_NOACTION)
@@ -4115,10 +4117,7 @@ static void applyTrackballValue(TransInfo *t, const float axis1[3], const float
                        continue;
 
                if (t->flag & T_PROP_EDIT) {
-                       axis_angle_normalized_to_mat3(smat, axis1, td->factor * angles[0]);
-                       axis_angle_normalized_to_mat3(totmat, axis2, td->factor * angles[1]);
-
-                       mul_m3_m3m3(mat, smat, totmat);
+                       axis_angle_normalized_to_mat3(mat, axis, td->factor * angle);
                }
 
                ElementRotation(t, td, mat, t->around);