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:
authorAlexander Ewering <blender@instinctive.de>2005-09-29 19:46:06 +0400
committerAlexander Ewering <blender@instinctive.de>2005-09-29 19:46:06 +0400
commit76a57eb82f085c52fb095d6055e4fa07dab95103 (patch)
treed5c1fda52c704e0634ec92c9809119bd5515df1a /source/blender/python/api2_2x/Text3d.c
parent03e1ec988b0b652ae4ecbbbd5b3214740c29f2e8 (diff)
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 :)
Diffstat (limited to 'source/blender/python/api2_2x/Text3d.c')
-rw-r--r--source/blender/python/api2_2x/Text3d.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c
index 8047218bdd2..5e7ccd43f75 100644
--- a/source/blender/python/api2_2x/Text3d.c
+++ b/source/blender/python/api2_2x/Text3d.c
@@ -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