fix for assigning any ID in rna, it would not run id_lib_extern() which means the library reference would be lost on reload.

This commit is contained in:
Campbell Barton
2010-07-16 22:21:37 +00:00
parent 6a880daa92
commit addb2bbff2

View File

@@ -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);