[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33853] trunk/blender/source/blender/ makesrna/intern/rna_pose.c: Bug fix, IRC, patch provided by Dan Eicher
Ton Roosendaal
ton at blender.org
Wed Dec 22 17:33:13 CET 2010
Revision: 33853
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33853
Author: ton
Date: 2010-12-22 17:33:13 +0100 (Wed, 22 Dec 2010)
Log Message:
-----------
Bug fix, IRC, patch provided by Dan Eicher
Custom bone shape link/unlink now respects ID user counting.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_pose.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_pose.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_pose.c 2010-12-22 16:07:57 UTC (rev 33852)
+++ trunk/blender/source/blender/makesrna/intern/rna_pose.c 2010-12-22 16:33:13 UTC (rev 33853)
@@ -283,6 +283,21 @@
rna_Itasc_update(bmain, scene, ptr);
}
+static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value)
+{
+ bPoseChannel *pchan = (bPoseChannel*)ptr->data;
+
+
+ if (pchan->custom) {
+ id_us_min(&pchan->custom->id);
+ pchan->custom = NULL;
+ }
+
+ pchan->custom = value.data;
+
+ id_us_plus(&pchan->custom->id);
+}
+
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -956,6 +971,7 @@
RNA_def_property_pointer_sdna(prop, NULL, "custom");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_PoseChannel_bone_custom_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
More information about the Bf-blender-cvs
mailing list