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>2008-06-18 10:46:49 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-06-18 10:46:49 +0400
commit2bece8dcb5104bc95149b0c40723f1dc855d6b29 (patch)
tree6bf9f626e03847e48f4b065d2765e4d0099dde64 /source/blender/blenkernel
parentb4c123c275172eb4f8477ea90c3f68d61565483b (diff)
BGE Patch: Add Shape Action support and update MSCV_7 project file for glew.
Shape Action are now supported in the BGE. A new type of actuator "Shape Action" is available on mesh objects. It can be combined with Action actuator on parent armature. Only relative keys are supported. All the usual action options are available: type, blending, priority, Python API. Only actions with shape channels should be specified of course, otherwise the actuator has no effect. Shape action will still work after a mesh replacement provided that the new mesh has compatible shape keys.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_action.h5
-rw-r--r--source/blender/blenkernel/BKE_key.h11
-rw-r--r--source/blender/blenkernel/intern/action.c7
-rw-r--r--source/blender/blenkernel/intern/key.c2
-rw-r--r--source/blender/blenkernel/intern/sca.c1
5 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index b5e34444d13..716eac81b55 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -44,6 +44,7 @@ struct bActionChannel;
struct bPose;
struct bPoseChannel;
struct Object;
+struct ID;
/* Kernel prototypes */
#ifdef __cplusplus
@@ -157,6 +158,10 @@ void rest_pose(struct bPose *pose);
float get_action_frame(struct Object *ob, float cframe);
/* map strip time to global time (frame nr) */
float get_action_frame_inv(struct Object *ob, float cframe);
+/* builds a list of NlaIpoChannel with ipo values to write in datablock */
+void extract_ipochannels_from_action(ListBase *lb, struct ID *id, struct bAction *act, char *name, float ctime);
+/* write values returned by extract_ipochannels_from_action, returns the number of value written */
+int execute_ipochannels(ListBase *lb);
#ifdef __cplusplus
};
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index a6871aa837f..faf8692b89a 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -40,6 +40,11 @@ struct Object;
struct Lattice;
struct Mesh;
+/* Kernel prototypes */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void free_key(struct Key *sc);
struct Key *add_key(struct ID *id);
struct Key *copy_key(struct Key *key);
@@ -57,6 +62,12 @@ int do_ob_key(struct Object *ob);
struct Key *ob_get_key(struct Object *ob);
struct KeyBlock *ob_get_keyblock(struct Object *ob);
struct KeyBlock *key_get_keyblock(struct Key *key, int index);
+// needed for the GE
+void do_rel_key(int start, int end, int tot, char *basispoin, struct Key *key, int mode);
+
+#ifdef __cplusplus
+};
+#endif
#endif
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 4860c65f06c..05f2e69fce1 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -860,7 +860,7 @@ typedef struct NlaIpoChannel {
int type;
} NlaIpoChannel;
-static void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime)
+void extract_ipochannels_from_action(ListBase *lb, ID *id, bAction *act, char *name, float ctime)
{
bActionChannel *achan= get_action_channel(act, name);
IpoCurve *icu;
@@ -953,15 +953,18 @@ static void blend_ipochannels(ListBase *dst, ListBase *src, float srcweight, int
}
}
-static void execute_ipochannels(ListBase *lb)
+int execute_ipochannels(ListBase *lb)
{
NlaIpoChannel *nic;
+ int count = 0;
for(nic= lb->first; nic; nic= nic->next) {
if(nic->poin) {
write_ipo_poin(nic->poin, nic->type, nic->val);
+ count++;
}
}
+ return count;
}
/* nla timing */
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 3b4e562a87a..dd6c7ddacd2 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -630,7 +630,7 @@ void cp_cu_key(Curve *cu, KeyBlock *kb, int start, int end)
}
-static void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode)
+void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, int mode)
{
KeyBlock *kb;
int *ofsp, ofs[3], elemsize, b;
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index 86e395b3770..92544f19721 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -411,6 +411,7 @@ void init_actuator(bActuator *act)
switch(act->type) {
#ifdef __NLA
case ACT_ACTION:
+ case ACT_SHAPEACTION:
act->data= MEM_callocN(sizeof(bActionActuator), "actionact");
break;
#endif