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:
authorKen Hughes <khughes@pacific.edu>2006-12-17 03:21:57 +0300
committerKen Hughes <khughes@pacific.edu>2006-12-17 03:21:57 +0300
commit08a7208aa6274e469459b4fa234a42e6ccbae1ae (patch)
tree0b246d945f3389e8bed350cfc40e405cb312bfec /source/blender/python/api2_2x/Scene.c
parent08e3f8b1dae9cd9776bd9a0221fce9c4de86467d (diff)
Python API
---------- A more robust attempt to avoid creating non-Empty objects with no data while maintaining backward compatibility.
Diffstat (limited to 'source/blender/python/api2_2x/Scene.c')
-rw-r--r--source/blender/python/api2_2x/Scene.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index eb204619f2a..7502c292753 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -809,8 +809,16 @@ static PyObject *Scene_link( BPy_Scene * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't allocate new Base for object" );
+ /* if the object has not yet been linked to object data, then
+ * set the real type before we try creating data */
+
+ if( bpy_obj->realtype != OB_EMPTY ) {
+ object->type = bpy_obj->realtype;
+ bpy_obj->realtype = OB_EMPTY;
+ }
+
/* check if this object has obdata, case not, try to create it */
-
+
if( !object->data && ( object->type != OB_EMPTY ) )
EXPP_add_obdata( object ); /* returns -1 on error, defined in Object.c */