use const for readonly strings and set some functions to static
[blender.git] / source / gameengine / Converter / BL_ShapeActionActuator.cpp
index 4c9a584d72b8b641949410c27f7d0fc3cb14cef4..ecf9427eddd5573eb9da79e8527d4e1a1f610de1 100644 (file)
@@ -1,6 +1,4 @@
-/**
-* $Id$
-*
+/*
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -15,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  *
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  * Contributor(s): none yet.
  *
  * ***** END GPL LICENSE BLOCK *****
  * Contributor(s): none yet.
  *
  * ***** END GPL LICENSE BLOCK *****
-*/
+ */
+
+/** \file gameengine/Converter/BL_ShapeActionActuator.cpp
+ *  \ingroup bgeconv
+ */
+
 
 
-#if defined (__sgi)
-#include <math.h>
-#else
 #include <cmath>
 #include <cmath>
-#endif
 
 #include "SCA_LogicManager.h"
 #include "BL_ShapeActionActuator.h"
 
 #include "SCA_LogicManager.h"
 #include "BL_ShapeActionActuator.h"
 #include "STR_HashedString.h"
 #include "DNA_nla_types.h"
 #include "DNA_action_types.h"
 #include "STR_HashedString.h"
 #include "DNA_nla_types.h"
 #include "DNA_action_types.h"
+#include "DNA_anim_types.h"
 #include "DNA_scene_types.h"
 #include "BKE_action.h"
 #include "DNA_armature_types.h"
 #include "MEM_guardedalloc.h"
 #include "BLI_blenlib.h"
 #include "DNA_scene_types.h"
 #include "BKE_action.h"
 #include "DNA_armature_types.h"
 #include "MEM_guardedalloc.h"
 #include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
 #include "MT_Matrix4x4.h"
 #include "MT_Matrix4x4.h"
-#include "BKE_utildefines.h"
+
 #include "FloatValue.h"
 #include "PyObjectPlus.h"
 
 #include "FloatValue.h"
 #include "PyObjectPlus.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+extern "C" {
+       #include "BKE_animsys.h"
+       #include "BKE_key.h"
+       #include "RNA_access.h"
+}
+
+BL_ShapeActionActuator::BL_ShapeActionActuator(SCA_IObject* gameobj,
+                                       const STR_String& propname,
+                                       const STR_String& framepropname,
+                                       float starttime,
+                                       float endtime,
+                                       struct bAction *action,
+                                       short   playtype,
+                                       short   blendin,
+                                       short   priority,
+                                       float   stride) 
+       : SCA_IActuator(gameobj, KX_ACT_SHAPEACTION),
+               
+       m_lastpos(0, 0, 0),
+       m_blendframe(0),
+       m_flag(0),
+       m_startframe (starttime),
+       m_endframe(endtime) ,
+       m_starttime(0),
+       m_localtime(starttime),
+       m_lastUpdate(-1),
+       m_blendin(blendin),
+       m_blendstart(0),
+       m_stridelength(stride),
+       m_playtype(playtype),
+       m_priority(priority),
+       m_action(action),
+       m_framepropname(framepropname), 
+       m_propname(propname)
+{
+       m_idptr = new PointerRNA();
+       BL_DeformableGameObject *obj = (BL_DeformableGameObject*)GetParent();
+       BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
+       RNA_id_pointer_create(&shape_deformer->GetKey()->id, m_idptr);
+};
 
 BL_ShapeActionActuator::~BL_ShapeActionActuator()
 {
 
 BL_ShapeActionActuator::~BL_ShapeActionActuator()
 {
+       if (m_idptr)
+               delete m_idptr;
 }
 
 void BL_ShapeActionActuator::ProcessReplica()
 }
 
 void BL_ShapeActionActuator::ProcessReplica()
@@ -225,6 +264,16 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
                        apply=false;
                }
                break;
                        apply=false;
                }
                break;
+       case ACT_ACTION_PINGPONG:
+               if (bPositiveEvent){
+                       if (!(m_flag & ACT_FLAG_LOCKINPUT)){
+                               m_flag &= ~ACT_FLAG_KEYUP;
+                               m_localtime = m_starttime;
+                               m_starttime = curtime;
+                               m_flag |= ACT_FLAG_LOCKINPUT;
+                       }
+               }
+               break;
        case ACT_ACTION_FLIPPER:
                if (bPositiveEvent){
                        if (!(m_flag & ACT_FLAG_LOCKINPUT)){
        case ACT_ACTION_FLIPPER:
                if (bPositiveEvent){
                        if (!(m_flag & ACT_FLAG_LOCKINPUT)){
@@ -299,6 +348,18 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
                break;
        case ACT_ACTION_LOOP_STOP:
                break;
                break;
        case ACT_ACTION_LOOP_STOP:
                break;
+       case ACT_ACTION_PINGPONG:
+               if (wrap){
+                       if (!(m_flag & ACT_FLAG_REVERSE))
+                               m_localtime = m_endframe;
+                       else 
+                               m_localtime = m_startframe;
+
+                       m_flag &= ~ACT_FLAG_LOCKINPUT;
+                       m_flag ^= ACT_FLAG_REVERSE; //flip direction
+                       keepgoing = false;
+               }
+               break;
        case ACT_ACTION_FLIPPER:
                if (wrap){
                        if (!(m_flag & ACT_FLAG_REVERSE)){
        case ACT_ACTION_FLIPPER:
                if (wrap){
                        if (!(m_flag & ACT_FLAG_REVERSE)){
@@ -354,7 +415,11 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
 
                /* Priority test */
                if (obj->SetActiveAction(this, priority, curtime)){
 
                /* Priority test */
                if (obj->SetActiveAction(this, priority, curtime)){
-                       Key *key = obj->GetKey();
+                       BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
+                       Key *key = NULL;
+
+                       if (shape_deformer)
+                               key = shape_deformer->GetKey();
 
                        if (!key) {
                                // this could happen if the mesh was changed in the middle of an action
 
                        if (!key) {
                                // this could happen if the mesh was changed in the middle of an action
@@ -369,9 +434,16 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
                                        obj->GetShape(m_blendshape);
                                        m_blendstart = curtime;
                                }
                                        obj->GetShape(m_blendshape);
                                        m_blendstart = curtime;
                                }
-                               // only interested in shape channel
-                               // XXX extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime);
-               
+
+                               KeyBlock *kb;
+                               // We go through and clear out the keyblocks so there isn't any interference
+                               // from other shape actions
+                               for (kb=(KeyBlock*)key->block.first; kb; kb=(KeyBlock*)kb->next)
+                                       kb->curval = 0.f;
+
+                               animsys_evaluate_action(m_idptr, m_action, NULL, m_localtime);
+
+                               // XXX - in 2.5 theres no way to do this. possibly not that important to support - Campbell
                                if (0) { // XXX !execute_ipochannels(&tchanbase)) {
                                        // no update, this is possible if action does not match the keys, stop the action
                                        keepgoing = false;
                                if (0) { // XXX !execute_ipochannels(&tchanbase)) {
                                        // no update, this is possible if action does not match the keys, stop the action
                                        keepgoing = false;
@@ -404,6 +476,8 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
        return keepgoing;
 };
 
        return keepgoing;
 };
 
+#ifdef WITH_PYTHON
+
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
 /* ------------------------------------------------------------------------- */
@@ -411,56 +485,29 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
 /* Integration hooks ------------------------------------------------------- */
 
 PyTypeObject BL_ShapeActionActuator::Type = {
 /* Integration hooks ------------------------------------------------------- */
 
 PyTypeObject BL_ShapeActionActuator::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
        PyVarObject_HEAD_INIT(NULL, 0)
        PyVarObject_HEAD_INIT(NULL, 0)
-#else
-       /* python 2.5 and below */
-       PyObject_HEAD_INIT( NULL )  /* required py macro */
-       0,                          /* ob_size */
-#endif
-               "BL_ShapeActionActuator",
-               sizeof(PyObjectPlus_Proxy),
-               0,
-               py_base_dealloc,
-               0,
-               0,
-               0,
-               0,
-               py_base_repr,
-               0,0,0,0,0,0,
-               NULL, //py_base_getattro,
-               NULL, //py_base_setattro,
-               0,
-               Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-               0,0,0,0,0,0,0,
-               Methods,
-               0,
-               0,
-               &SCA_IActuator::Type
+       "BL_ShapeActionActuator",
+       sizeof(PyObjectPlus_Proxy),
+       0,
+       py_base_dealloc,
+       0,
+       0,
+       0,
+       0,
+       py_base_repr,
+       0,0,0,0,0,0,0,0,0,
+       Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+       0,0,0,0,0,0,0,
+       Methods,
+       0,
+       0,
+       &SCA_IActuator::Type,
+       0,0,0,0,0,0,
+       py_base_new
 };
 
 
 PyMethodDef BL_ShapeActionActuator::Methods[] = {
 };
 
 
 PyMethodDef BL_ShapeActionActuator::Methods[] = {
-       {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc},
-       {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc},
-       {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc},
-       {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc},
-       {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc},
-       {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc},
-       {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
-       {"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc},
-       {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc},
-
-       {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (PY_METHODCHAR)GetAction_doc},
-       {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc},
-       {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (PY_METHODCHAR)GetEnd_doc},
-       {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (PY_METHODCHAR)GetBlendin_doc},
-       {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (PY_METHODCHAR)GetPriority_doc},
-       {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (PY_METHODCHAR)GetFrame_doc},
-       {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (PY_METHODCHAR)GetFrameProperty_doc},
-       {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (PY_METHODCHAR)GetType_doc}, 
-       {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (PY_METHODCHAR)SetType_doc},
        {NULL,NULL} //Sentinel
 };
 
        {NULL,NULL} //Sentinel
 };
 
@@ -478,370 +525,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
        { NULL }        //Sentinel
 };
 
-/*     setStart                                                              */
-const char BL_ShapeActionActuator::GetAction_doc[] = 
-"getAction()\n"
-"\tReturns a string containing the name of the current action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetAction() {
-       ShowDeprecationWarning("getAction()", "the action property");
-       if (m_action){
-               return PyUnicode_FromString(m_action->id.name+2);
-       }
-       Py_RETURN_NONE;
-}
-
-/*     getProperty                                                             */
-const char BL_ShapeActionActuator::GetProperty_doc[] = 
-"getProperty()\n"
-"\tReturns the name of the property to be used in FromProp mode.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetProperty() {
-       ShowDeprecationWarning("getProperty()", "the property property");
-       PyObject *result;
-       
-       result = Py_BuildValue("s", (const char *)m_propname);
-       
-       return result;
-}
-
-/*     getFrame                                                              */
-const char BL_ShapeActionActuator::GetFrame_doc[] = 
-"getFrame()\n"
-"\tReturns the current frame number.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetFrame() {
-       ShowDeprecationWarning("getFrame()", "the frame property");
-       PyObject *result;
-       
-       result = Py_BuildValue("f", m_localtime);
-       
-       return result;
-}
-
-/*     getEnd                                                                */
-const char BL_ShapeActionActuator::GetEnd_doc[] = 
-"getEnd()\n"
-"\tReturns the last frame of the action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetEnd() {
-       ShowDeprecationWarning("getEnd()", "the end property");
-       PyObject *result;
-       
-       result = Py_BuildValue("f", m_endframe);
-       
-       return result;
-}
-
-/*     getStart                                                              */
-const char BL_ShapeActionActuator::GetStart_doc[] = 
-"getStart()\n"
-"\tReturns the starting frame of the action.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetStart() {
-       ShowDeprecationWarning("getStart()", "the start property");
-       PyObject *result;
-       
-       result = Py_BuildValue("f", m_startframe);
-       
-       return result;
-}
-
-/*     getBlendin                                                            */
-const char BL_ShapeActionActuator::GetBlendin_doc[] = 
-"getBlendin()\n"
-"\tReturns the number of interpolation animation frames to be\n"
-"\tgenerated when this actuator is triggered.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetBlendin() {
-       ShowDeprecationWarning("getBlendin()", "the blendin property");
-       PyObject *result;
-       
-       result = Py_BuildValue("f", m_blendin);
-       
-       return result;
-}
-
-/*     getPriority                                                           */
-const char BL_ShapeActionActuator::GetPriority_doc[] = 
-"getPriority()\n"
-"\tReturns the priority for this actuator.  Actuators with lower\n"
-"\tPriority numbers will override actuators with higher numbers.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetPriority() {
-       ShowDeprecationWarning("getPriority()", "the priority property");
-       PyObject *result;
-       
-       result = Py_BuildValue("i", m_priority);
-       
-       return result;
-}
-
-/*     setAction                                                             */
-const char BL_ShapeActionActuator::SetAction_doc[] = 
-"setAction(action, (reset))\n"
-"\t - action    : The name of the action to set as the current action.\n"
-"\t               Should be an action with Shape channels.\n"
-"\t - reset     : Optional parameter indicating whether to reset the\n"
-"\t               blend timer or not.  A value of 1 indicates that the\n"
-"\t               timer should be reset.  A value of 0 will leave it\n"
-"\t               unchanged.  If reset is not specified, the timer will"
-"\t                  be reset.\n";
-
-PyObject* BL_ShapeActionActuator::PySetAction(PyObject* args) {
-       ShowDeprecationWarning("setAction()", "the action property");
-       char *string;
-       int     reset = 1;
-
-       if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset))
-       {
-               bAction *action;
-               
-               action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string));
-               
-               if (!action){
-                       /* NOTE!  Throw an exception or something */
-                       //                      printf ("setAction failed: Action not found\n", string);
-               }
-               else{
-                       m_action=action;
-                       if (reset)
-                               m_blendframe = 0.f;
-               }
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setStart                                                              */
-const char BL_ShapeActionActuator::SetStart_doc[] = 
-"setStart(start)\n"
-"\t - start     : Specifies the starting frame of the animation.\n";
-
-PyObject* BL_ShapeActionActuator::PySetStart(PyObject* args) {
-       ShowDeprecationWarning("setStart()", "the start property");
-       float start;
-       
-       if (PyArg_ParseTuple(args,"f:setStart",&start))
-       {
-               m_startframe = start;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setEnd                                                                */
-const char BL_ShapeActionActuator::SetEnd_doc[] = 
-"setEnd(end)\n"
-"\t - end       : Specifies the ending frame of the animation.\n";
-
-PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* args) {
-       ShowDeprecationWarning("setEnd()", "the end property");
-       float end;
-       
-       if (PyArg_ParseTuple(args,"f:setEnd",&end))
-       {
-               m_endframe = end;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setBlendin                                                            */
-const char BL_ShapeActionActuator::SetBlendin_doc[] = 
-"setBlendin(blendin)\n"
-"\t - blendin   : Specifies the number of frames of animation to generate\n"
-"\t               when making transitions between actions.\n";
-
-PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* args) {
-       ShowDeprecationWarning("setBlendin()", "the blendin property");
-       float blendin;
-       
-       if (PyArg_ParseTuple(args,"f:setBlendin",&blendin))
-       {
-               m_blendin = blendin;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setBlendtime                                                          */
-const char BL_ShapeActionActuator::SetBlendtime_doc[] = 
-"setBlendtime(blendtime)\n"
-"\t - blendtime : Allows the script to directly modify the internal timer\n"
-"\t               used when generating transitions between actions.  This\n"
-"\t               parameter must be in the range from 0.0 to 1.0.\n";
-
-PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* args) {
-       ShowDeprecationWarning("setBlendtime()", "the blendTime property");
-       float blendframe;
-       
-       if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe))
-       {
-               m_blendframe = blendframe * m_blendin;
-               if (m_blendframe<0.f)
-                       m_blendframe = 0.f;
-               if (m_blendframe>m_blendin)
-                       m_blendframe = m_blendin;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setPriority                                                           */
-const char BL_ShapeActionActuator::SetPriority_doc[] = 
-"setPriority(priority)\n"
-"\t - priority  : Specifies the new priority.  Actuators will lower\n"
-"\t               priority numbers will override actuators with higher\n"
-"\t               numbers.\n";
-
-PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* args) {
-       ShowDeprecationWarning("setPriority()", "the priority property");
-       int priority;
-       
-       if (PyArg_ParseTuple(args,"i:setPriority",&priority))
-       {
-               m_priority = priority;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     getProperty                                                             */
-const char BL_ShapeActionActuator::GetFrameProperty_doc[] = 
-"getFrameProperty()\n"
-"\tReturns the name of the property, that is set to the current frame number.\n";
-
-PyObject* BL_ShapeActionActuator::PyGetFrameProperty() {
-       ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
-       PyObject *result;
-       
-       result = Py_BuildValue("s", (const char *)m_framepropname);
-       
-       return result;
-}
-
-
-/*     setFrame                                                              */
-const char BL_ShapeActionActuator::SetFrame_doc[] = 
-"setFrame(frame)\n"
-"\t - frame     : Specifies the new current frame for the animation\n";
-
-PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* args) {
-       ShowDeprecationWarning("setFrame()", "the frame property");
-       float frame;
-       
-       if (PyArg_ParseTuple(args,"f:setFrame",&frame))
-       {
-               m_localtime = frame;
-               if (m_localtime<m_startframe)
-                       m_localtime=m_startframe;
-               else if (m_localtime>m_endframe)
-                       m_localtime=m_endframe;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setProperty                                                           */
-const char BL_ShapeActionActuator::SetProperty_doc[] = 
-"setProperty(prop)\n"
-"\t - prop      : A string specifying the property name to be used in\n"
-"\t               FromProp playback mode.\n";
-
-PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* args) {
-       ShowDeprecationWarning("setProperty()", "the property property");
-       char *string;
-       
-       if (PyArg_ParseTuple(args,"s:setProperty",&string))
-       {
-               m_propname = string;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/*     setFrameProperty                                                          */
-const char BL_ShapeActionActuator::SetFrameProperty_doc[] = 
-"setFrameProperty(prop)\n"
-"\t - prop      : A string specifying the property of the frame set up update.\n";
-
-PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* args) {
-       ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
-       char *string;
-       
-       if (PyArg_ParseTuple(args,"s:setFrameProperty",&string))
-       {
-               m_framepropname = string;
-       }
-       else {
-               return NULL;
-       }
-       
-       Py_RETURN_NONE;
-}
-
-/* getType */
-const char BL_ShapeActionActuator::GetType_doc[] =
-"getType()\n"
-"\tReturns the operation mode of the actuator.\n";
-PyObject* BL_ShapeActionActuator::PyGetType() {
-       ShowDeprecationWarning("getType()", "the type property");
-    return Py_BuildValue("h", m_playtype);
-}
-
-/* setType */
-const char BL_ShapeActionActuator::SetType_doc[] =
-"setType(mode)\n"
-"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
-"\tSet the operation mode of the actuator.\n";
-PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) {
-       ShowDeprecationWarning("setType()", "the type property");
-       short typeArg;
-                                                                                                             
-    if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) {
-        return NULL;
-    }
-
-       switch (typeArg) {
-       case ACT_ACTION_PLAY:
-       case ACT_ACTION_FLIPPER:
-       case ACT_ACTION_LOOP_STOP:
-       case ACT_ACTION_LOOP_END:
-       case ACT_ACTION_FROM_PROP:
-               m_playtype = typeArg;
-               break;
-       default:
-               printf("Invalid type for action actuator: %d\n", typeArg); /* error */
-    }
-       
-    Py_RETURN_NONE;
-}
-
 PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
 PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
@@ -875,3 +558,5 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE
        return PY_SET_ATTR_SUCCESS;
 
 }
        return PY_SET_ATTR_SUCCESS;
 
 }
+
+#endif // WITH_PYTHON