[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15112] branches/blender-2.47/source: branches/blender-2.47

Diego Borghetti bdiego at gmail.com
Wed Jun 4 02:35:19 CEST 2008


Revision: 15112
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15112
Author:   bdiego
Date:     2008-06-04 02:35:10 +0200 (Wed, 04 Jun 2008)

Log Message:
-----------
branches/blender-2.47

Merge from trunk:
	Revision: 15096
	Revision: 15110

Modified Paths:
--------------
    branches/blender-2.47/source/blender/src/editaction.c
    branches/blender-2.47/source/gameengine/Converter/BL_ArmatureObject.cpp

Modified: branches/blender-2.47/source/blender/src/editaction.c
===================================================================
--- branches/blender-2.47/source/blender/src/editaction.c	2008-06-03 23:40:56 UTC (rev 15111)
+++ branches/blender-2.47/source/blender/src/editaction.c	2008-06-04 00:35:10 UTC (rev 15112)
@@ -1485,7 +1485,7 @@
 	data= get_action_context(&datatype);
 	if (data == NULL) return;
 	cfra = frame_to_float(CFRA);
-		
+	
 	if (datatype == ACTCONT_ACTION) {
 		ListBase act_data = {NULL, NULL};
 		bActListElem *ale;
@@ -1941,6 +1941,7 @@
 	int filter;
 	void *data;
 	short datatype;
+	Object *ob= OBACT;
 	
 	short no_name= 0;
 	float offset = CFRA - actcopy_firstframe;
@@ -2017,7 +2018,7 @@
 		
 		/* loop over curves, pasting keyframes */
 		for (ico= ipo_src->curve.first; ico; ico= ico->next) {
-			icu= verify_ipocurve((ID*)OBACT, ico->blocktype, actname, conname, "", ico->adrcode);
+			icu= verify_ipocurve((ID*)ob, ico->blocktype, actname, conname, "", ico->adrcode);
 			
 			if (icu) {
 				/* just start pasting, with the the first keyframe on the current frame, and so on */
@@ -2045,6 +2046,14 @@
 	/* free temp memory */
 	BLI_freelistN(&act_data);
 	
+	/* do depsgraph updates (for 3d-view)? */
+	if ((ob) && (G.saction->pin==0)) {
+		if (ob->type == OB_ARMATURE)
+			DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
+		else
+			DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
+	}
+	
 	/* undo and redraw stuff */
 	allqueue(REDRAWVIEW3D, 0);
 	allspace(REMAKEIPO, 0);

Modified: branches/blender-2.47/source/gameengine/Converter/BL_ArmatureObject.cpp
===================================================================
--- branches/blender-2.47/source/gameengine/Converter/BL_ArmatureObject.cpp	2008-06-03 23:40:56 UTC (rev 15111)
+++ branches/blender-2.47/source/gameengine/Converter/BL_ArmatureObject.cpp	2008-06-04 00:35:10 UTC (rev 15112)
@@ -153,9 +153,12 @@
 		int copy_constraint_channels_hack = 1;
 		copy_pose(pose, m_pose, copy_constraint_channels_hack);
 	}
-	else
+	else {
+		if (*pose == m_pose)
+			// no need to copy if the pointers are the same
+			return;
 		extract_pose_from_pose(*pose, m_pose);
-
+	}
 }
 
 void BL_ArmatureObject::GetMRDPose(bPose **pose)
@@ -169,7 +172,11 @@
 	//}
 
 	if (!*pose)
-		copy_pose(pose, m_objArma->pose, 0);
+		// must duplicate the constraints too otherwise we have corruption in free_pose_channels()
+		// because it will free the blender constraints. 
+		// Ideally, blender should rememeber that the constraints were not copied so that
+		// free_pose_channels() would not free them.
+		copy_pose(pose, m_objArma->pose, 1);
 	else
 		extract_pose_from_pose(*pose, m_objArma->pose);
 





More information about the Bf-blender-cvs mailing list