Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-17 02:21:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-17 02:21:37 +0400
commitaddb2bbff252b6751e3eb97ac859d4ecbd4e1b78 (patch)
treebcf6f75a22ab80f35232412b12d53d30d3f4b456 /source/blender/makesrna/intern/makesrna.c
parent6a880daa92487b7f18653c32fcfcbad11ead6b75 (diff)
fix for assigning any ID in rna, it would not run id_lib_extern() which means the library reference would be lost on reload.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 40f6c1de67e..35b2eff9c62 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -628,6 +628,14 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, " if(value.data)\n");
fprintf(f, " id_us_plus((ID*)value.data);\n\n");
}
+ else {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+ StructRNA *type= rna_find_struct((char*)pprop->type);
+ if(type && (type->flag & STRUCT_ID)) {
+ fprintf(f, " if(value.data)\n");
+ fprintf(f, " id_lib_extern((ID*)value.data);\n\n");
+ }
+ }
fprintf(f, " data->%s= value.data;\n", dp->dnaname);