Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export scenes as .obj #52

Closed
FedeClaudi opened this issue Sep 19, 2019 · 2 comments
Closed

Export scenes as .obj #52

FedeClaudi opened this issue Sep 19, 2019 · 2 comments
Labels

Comments

@FedeClaudi
Copy link
Contributor

Hi,

Thank you for the amazing resource.

I've been trying to export actors and whole scenes as .OBJ files, but I think I've found a bug.

In vtkplotter.vtkio both .write() and .save() should support .obj files:

def write(objct, fileoutput, binary=True):
    """
    Write 3D object to file. (same as `save()`).
    Possile extensions are:
        - vtk, vti, npy, ply, obj, stl, byu, vtp, vti, mhd, xyz, tif, png, bmp.
    """

but an error is thrown if one tries to save as .obj:

 Unknown format scene.obj file not saved.

In write() in the if/else statements checking for the file format there is no if ".obj" in fr
so ".obj" is not recognized as a valid format.

Is ".obj" going to be supported in the future?

@marcomusy
Copy link
Owner

Hi Federico,
thanks a lot! the bug is actually in the documentation... I hadn't added the wavefront OBJ format because VTK will only support it in future releases (though the class is already present in the nightly builds).. so it will be for sure available.
Meanwhile I've added it in vtkplotter so that it will there when available from vtk.
Thanks for drawing my attention to it,
Cheers
Marco

@FedeClaudi
Copy link
Contributor Author

Hi,

That's great thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants