[Bf-blender-cvs] [60c776d] fracture_modifier: limit autohide to faces with inner material and fix attempt for convert to keyframes bug (messed up object locations / rotations)
Martin Felke
noreply at git.blender.org
Sun Nov 16 16:24:12 CET 2014
Commit: 60c776d014aff2e8f0b81558e12b63ffe7c7e81d
Author: Martin Felke
Date: Sun Nov 16 16:23:09 2014 +0100
Branches: fracture_modifier
https://developer.blender.org/rB60c776d014aff2e8f0b81558e12b63ffe7c7e81d
limit autohide to faces with inner material and fix attempt for convert to keyframes bug (messed up object locations / rotations)
===================================================================
M source/blender/editors/object/object_modifier.c
M source/blender/modifiers/intern/MOD_fracture.c
===================================================================
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 66a810d..0e1a79c 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2682,9 +2682,9 @@ void OBJECT_OT_rigidbody_convert_to_objects(wmOperatorType *ot)
static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr, Object* ob, Scene* scene, int start, int end)
{
-// bool is_baked = false;
+ bool is_baked = false;
PointCache* cache = NULL;
-// PTCacheID pid;
+ PTCacheID pid;
MeshIsland *mi = NULL;
int j = 0;
Object *parent = NULL;
@@ -2699,7 +2699,6 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
cache = scene->rigidbody_world->pointcache;
}
-#if 0
if (cache && cache->flag & PTCACHE_BAKED)
{
start = cache->startframe;
@@ -2707,7 +2706,6 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
BKE_ptcache_id_from_rigidbody(&pid, NULL, scene->rigidbody_world);
is_baked = true;
}
-#endif
if (cache && (cache->flag & PTCACHE_OUTDATED) /* && !(cache->flag & PTCACHE_BAKED)*/)
{
@@ -2781,7 +2779,6 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
float size[3] = {1.0f, 1.0f, 1.0f};
//is there a bake, if yes... use that (disabled for now, odd probs...)
-#if 0
if (is_baked)
{
BKE_ptcache_id_time(&pid, scene, (float)i, NULL, NULL, NULL);
@@ -2793,7 +2790,6 @@ static bool convert_modifier_to_keyframes(FractureModifierData* fmd, Group* gr,
}
}
else
-#endif
{
loc[0] = mi->locs[i*3];
loc[1] = mi->locs[i*3+1];
diff --git a/source/blender/modifiers/intern/MOD_fracture.c b/source/blender/modifiers/intern/MOD_fracture.c
index 32b7dac..f4b286b 100644
--- a/source/blender/modifiers/intern/MOD_fracture.c
+++ b/source/blender/modifiers/intern/MOD_fracture.c
@@ -2134,7 +2134,10 @@ static DerivedMesh *do_autoHide(FractureModifierData *fmd, DerivedMesh *dm)
BM_face_calc_center_mean(f2, f_centr_other);
- if (len_squared_v3v3(f_centr, f_centr_other) < fmd->autohide_dist && f1 != f2) {
+ if ((len_squared_v3v3(f_centr, f_centr_other) < fmd->autohide_dist && f1 != f2) &&
+ (f1->mat_nr == 1 && f2->mat_nr == 1))
+ {
+
faces = MEM_reallocN(faces, sizeof(BMFace *) * (del_faces + 2));
faces[del_faces] = f1;
faces[del_faces + 1] = f2;
@@ -2157,7 +2160,7 @@ static DerivedMesh *do_autoHide(FractureModifierData *fmd, DerivedMesh *dm)
}
BMO_op_callf(bm, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
- "automerge_keep_normals verts=%hv dist=%f", BM_ELEM_SELECT, fmd->autohide_dist * 100, false);
+ "automerge_keep_normals verts=%hv dist=%f", BM_ELEM_SELECT, fmd->autohide_dist * 10, false);
BM_mesh_elem_hflag_disable_all(bm, BM_VERT, BM_ELEM_SELECT, false);
More information about the Bf-blender-cvs
mailing list