I have an object located in the origin (0,0,0). I wonder how I can translate it along the z-axis where the lowest -z value of the object will be translated to z value 0 as shown below:
Here is a simple script that accomplishes this...let me know if you have any questions.
import bpy # get a reference to the active object obj = bpy.context.object # get the minimum z-value of all vertices after converting to global transform lowest_pt = min([(obj.matrix_world * v.co).z for v in obj.data.vertices]) # transform the object obj.location.z -= lowest_pt
For 2.8 replace
@ for matrix multiplication.
lowest_pt = min([(obj.matrix_world @ v.co).z for v in obj.data.vertices])