diff options
author | Ken Hughes <khughes@pacific.edu> | 2009-05-28 18:24:16 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2009-05-28 18:24:16 +0400 |
commit | bdfa07cddb4aaec98e761d2b06730fdf49a8365d (patch) | |
tree | 113c456f2e885bf33cd45e9e7da32520318b0848 /source/blender/python/api2_2x/bpy_data.c | |
parent | 0edb6e89be23c20f1b1e3521ea854e44829b4969 (diff) |
Python API
----------
Bugfix: make bpy.data.meshes.new() work the same way as Blender.Mesh.New().
Diffstat (limited to 'source/blender/python/api2_2x/bpy_data.c')
-rw-r--r-- | source/blender/python/api2_2x/bpy_data.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/bpy_data.c b/source/blender/python/api2_2x/bpy_data.c index d3499a79874..d2e80bc3611 100644 --- a/source/blender/python/api2_2x/bpy_data.c +++ b/source/blender/python/api2_2x/bpy_data.c @@ -404,6 +404,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd) float color[] = {0, 0, 0, 1}; short data_code = 0; int user_count = 0; + PyObject *newOb = NULL; /* Load from file */ if ( ( self->type==ID_IM || self->type==ID_VF || @@ -594,7 +595,13 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd) /* set some types user count to 1, otherwise zero */ id->us = user_count; - return GetPyObjectFromID(id); + newOb = GetPyObjectFromID(id); + /* if object is a mesh, set the new flag so memory can be deallocated + * later if the mesh is not linked to an object (consistent with the + * Blender.Mesh.New() method */ + if (self->type == ID_ME) + ((BPy_Mesh *)newOb)->new = 1; + return newOb; } |