Revision: 22757
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22757
Author:   aligorith
Date:     2009-08-25 06:32:40 +0200 (Tue, 25 Aug 2009)

Log Message:
-----------
2.5 - Action Editor

New Actions can now be added again from the Action Editor. 

There are no guarantees that this works totally safely yet (reference counting 
may be quite off), so you've been warned.

Modified Paths:
--------------
    
branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c
    
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c  
    2009-08-25 04:05:37 UTC (rev 22756)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_utils.c  
    2009-08-25 04:32:40 UTC (rev 22757)
@@ -444,6 +444,20 @@
                        uiBlockClearButLock(block);
                }
                
+               /* add button */
+               if(events & UI_ID_ADD_NEW) {
+                       uiBlockSetButLock(block, (events & UI_ID_PIN) && 
*pin_p, "Can't unlink pinned data");
+                       if(parid && parid->lib);
+                       else {
+                               dup_params= MEM_dupallocN(params);
+                               but= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 
x,y,DEF_ICON_BUT_WIDTH,DEF_BUT_HEIGHT, &dup_params->browsenr, params->browsenr, 
32767.0, 0, 0, "Add new data block");
+                               uiButSetNFunc(but, idpoin_cb, 
MEM_dupallocN(params), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+                               x+= DEF_ICON_BUT_WIDTH;
+                       }
+                       
+                       uiBlockClearButLock(block);
+               }
+               
                /* delete button */
                if(events & UI_ID_DELETE) {
                        uiBlockSetButLock(block, (events & UI_ID_PIN) && 
*pin_p, "Can't unlink pinned data");

Modified: 
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c 
    2009-08-25 04:05:37 UTC (rev 22756)
+++ 
branches/blender2.5/blender/source/blender/editors/space_action/action_header.c 
    2009-08-25 04:32:40 UTC (rev 22757)
@@ -43,6 +43,7 @@
 #include "BLI_blenlib.h"
 
 #include "BKE_animsys.h"
+#include "BKE_action.h"
 #include "BKE_context.h"
 #include "BKE_screen.h"
 
@@ -272,6 +273,7 @@
                                /* set action */
                                printf("\tset action \n");
                                adt->action= saction->action;
+                               adt->action->id.us++;
                        }
                        
                        ED_area_tag_redraw(CTX_wm_area(C));
@@ -282,7 +284,14 @@
                        break;
                case UI_ID_ADD_NEW:
                        printf("actedit addnew \n");
-                       /* XXX not implemented */
+                       if (saction->pin == 0) {
+                               AnimData *adt= BKE_id_add_animdata(&obact->id); 
/* this only adds if non-existant */
+                               
+                               /* set new action */
+                               // XXX need to restore behaviour to copy old 
actions...
+                               printf("\tset new action \n");
+                               adt->action= saction->action= 
add_empty_action("Action");
+                       }
                        break;
                case UI_ID_OPEN:
                        printf("actedit open \n");


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to