0

This question shows how to move the lowest vertex of a mesh on the grid, but the script given only works in versions before Blender 2.8: Translate object using lowest Z value python

Here is the script given:

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

What is the version of this script for Blender 2.8?

Note: I have intentionally copied a similar title so the users can find the Blender 2.8 version more easily.

Danyl Bekhoucha
  • 3,722
  • 13
  • 47
  • 96
  • 2
    For 2.8 replace * with @ for matrix multiplication. – batFINGER Jan 21 '19 at 20:48
  • Edited original q with this info. I see in comments it was suggested to ask a new question... I'm not so sure that each question needing this simple change need be a new question. If you agree consider removing. – batFINGER Jan 21 '19 at 20:53
  • @batFINGER I'm not sure about that...if the original answer came from someone who isn't keeping up with the 2.8 project (me), it will be hard to get enough visibility from those who do know the answer to update it. I'm not sure if "duplicate questions" like this has already been addressed on Meta, but it might be worth discussing there as "How to do X in 2.8?" is a common question now. – JakeD Jan 21 '19 at 21:09
  • IMO related to the version tag chestnut. Rather than a version tag the version is being tagged in the title. A whole new question and answer for what is a one character change seems a bit OTT. Version tags for answers would be great. Edited your original answer with such. I see your point, would not have noticed if not for the new question. – batFINGER Jan 21 '19 at 21:23
  • @JakeD added https://blender.stackexchange.com/questions/129473/typeerror-element-wise-multiplication-not-supported-between-matrix-and-vect to catch this one. – batFINGER Jan 21 '19 at 22:15

0 Answers0