[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59085] trunk/blender/source/blender: Followup for r58992, fixing user decrement error

Sergey Sharybin sergey.vfx at gmail.com
Mon Aug 12 15:52:14 CEST 2013


Revision: 59085
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59085
Author:   nazgul
Date:     2013-08-12 13:52:13 +0000 (Mon, 12 Aug 2013)
Log Message:
-----------
Followup for r58992, fixing user decrement error

Some places like proxy rebuild didn't increent
custom shape user counter which lead to user
decrement errors later when freeing pose channels.

Try to keep custom object counter relevent, but
some corner cases might still be missing.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58992

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/action.c
    trunk/blender/source/blender/blenkernel/intern/armature.c
    trunk/blender/source/blender/editors/armature/pose_edit.c

Modified: trunk/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/action.c	2013-08-12 12:31:51 UTC (rev 59084)
+++ trunk/blender/source/blender/blenkernel/intern/action.c	2013-08-12 13:52:13 UTC (rev 59085)
@@ -613,7 +613,6 @@
 	}
 }
 
-
 void BKE_pose_channel_free(bPoseChannel *pchan)
 {
 	if (pchan->custom) {
@@ -731,6 +730,9 @@
 
 	/* custom shape */
 	pchan->custom = pchan_from->custom;
+	if (pchan->custom) {
+		id_us_plus(&pchan->custom->id);
+	}
 }
 
 

Modified: trunk/blender/source/blender/blenkernel/intern/armature.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/armature.c	2013-08-12 12:31:51 UTC (rev 59084)
+++ trunk/blender/source/blender/blenkernel/intern/armature.c	2013-08-12 13:52:13 UTC (rev 59085)
@@ -1652,10 +1652,16 @@
 			
 			/* copy data in temp back over to the cleaned-out (but still allocated) original channel */
 			*pchan = pchanw;
+			if (pchan->custom) {
+				id_us_plus(&pchan->custom->id);
+			}
 		}
 		else {
 			/* always copy custom shape */
 			pchan->custom = pchanp->custom;
+			if (pchan->custom) {
+				id_us_plus(&pchan->custom->id);
+			}
 			if (pchanp->custom_tx)
 				pchan->custom_tx = BKE_pose_channel_find_name(pose, pchanp->custom_tx->name);
 

Modified: trunk/blender/source/blender/editors/armature/pose_edit.c
===================================================================
--- trunk/blender/source/blender/editors/armature/pose_edit.c	2013-08-12 12:31:51 UTC (rev 59084)
+++ trunk/blender/source/blender/editors/armature/pose_edit.c	2013-08-12 13:52:13 UTC (rev 59085)
@@ -487,6 +487,9 @@
 					break;
 					case 8: /* Custom Bone Shape */
 						pchan->custom = pchanact->custom;
+						if (pchan->custom) {
+							id_us_plus(&pchan->custom->id);
+						}
 						break;
 					case 9: /* Visual Location */
 						BKE_armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);




More information about the Bf-blender-cvs mailing list