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
path: root/source
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2011-06-16 05:57:39 +0400
committerMitchell Stokes <mogurijin@gmail.com>2011-06-16 05:57:39 +0400
commit47b061609d7a29116cdac9ba375408b5217683bd (patch)
treeb1e272f63e71bfd4f051209694b8ddbd6b4759dc /source
parentc02006bc2b8566ae96af1e9e9630f0ecd5a1d05e (diff)
BGE Animations: FCurve Actuators are now converted to Action Actuators in do_versions(). Note: The fcurve actuator still needs to be removed from menus and such.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c36
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h1
2 files changed, 36 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1e604c45772..7c9dfc48fb0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11662,8 +11662,42 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+
+ {
+ /* convert fcurve actuator to action actuator */
+ Object *ob;
+ bActuator *act;
+ bIpoActuator *ia;
+ bActionActuator *aa;
+
+ for (ob= main->object.first; ob; ob= ob->id.next) {
+ for (act= ob->actuators.first; act; act= act->next) {
+ if (act->type == ACT_IPO) {
+ // Create the new actuator
+ ia= act->data;
+ aa= MEM_callocN(sizeof(bActionActuator), "fcurve -> action actuator do_version");
+
+ // Copy values
+ aa->type = ia->type;
+ aa->flag = ia->flag;
+ aa->sta = ia->sta;
+ aa->end = ia->end;
+ strcpy(aa->name, ia->name);
+ strcpy(aa->frameProp, ia->frameProp);
+ aa->act = ob->adt->action;
+
+ // Get rid of the old actuator
+ MEM_freeN(ia);
+
+ // Assign the new actuator
+ act->data = aa;
+ act->type= act->otype= ACT_ACTION;
+
+ }
+ }
+ }
+ }
}
-
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index b368aadf4c2..071f66cddd6 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -122,6 +122,7 @@ typedef struct bObjectActuator {
struct Object *reference;
} bObjectActuator;
+/* deprecated, handled by bActionActuator now */
typedef struct bIpoActuator {
short flag, type;
float sta, end;