import pymeshlab as ml
# 加载有顶点颜色的obj模型
ms = ml.MeshSet()
obj_path = r'C:\Users\a\Desktop\it3000-mc192.obj'
ms.load_new_mesh(obj_path)
# 创建纹理贴图并将顶点颜色绘制到贴图上
ms.apply_filter('compute_texcoord_parametrization_triangle_trivial_per_wedge', textdim=2048)
ms.apply_filter('compute_texcoord_transfer_wedge_to_vertex')
ms.apply_filter('compute_texmap_from_color', textname=obj_path.split('\\')[-1], textw=2048, texth=2048)
# 导出贴图
ms.save_current_mesh('output_model.obj')
利用pymeshlab,导出带有顶点颜色的obj文件的uv贴图
最新推荐文章于 2024-10-23 10:30:53 发布