Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a text object using Python and I'd like to do a non-standard align (something other than left/right/center). To accomplish this I need the dimensions, but the dimensions.x is 0 at the time the python is running. It becomes non-zero later

import bpy

name = "text1"

t1 =, 'FONT')
o1 =, t1)
o1.location = (0,0,2)

t1.body = "Hail Bob!"

c1 ='TRACK_TO') =["Camera"]
c1.track_axis = 'TRACK_Z'
c1.up_axis = 'UP_Y'

if False:
    t1.align = 'RIGHT'
    print (o1.dimensions.x)
    t1.text_boxes[0].x = o1.dimensions.x * -0.3

Is there a blender API that will trigger a calculation of the dimensions property of the object so that I can use it before returning control to the UI?

share|improve this question
up vote 3 down vote accepted

Since there's no .update() method for Curve objects, you need to trigger a scene update:

t1.body = "Hail Bob!"


<Vector (3.6080, 0.7000, 0.0000)>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.