From 3afe0e9c8803bd04daa7a8e0ae813796b455a4b4 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Wed, 29 Jun 2011 02:42:46 +0000 Subject: BGE Animations: Beginning work on layer blending. Blending armature actions works, but needs more testing. Also, currently the mode is forced to ADD and the weight to 1. --- source/gameengine/Ketsji/BL_Action.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Ketsji/BL_Action.cpp') diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index 149189b6a79..33e4e179071 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -46,6 +46,7 @@ extern "C" { #include "BKE_action.h" #include "RNA_access.h" #include "RNA_define.h" +#include "DNA_nla_types.h" } BL_Action::BL_Action(class KX_GameObject* gameobj) @@ -172,6 +173,7 @@ bool BL_Action::Play(const char* name, m_endframe = end; m_blendin = blendin; m_playmode = play_mode; + m_blendmode = blend_mode; m_endtime = 0.f; m_blendframe = 0.f; m_blendstart = 0.f; @@ -328,12 +330,17 @@ void BL_Action::Update(float curtime) float weight = 1.f - (m_blendframe/m_blendin); // Blend the poses - game_blend_poses(m_pose, m_blendpose, weight); + game_blend_poses(m_pose, m_blendpose, weight, ACTSTRIPMODE_BLEND); } // Handle layer blending - + if (m_blendmode != ACT_BLEND_NONE) + { + obj->GetMRDPose(&m_blendpose); + game_blend_poses(m_pose, m_blendpose, 1.f, ACTSTRIPMODE_ADD); + } + obj->SetPose(m_pose); obj->SetActiveAction(NULL, 0, curtime); -- cgit v1.2.3