【问题标题】:Why the mesh didn't follow the armature in the edit mode, how to get the coordinates of points on a mesh that defomred by armature?为什么网格在编辑模式下没有跟随骨架,如何获得骨架变形的网格上的点坐标?
【发布时间】:2019-01-05 16:09:23
【问题描述】:

我想通过骨架随机变形一个对象并获取该对象上的点坐标,但是在旋转骨架中的骨骼后,我只得到了每个点的原点坐标。

我试过了:

obj = bpy.data.objects['horse']
mesh = obj.data
for v in mesh.vertices:
    print(v.co)

也试过了:

obj = bpy.data.objects['horse']
bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(obj.data)
for v in bm.verts:
    print(v.co)

但是,两个代码都获得了点的原点坐标。有谁知道如何获得跟随电枢的网格中点的坐标?

【问题讨论】:

  • 我在编辑模式下找到了一个叫做显示修饰符的按钮,但它只是改变显示,当我想获取点的坐标时,我还是得到了原点坐标。

标签: python blender bpy bmesh


【解决方案1】:

我想你想使用obj.to_mesh(),如this answer所示。

还有 bmesh.from_object(deform=True) 如果使用 bmesh 更适合你想做的事情。

【讨论】:

    猜你喜欢
    • 2015-05-09
    • 2013-04-01
    • 2012-01-25
    • 1970-01-01
    • 2013-03-10
    • 1970-01-01
    • 1970-01-01
    • 2016-12-23
    相关资源
    最近更新 更多