Fix Python API to correctly create Text3D objects. This is just a

temporary fix (duplicating code again), the *real* fix would be to once
make one central function to create and init a text object for all
places...

I also tried to introduce compatibility code to be able to load old files
with broken text objects (cu->tb == NULL due to missing init code).

Hope it works :)
This commit is contained in:
Alexander Ewering
2005-09-29 15:46:06 +00:00
parent 03e1ec988b
commit 76a57eb82f
2 changed files with 8 additions and 0 deletions

View File

@@ -265,6 +265,11 @@ PyObject *M_Text3d_New( PyObject * self, PyObject * args )
bltext3d->str= MEM_mallocN(12, "str");
strcpy(bltext3d->str, "Text");
bltext3d->pos= 4;
bltext3d->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo");
bltext3d->totbox= bltext3d->actbox= 1;
bltext3d->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
bltext3d->tb[0].w = bltext3d->tb[0].h = 0.0;
if( bltext3d == NULL ) /* bail out if add_curve() failed */
return ( EXPP_ReturnPyObjError