diff options
-rw-r--r-- | intern/elbeem/intern/isosurface.cpp | 30 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 9 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 17 |
4 files changed, 39 insertions, 35 deletions
diff --git a/intern/elbeem/intern/isosurface.cpp b/intern/elbeem/intern/isosurface.cpp index fb61fb416b4..b29c9e20358 100644 --- a/intern/elbeem/intern/isosurface.cpp +++ b/intern/elbeem/intern/isosurface.cpp @@ -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]; diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 774ddca061d..1f10ed25249 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -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); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index b91ed13370d..a87884f6615 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -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++) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 87bf23fd710..912fd56ab3d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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); |