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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-13 14:54:57 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-13 14:54:57 +0400
commit21955ac8aae315f59ef55088cce32234ce60a3ea (patch)
tree8a5d3cdedf7dc80ba377393031b23be5914c3604 /source/gameengine/Ketsji/BL_Action.cpp
parentfa4ef0828e0211fdfdd06b125ed244cba06c1293 (diff)
Fix #35329: action actuator crash with replacemesh, pointers got outdated.
No need to cache this, creating it is quick.
Diffstat (limited to 'source/gameengine/Ketsji/BL_Action.cpp')
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index fa00cafa148..07295d238ef 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -55,7 +55,6 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_pose(NULL),
m_blendpose(NULL),
m_blendinpose(NULL),
- m_ptrrna(NULL),
m_obj(gameobj),
m_startframe(0.f),
m_endframe(0.f),
@@ -71,24 +70,6 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_done(true),
m_calc_localtime(true)
{
- if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE)
- {
- BL_ArmatureObject *obj = (BL_ArmatureObject*)m_obj;
-
- m_ptrrna = new PointerRNA();
- RNA_id_pointer_create(&obj->GetArmatureObject()->id, m_ptrrna);
- }
- else
- {
- BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj;
- BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
-
- if (shape_deformer)
- {
- m_ptrrna = new PointerRNA();
- RNA_id_pointer_create(&shape_deformer->GetKey()->id, m_ptrrna);
- }
- }
}
BL_Action::~BL_Action()
@@ -99,8 +80,6 @@ BL_Action::~BL_Action()
game_free_pose(m_blendpose);
if (m_blendinpose)
game_free_pose(m_blendinpose);
- if (m_ptrrna)
- delete m_ptrrna;
ClearControllerList();
}
@@ -426,7 +405,11 @@ void BL_Action::Update(float curtime)
bPose *temp = arm->pose;
arm->pose = m_pose;
- animsys_evaluate_action(m_ptrrna, m_action, NULL, m_localtime);
+
+ PointerRNA ptrrna;
+ RNA_id_pointer_create(&arm->id, &ptrrna);
+
+ animsys_evaluate_action(&ptrrna, m_action, NULL, m_localtime);
arm->pose = temp;
}
@@ -465,8 +448,10 @@ void BL_Action::Update(float curtime)
{
Key *key = shape_deformer->GetKey();
+ PointerRNA ptrrna;
+ RNA_id_pointer_create(&key->id, &ptrrna);
- animsys_evaluate_action(m_ptrrna, m_action, NULL, m_localtime);
+ animsys_evaluate_action(&ptrrna, m_action, NULL, m_localtime);
// Handle blending between shape actions
if (m_blendin && m_blendframe < m_blendin)