【问题标题】:to_mesh() in blender 3搅拌机 3 中的 to_mesh()
【发布时间】:2022-01-13 20:52:22
【问题描述】:

在以前的 blender 版本中,可以使用 to_mesh() 获取顶点的实际位置:

https://blenderartists.org/t/how-to-get-vertices-coordinates-from-animated-mesh/565581/4

不幸的是,这个功能在 Blender 3 中不起作用,是吗?是否有其他方法可以通过应用修改器和形状键来获取顶点坐标?提前致谢!

问候

【问题讨论】:

    标签: python blender


    【解决方案1】:

    这个最小的例子在搅拌机 3.0.0 中为我工作:

    import bpy
    
    # get absolute position of a vertex from an object with shapekeys (and other transforms)
    dg = bpy.context.evaluated_depsgraph_get()
    obj = bpy.context.object.evaluated_get(dg)
    
    mesh = obj.to_mesh(preserve_all_data_layers=True, depsgraph=dg)
    co = mesh.vertices[0].co
    co_final = obj.matrix_world @ co
    print(co_final)
    

    它是基于ideaman42 和iceythe Kaio 在这个较早的帖子中的方法: https://blenderartists.org/t/get-mesh-data-with-modifiers-applied-in-2-8/1163217 https://blender.stackexchange.com/questions/1311/how-can-i-get-vertex-positions-from-a-mesh

    【讨论】:

      猜你喜欢
      • 2020-01-06
      • 2016-01-19
      • 2012-11-15
      • 2013-09-11
      • 2012-02-07
      • 2021-06-18
      • 2020-06-07
      • 2016-09-12
      • 2013-01-09
      相关资源
      最近更新 更多