[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54769] trunk/blender/source/gameengine/ Ketsji/BL_Action.cpp: BGE: Second fix for #34330 "Action Actuator "caching" the previous ran actions" reported by Dalai.
Mitchell Stokes
mogurijin at gmail.com
Sat Feb 23 01:46:59 CET 2013
Revision: 54769
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54769
Author: moguri
Date: 2013-02-23 00:46:58 +0000 (Sat, 23 Feb 2013)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/gameengine/Ketsji/BL_Action.cpp
Modified: trunk/blender/source/gameengine/Ketsji/BL_Action.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/BL_Action.cpp 2013-02-23 00:44:39 UTC (rev 54768)
+++ trunk/blender/source/gameengine/Ketsji/BL_Action.cpp 2013-02-23 00:46:58 UTC (rev 54769)
@@ -152,41 +152,38 @@
&& 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;
InitIPO();
@@ -467,4 +464,7 @@
m_obj->UpdateIPO(m_localtime, m_ipo_flags & ACT_IPOFLAG_CHILD);
}
+
+ if (m_done)
+ ClearControllerList();
}
More information about the Bf-blender-cvs
mailing list