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:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-01-22 20:40:47 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2009-01-22 20:40:47 +0300
commit8a95c67a50918a928f45fffd53e084428fcff9d8 (patch)
treee4a008bd67c58b3904362b098949afcff69ab392 /source/gameengine/Converter/BL_ShapeActionActuator.h
parent73cffd9aad43eeb3c1aa029c0e03564739a72800 (diff)
BGE API cleanup: shape action actuator.
Diffstat (limited to 'source/gameengine/Converter/BL_ShapeActionActuator.h')
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h
index 30b2d41fc67..b521c0d98a6 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.h
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.h
@@ -32,6 +32,7 @@
#include "GEN_HashedPtr.h"
#include "SCA_IActuator.h"
+#include "BL_ActionActuator.h"
#include "MT_Point3.h"
#include <vector>
@@ -103,6 +104,45 @@ public:
KX_PYMETHOD_DOC(BL_ShapeActionActuator,SetType);
virtual PyObject* _getattr(const STR_String& attr);
+ virtual int _setattr(const STR_String& attr, PyObject* value);
+
+ static int CheckBlendTime(void *self, const PyAttributeDef*)
+ {
+ BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self);
+
+ if (act->m_blendframe > act->m_blendin)
+ act->m_blendframe = act->m_blendin;
+
+ return 0;
+ }
+ static int CheckFrame(void *self, const PyAttributeDef*)
+ {
+ BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self);
+
+ if (act->m_localtime < act->m_startframe)
+ act->m_localtime = act->m_startframe;
+ else if (act->m_localtime > act->m_endframe)
+ act->m_localtime = act->m_endframe;
+
+ return 0;
+ }
+ static int CheckType(void *self, const PyAttributeDef*)
+ {
+ BL_ShapeActionActuator* act = reinterpret_cast<BL_ShapeActionActuator*>(self);
+
+ switch (act->m_playtype) {
+ case ACT_ACTION_PLAY:
+ case ACT_ACTION_FLIPPER:
+ case ACT_ACTION_LOOP_STOP:
+ case ACT_ACTION_LOOP_END:
+ case ACT_ACTION_FROM_PROP:
+ return 0;
+ default:
+ PyErr_SetString(PyExc_ValueError, "invalid type supplied");
+ return 1;
+ }
+
+ }
protected: