I'm using python for batch upload and rendering. I need to import many SVGs, resize them and place to required position. Import is OK, curve is named, I can read dimensions, but I can't write new dimensions back. Where I doing mistake? Thanks for help.
maxSize = 0.220
for emboss in embosses:
emb_name = emboss[:-4]
loadedSVG = bpy.ops.import_curve.svg(filepath = embossDir + emboss, filter_glob=".svg")
for obj in bpy.data.objects:
if obj.tag == False:
obj.name = emb_name
obj.tag = True
bpy.ops.object.select_pattern(pattern = emb_name)
meshes = bpy.context.selected_objects
x, y, z = meshes[0].dimensions
if x > y:
needRatio = maxSize / x
if y > x:
needRatio = maxSize / y
# not working code starts
meshes[0].dimensions.x = x * needRatio
meshes[0].dimensions.y = y * needRatio
meshes[0].dimensions.z = z * needRatio
# not working code ends
bpy.ops.object.select_all(action='DESELECT')