diff options
author | Ken Hughes <khughes@pacific.edu> | 2007-02-14 20:40:31 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2007-02-14 20:40:31 +0300 |
commit | 4aa33f56331351ee02d353fb47e6d71381404bb1 (patch) | |
tree | ed0e8e42c77384be854a5ddd8a41531adf31cc3c | |
parent | a1b01f968f4f3468938a7b6e8ea40e78b2bf99d3 (diff) |
Python API
----------
Bugfix for problem reported with ac3d importer; Object_getData() wasn't
setting the real object type before calling EXPP_add_obdata().
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index f7b0e391f9e..0a191177719 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -4652,9 +4652,19 @@ static PyObject *Object_getData( BPy_Object *self, PyObject *args, /* if there's no obdata, try to create it */ if( object->data == NULL ) { + int tmptype = object->type; /* save current type */ + + /* if we have no data and are faking an empty, set the type */ + if( self->realtype != OB_EMPTY ) + object->type = self->realtype; + if( EXPP_add_obdata( object ) != 0 ) { /* couldn't create obdata */ + object->type = tmptype; /* restore previous type */ Py_RETURN_NONE; } + + /* if we set data successfully, clear the fake type */ + self->realtype = OB_EMPTY; } /* user wants only the name of the data object */ |