[Bf-blender-cvs] [463f165dbfb] fracture_modifier: hopefully proper rotation fix for animated mesh bind

Martin Felke noreply at git.blender.org
Thu Jan 10 19:28:09 CET 2019


Commit: 463f165dbfb6fa274204801af36209cde1596b2b
Author: Martin Felke
Date:   Wed Jan 9 20:16:51 2019 +0100
Branches: fracture_modifier
https://developer.blender.org/rB463f165dbfb6fa274204801af36209cde1596b2b

hopefully proper rotation fix for animated mesh bind

===================================================================

M	source/blender/blenkernel/intern/fracture.c

===================================================================

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index aa708bc1048..c32fb2c638b 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -3966,7 +3966,7 @@ void BKE_read_animated_loc_rot(FractureModifierData *fmd, Object *ob, bool do_bi
 	DerivedMesh *dm = NULL;
 	int totvert, count = 0, i = 0, *orig_index = NULL, totpoly, items;
 	KDTree *tree = NULL;
-	float anim_quat[4], anim_imat[4][4], imat[4][4];
+	float anim_imat[4][4], imat[4][4];
 
 	if (!fmd->anim_mesh_ob)
 		return;
@@ -4227,9 +4227,11 @@ void BKE_read_animated_loc_rot(FractureModifierData *fmd, Object *ob, bool do_bi
 
 				if (fmd->anim_mesh_rot)
 				{
-					float ob_quat[4];
+					float ob_quat[4], anim_quat[4];
 					mat4_to_quat(ob_quat, ob->obmat);
+					mat4_to_quat(anim_quat, fmd->anim_mesh_ob->obmat);
 					mul_qt_qtqt(quat, ob_quat, quat);
+					mul_qt_qtqt(quat, anim_quat, quat);
 					copy_qt_qt(mi->rigidbody->orn, quat);
 				}



More information about the Bf-blender-cvs mailing list