0
$\begingroup$

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.

$\endgroup$
5
  • 2
    $\begingroup$ For 2.8 replace * with @ for matrix multiplication. $\endgroup$
    – batFINGER
    Commented Jan 21, 2019 at 20:48
  • $\begingroup$ 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. $\endgroup$
    – batFINGER
    Commented Jan 21, 2019 at 20:53
  • $\begingroup$ @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. $\endgroup$
    – JakeD
    Commented Jan 21, 2019 at 21:09
  • $\begingroup$ 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. $\endgroup$
    – batFINGER
    Commented Jan 21, 2019 at 21:23
  • $\begingroup$ @JakeD added blender.stackexchange.com/questions/129473/… to catch this one. $\endgroup$
    – batFINGER
    Commented Jan 21, 2019 at 22:15

0

You must log in to answer this question.

Browse other questions tagged .