Revision: 37334
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37334
Author:   aligorith
Date:     2011-06-09 12:44:38 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Bugfix: Setting action for AnimData via RNA didn't change the
usercounts.

Cheers to Atom on BA for noticing this.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/makesrna/intern/rna_animation.c

Modified: 
branches/soc-2011-pepper/source/blender/makesrna/intern/rna_animation.c
===================================================================
--- branches/soc-2011-pepper/source/blender/makesrna/intern/rna_animation.c     
2011-06-09 12:30:24 UTC (rev 37333)
+++ branches/soc-2011-pepper/source/blender/makesrna/intern/rna_animation.c     
2011-06-09 12:44:38 UTC (rev 37334)
@@ -76,6 +76,10 @@
        ID *ownerId = (ID *)ptr->id.data;
        AnimData *adt = (AnimData *)ptr->data;
        
+       /* manage usercount for current action */
+       if (adt->action)
+               id_us_min((ID*)adt->action);
+       
        /* assume that AnimData's action can in fact be edited... */
        if ((value.data) && (ownerId)) {
                bAction *act = (bAction *)value.data;
@@ -85,6 +89,7 @@
                        if (ELEM(act->idroot, 0, GS(ownerId->name))) {
                                /* can set */
                                adt->action = act;
+                               id_us_plus((ID*)adt->action);
                        }
                        else {
                                /* cannot set */
@@ -98,6 +103,7 @@
                                        act->id.name+2);
                                
                        adt->action = act;
+                       id_us_plus((ID*)adt->action);
                }
        }
        else {

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

Reply via email to