Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

May 16, 2011

Blender 2.5 Python Extrude with Vector

import bpy
from mathutils import Vector

myVec = Vector((1.0,2.0,1.0))

bpy.ops.mesh.extrude_region_move(MESH_OT_extrude={"type":'REGION'}, 
                                 TRANSFORM_OT_translate={"value":myVec})
If you execute this script while in edit mode, with a face selected (in face selection mode) -- then the created faces along the extrusion will/may appear inverted, they revert to outside as soon as you perform other operations on a mesh. Experiment!

The 2.6 equivalent code

The best way to figure these things out is to use the reporting console, (ie, set for example a timeline window to display the information window, any user interaction will show up as code)