diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-28 15:05:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-28 15:05:11 +0400 |
commit | b2196c364f1ace3af53d519b7d83890aa432bab6 (patch) | |
tree | c1fc7d21f5281bbd32b363685230ae9c9a955ca5 /source/blender/makesrna/intern/rna_fcurve.c | |
parent | 0b49c6255fbff9aaccf8d3fbc34d94e2d0d64ece (diff) |
pin and driver id pointers were adding user references from rna but not on file load.
removing a reference to either could remove the object/data from the scene.
use set functions to avoid refcounting.
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 7946e73af0f..a8a73d15c9d 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -155,6 +155,13 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA * /* ----------- */ +/* note: this function exists only to avoid id refcounting */ +static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value) +{ + DriverTarget *dtar= (DriverTarget*)ptr->data; + dtar->id= value.data; +} + static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr) { DriverTarget *dtar= (DriverTarget*)ptr->data; @@ -976,7 +983,8 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ID"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); - RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_DriverTarget_id_typef"); + /* note: custom set function is ONLY to avoid rna setting a user for this. */ + RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef"); RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from (id_type property must be set first)"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); |