18 lines
636 B
Python
18 lines
636 B
Python
|
|
import pymeshlab
|
||
|
|
|
||
|
|
def convert_vrml_to_obj(input_file, output_file):
|
||
|
|
# Carrega o arquivo VRML (WRL) usando pymeshlab
|
||
|
|
ms = pymeshlab.MeshSet()
|
||
|
|
ms.load_new_mesh(input_file)
|
||
|
|
|
||
|
|
# Salva como arquivo OBJ, que suporta cores
|
||
|
|
ms.save_current_mesh(output_file, save_textures=True)
|
||
|
|
|
||
|
|
print(f"Conversão concluída. Arquivo OBJ salvo em: {output_file}")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
input_file = 'montagem_completa.wrl' # Substitua pelo caminho do seu arquivo VRML de entrada
|
||
|
|
output_file = 'montagem_completa.obj' # Substitua pelo caminho do seu arquivo OBJ de saída
|
||
|
|
|
||
|
|
convert_vrml_to_obj(input_file, output_file)
|