When using this code, I've an error, I think it's about tuples being immutable, but I can't understand why. I'm looking to resize the cube just created:
# Create new cube def create_cube(name, cornerPos, size): # Set cursor position for the current brick bpy.context.scene.cursor_location = cornerPos # Add a cube primitive bpy.ops.mesh.primitive_cube_add() # Get its reference via the active object, and rename theBrick = bpy.context.active_object theBrick.name = name # Set size bpy.ops.transform.resize(value=(1.0, 1.0, 1.0)) bpy.ops.object.transform_apply(scale=True) # Return the object return theBrick
The error message:
TypeError: 'tuple' object does not support item assignment
Any help appreciated.