Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-02-23 04:46:58 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-02-23 04:46:58 +0400
commitbd8f4cc4d6de396c902ee47261baba11bdd8f0a1 (patch)
tree98d9fd5fa5c2d69ff7c76b574c4956eb998f377e /source/gameengine/Ketsji/BL_Action.cpp
parenteab8a25e038a0068ddc3dd78c07268bcb84a6ade (diff)
BGE: Second fix for #34330 "Action Actuator "caching" the previous ran actions" reported by Dalai. Now the multiple layers should also be working. When doing fcurve/IPO animations, the controllers are cleared as soon as the action is done and must be setup again every time the action is played.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index eb5d8844b6c..f55d1120a50 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -152,40 +152,37 @@ bool BL_Action::Play(const char* name,
&& m_priority == priority && m_speed == playback_speed)
return false;
- if (prev_action != m_action)
- {
- // First get rid of any old controllers
- ClearControllerList();
+ // First get rid of any old controllers
+ ClearControllerList();
- // Create an SG_Controller
- SG_Controller *sg_contr = BL_CreateIPO(m_action, m_obj, kxscene->GetSceneConverter());
+ // Create an SG_Controller
+ SG_Controller *sg_contr = BL_CreateIPO(m_action, m_obj, kxscene->GetSceneConverter());
+ m_sg_contr_list.push_back(sg_contr);
+ m_obj->GetSGNode()->AddSGController(sg_contr);
+ sg_contr->SetObject(m_obj->GetSGNode());
+
+ // Try obcolor
+ sg_contr = BL_CreateObColorIPO(m_action, m_obj, kxscene->GetSceneConverter());
+ if (sg_contr) {
m_sg_contr_list.push_back(sg_contr);
m_obj->GetSGNode()->AddSGController(sg_contr);
sg_contr->SetObject(m_obj->GetSGNode());
+ }
- // Try obcolor
- sg_contr = BL_CreateObColorIPO(m_action, m_obj, kxscene->GetSceneConverter());
- if (sg_contr) {
- m_sg_contr_list.push_back(sg_contr);
- m_obj->GetSGNode()->AddSGController(sg_contr);
- sg_contr->SetObject(m_obj->GetSGNode());
- }
-
- // Extra controllers
- if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
- {
- sg_contr = BL_CreateLampIPO(m_action, m_obj, kxscene->GetSceneConverter());
- m_sg_contr_list.push_back(sg_contr);
- m_obj->GetSGNode()->AddSGController(sg_contr);
- sg_contr->SetObject(m_obj->GetSGNode());
- }
- else if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA)
- {
- sg_contr = BL_CreateCameraIPO(m_action, m_obj, kxscene->GetSceneConverter());
- m_sg_contr_list.push_back(sg_contr);
- m_obj->GetSGNode()->AddSGController(sg_contr);
- sg_contr->SetObject(m_obj->GetSGNode());
- }
+ // Extra controllers
+ if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
+ {
+ sg_contr = BL_CreateLampIPO(m_action, m_obj, kxscene->GetSceneConverter());
+ m_sg_contr_list.push_back(sg_contr);
+ m_obj->GetSGNode()->AddSGController(sg_contr);
+ sg_contr->SetObject(m_obj->GetSGNode());
+ }
+ else if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA)
+ {
+ sg_contr = BL_CreateCameraIPO(m_action, m_obj, kxscene->GetSceneConverter());
+ m_sg_contr_list.push_back(sg_contr);
+ m_obj->GetSGNode()->AddSGController(sg_contr);
+ sg_contr->SetObject(m_obj->GetSGNode());
}
m_ipo_flags = ipo_flags;
@@ -467,4 +464,7 @@ void BL_Action::Update(float curtime)
m_obj->UpdateIPO(m_localtime, m_ipo_flags & ACT_IPOFLAG_CHILD);
}
+
+ if (m_done)
+ ClearControllerList();
}