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 = bpy.data.curves.new(name, 'FONT') o1 = bpy.data.objects.new(name, t1) o1.location = (0,0,2) bpy.context.scene.objects.link(o1) t1.body = "Hail Bob!" c1 = o1.constraints.new('TRACK_TO') c1.target = bpy.data.objects["Camera"] c1.track_axis = 'TRACK_Z' c1.up_axis = 'UP_Y' if False: t1.align = 'RIGHT' else: print (o1.dimensions.x) t1.text_boxes.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?