Python API

----------
Bugfix for problem reported with ac3d importer; Object_getData() wasn't
setting the real object type before calling EXPP_add_obdata().
This commit is contained in:
Ken Hughes
2007-02-14 17:40:31 +00:00
parent a1b01f968f
commit 4aa33f5633

View File

@@ -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 */