diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-11 10:27:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-11 10:27:38 +0400 |
commit | ae6e013c1502a8960b3fec676cbea7fa6fa24172 (patch) | |
tree | 64490444debf05028a6c4a25c11e9ddc9eb3746c /source | |
parent | 5d229db946e65ee7fe7ec99358c55dfcf519c246 (diff) |
new materials and cameras had incorrect usercounts when added from python
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 72ed625e5aa..b58ed4aab6a 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -86,7 +86,9 @@ Tex *rna_Main_add_texture(Main *bmain, char *name) Camera *rna_Main_cameras_new(Main *bmain, char* name) { - return add_camera(name); + ID *id= add_camera(name); + id->us--; + return (Camera *)id; } void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *camera) { @@ -193,7 +195,9 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob struct Material *rna_Main_materials_new(Main *bmain, char* name) { - return add_material(name); + ID *id= (ID *)add_material(name); + id->us--; + return (Material *)id; } void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material *material) { |