[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43588] trunk/blender/source/blender/ editors/object/object_add.c: patch: ' set the right Action Actuator when duplicating an object' by Daniel Macedo

Dalai Felinto dfelinto at gmail.com
Sun Jan 22 00:57:33 CET 2012


Revision: 43588
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43588
Author:   dfelinto
Date:     2012-01-21 23:57:28 +0000 (Sat, 21 Jan 2012)
Log Message:
-----------
patch: 'set the right Action Actuator when duplicating an object' by Daniel Macedo
bug and patch not in tracker. little fix by me (replace while loop by for(...;act;...). Thanks Daniel ;)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_add.c

Modified: trunk/blender/source/blender/editors/object/object_add.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_add.c	2012-01-21 23:01:25 UTC (rev 43587)
+++ trunk/blender/source/blender/editors/object/object_add.c	2012-01-21 23:57:28 UTC (rev 43588)
@@ -46,6 +46,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_speaker_types.h"
 #include "DNA_vfont_types.h"
+#include "DNA_actuator_types.h"
 
 #include "BLI_ghash.h"
 #include "BLI_listbase.h"
@@ -1793,6 +1794,18 @@
 			if(dupflag & USER_DUP_ACT) {
 				BKE_copy_animdata_id_action((ID *)obn->data);
 				if(key) BKE_copy_animdata_id_action((ID*)key);
+				
+				/* Update the duplicated action in the action actuators */
+				bActuator *act;
+				for (act= obn->actuators.first; act; act= act->next) {
+					if(act->type == ACT_ACTION) {
+						bActionActuator* actact = (bActionActuator*) act->data;
+						if(actact->act == ob->adt->action) {
+							actact->act = obn->adt->action;
+						}
+					}
+					act= act->next;
+				}
 			}
 			
 			if(dupflag & USER_DUP_MAT) {




More information about the Bf-blender-cvs mailing list