[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40533] trunk/blender/source/gameengine/ Converter/BL_ActionActuator.cpp: BGE Animations: Fixing various Action Actuator compatibility issues reported by Dalai in issue #28723 .
Mitchell Stokes
mogurijin at gmail.com
Sun Sep 25 09:03:21 CEST 2011
Revision: 40533
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40533
Author: moguri
Date: 2011-09-25 07:03:20 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
BGE Animations: Fixing various Action Actuator compatibility issues reported by Dalai in issue #28723.
Modified Paths:
--------------
trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-09-25 05:48:16 UTC (rev 40532)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2011-09-25 07:03:20 UTC (rev 40533)
@@ -226,10 +226,7 @@
break;
}
- // Continue only really makes sense for play stop and flipper. All other modes go until they are complete.
- if (m_flag & ACT_FLAG_CONTINUE &&
- (m_playtype == ACT_ACTION_LOOP_STOP ||
- m_playtype == ACT_ACTION_FLIPPER))
+ if (m_flag & ACT_FLAG_CONTINUE)
bUseContinue = true;
@@ -244,12 +241,6 @@
if (m_flag & ACT_FLAG_ATTEMPT_PLAY)
SetLocalTime(curtime);
- if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
- {
- m_localtime = obj->GetActionFrame(m_layer);
- ResetStartTime(curtime);
- }
-
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
{
@@ -264,22 +255,25 @@
}
// Handle a finished animation
- if ((m_flag & ACT_FLAG_PLAY_END) && obj->IsActionDone(m_layer))
+ if ((m_flag & ACT_FLAG_PLAY_END) && (m_flag & ACT_FLAG_ACTIVE) && obj->IsActionDone(m_layer))
{
m_flag &= ~ACT_FLAG_ACTIVE;
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
- obj->StopAction(m_layer);
return false;
}
// If a different action is playing, we've been overruled and are no longer active
- if (obj->GetCurrentAction(m_layer) != m_action)
+ if (obj->GetCurrentAction(m_layer) != m_action && !obj->IsActionDone(m_layer))
m_flag &= ~ACT_FLAG_ACTIVE;
if (bPositiveEvent || (m_flag & ACT_FLAG_ATTEMPT_PLAY && !(m_flag & ACT_FLAG_ACTIVE)))
{
if (bPositiveEvent)
+ {
+ if (obj->IsActionDone(m_layer))
+ m_localtime = start;
ResetStartTime(curtime);
+ }
if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, m_priority, m_blendin, playtype, m_layer_weight, m_ipo_flags))
{
@@ -307,11 +301,6 @@
return false;
}
-
- m_localtime = obj->GetActionFrame(m_layer);
- if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe))
- m_localtime = m_startframe;
-
switch(m_playtype)
{
case ACT_ACTION_LOOP_STOP:
@@ -340,6 +329,12 @@
break;
}
}
+
+ if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
+ {
+ m_localtime = obj->GetActionFrame(m_layer);
+ ResetStartTime(curtime);
+ }
return true;
}
More information about the Bf-blender-cvs
mailing list