[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16562] trunk/blender/source/gameengine: Fix for bug #5413: game engine armature actions and shapes keys

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Sep 16 23:11:38 CEST 2008


Revision: 16562
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16562
Author:   blendix
Date:     2008-09-16 23:11:38 +0200 (Tue, 16 Sep 2008)

Log Message:
-----------
Fix for bug #5413: game engine armature actions and shapes keys
didn't work correct with scene suspend/resume, now works the same
as IPO's.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
    trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
    trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp

Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp	2008-09-16 21:09:24 UTC (rev 16561)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp	2008-09-16 21:11:38 UTC (rev 16562)
@@ -152,6 +152,8 @@
 	bool apply=true;
 	int	priority;
 	float newweight;
+
+	curtime -= KX_KetsjiEngine::GetSuspendedDelta();
 	
 	// result = true if animation has to be continued, false if animation stops
 	// maybe there are events for us in the queue !

Modified: trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp	2008-09-16 21:09:24 UTC (rev 16561)
+++ trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp	2008-09-16 21:11:38 UTC (rev 16562)
@@ -155,6 +155,8 @@
 	bool apply=true;
 	int	priority;
 	float newweight;
+
+	curtime -= KX_KetsjiEngine::GetSuspendedDelta();
 	
 	// result = true if animation has to be continued, false if animation stops
 	// maybe there are events for us in the queue !

Modified: trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp	2008-09-16 21:09:24 UTC (rev 16561)
+++ trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp	2008-09-16 21:11:38 UTC (rev 16562)
@@ -130,7 +130,6 @@
 {
 	float direction = m_startframe < m_endframe ? 1.0f : -1.0f;
 
-	curtime = curtime - KX_KetsjiEngine::GetSuspendedDelta();	
 	if (m_direction > 0)
 		m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_KetsjiEngine::GetAnimFrameRate();
 	else
@@ -139,7 +138,7 @@
 
 void KX_IpoActuator::SetLocalTime(float curtime)
 {
-	float delta_time = ((curtime - m_starttime) - KX_KetsjiEngine::GetSuspendedDelta())*KX_KetsjiEngine::GetAnimFrameRate();
+	float delta_time = (curtime - m_starttime)*KX_KetsjiEngine::GetAnimFrameRate();
 	
 	// negative delta_time is caused by floating point inaccuracy
 	// perhaps the inaccuracy could be reduced a bit
@@ -165,6 +164,8 @@
 	int numevents = 0;
 	bool bIpoStart = false;
 
+	curtime -= KX_KetsjiEngine::GetSuspendedDelta();
+
 	if (frame)
 	{
 		numevents = m_events.size();
@@ -180,7 +181,7 @@
 		if (m_starttime < -2.0f*start_smaller_then_end*(m_endframe - m_startframe))
 		{
 			// start for all Ipo, initial start for LOOP_STOP
-			m_starttime = curtime - KX_KetsjiEngine::GetSuspendedDelta();
+			m_starttime = curtime;
 			m_bIpoPlaying = true;
 			bIpoStart = true;
 		}





More information about the Bf-blender-cvs mailing list