Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to move vertices along axis Z GLOBAL but I don't find how to do it. I've tried this:

ob =["object1"] #the vertices belong to object1
mat = ob.matrix_world
matloc = ob.matrix_local
for i in range( 0, len(poligonos) ):
    v = mesh.getVertex(0, poligonos[i]) #poligonos is an array where I store the index of each vertex that I want to move
    glo = mat * v.XYZ
    glo.x = glo.x
    glo.y = glo.y
    glo.z = glo.z - 0.1
    aux = matloc * glo
    v.setXYZ([aux.x, aux.y, aux.z])

But this code moves my vertices to weird locations and what I need is the vertices go down in 0.1

share|improve this question
up vote 4 down vote accepted

Worked for me:

import bpy

obj  =['Cube']
mesh =
vert = mesh.vertices[0]
mat_world = obj.matrix_world

pos_world = mat_world *
pos_world.z += 0.1 = mat_world.inverted() * pos_world

If you're editing a lot of vertices then you might want to compose the matrix:

from mathutils import Vector, Matrix

vec = Vector((0.0, 0.0, 0.1))  
mat_edit = mat_world.inverted() * Matrix.Translate(vec) * mat_world = mat_edit *
share|improve this answer

The answer of "pink vertex" is a great idea but finally I fixed the problem like this:

for i in range( 0, len(poligonos) ):
    v = mesh.getVertex(0, poligonos[i])
    glo = mat * v.XYZ
    glo.z += 0.1
    v.XYZ = mat.inverted() * glo
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.