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
path: root/source
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2009-05-28 18:24:16 +0400
committerKen Hughes <khughes@pacific.edu>2009-05-28 18:24:16 +0400
commitbdfa07cddb4aaec98e761d2b06730fdf49a8365d (patch)
tree113c456f2e885bf33cd45e9e7da32520318b0848 /source
parent0edb6e89be23c20f1b1e3521ea854e44829b4969 (diff)
Python API
---------- Bugfix: make bpy.data.meshes.new() work the same way as Blender.Mesh.New().
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/bpy_data.c9
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;
}