[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37534] branches/soc-2011-pepper/source/ blender: BGE Animations: FCurve Actuators are now converted to Action Actuators in do_versions().

Mitchell Stokes mogurijin at gmail.com
Thu Jun 16 03:57:45 CEST 2011


Revision: 37534
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37534
Author:   moguri
Date:     2011-06-16 01:57:39 +0000 (Thu, 16 Jun 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-pepper/source/blender/makesdna/DNA_actuator_types.h

Modified: branches/soc-2011-pepper/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2011-pepper/source/blender/blenloader/intern/readfile.c	2011-06-16 01:18:52 UTC (rev 37533)
+++ branches/soc-2011-pepper/source/blender/blenloader/intern/readfile.c	2011-06-16 01:57:39 UTC (rev 37534)
@@ -11662,8 +11662,42 @@
 				}
 			}
 		}
+		
+		{
+			/* 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! */
 

Modified: branches/soc-2011-pepper/source/blender/makesdna/DNA_actuator_types.h
===================================================================
--- branches/soc-2011-pepper/source/blender/makesdna/DNA_actuator_types.h	2011-06-16 01:18:52 UTC (rev 37533)
+++ branches/soc-2011-pepper/source/blender/makesdna/DNA_actuator_types.h	2011-06-16 01:57:39 UTC (rev 37534)
@@ -122,6 +122,7 @@
 	struct Object *reference;
 } bObjectActuator;
 
+/* deprecated, handled by bActionActuator now */
 typedef struct bIpoActuator {
 	short flag, type;
 	float sta, end;




More information about the Bf-blender-cvs mailing list