Python Beginer - Scale An Object Via Python Code

Hi All,
I have looked and looked and can find no information on how to scale the cube via python code.


import Blender as B
NAME = 'Cube'      # Name of object to process.
ob = B.Object.Get( NAME )

To position the cube, all I need to do is this.


ob.setLocation(x,y,z)

But to scale the cube I don’t know what the syntax is to scale?
I tried the obvious.


ob.setScale(1,2,3)

But that didn’t work.

Why is this basic information so incredibly hidden an not documented? You’d think it would be listed as a property of Object.

Can anyone help with this?

Is it even possible to scale a cube via python?:confused:

Use the setSize(x, y, z) method of the Object class.
http://www.blender.org/documentation/245PythonDoc/Object.Object-class.html#setSize

It is only recently that what was formerly named ‘Size’ has become ‘Scale’. The former name left it imprint on some Python functions to this day.

Jean

All right, I found a clue in another post.

http://blenderartists.org/forum/showthread.php?t=101515

It seems the property name for scaling is actually “size”


ob.SizeX = 2.0
ob.SizeY = 1.5

Thanks for the doc link, IamInnocent (are you…?)

Innocent?
LOL
Jean