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

Failed to load a mesh with a '.obj' extension. #78

Open
xleEmesent opened this issue Jan 24, 2022 · 2 comments
Open

Failed to load a mesh with a '.obj' extension. #78

xleEmesent opened this issue Jan 24, 2022 · 2 comments

Comments

@xleEmesent
Copy link

Hi, MeshParty team:

I am trying to load a mesh file (can open in MeshLab)

    meshFilePath="../data/Mesh.obj"
    mm = trimesh_io.MeshMeta()
    mesh = mm.mesh(filename = meshFilePath)

Then the following error message generated:

python3.8/site-packages/meshparty/trimesh_io.py", line 610, in mesh
    if not isinstance(self.cv.mesh, ShardedMultiLevelPrecomputedMeshSource):
AttributeError: 'NoneType' object has no attribute 'mesh'

Anything I have missed here? Thanks in advance.

@ceesem
Copy link
Collaborator

ceesem commented Jan 24, 2022

This is a bit of a bug — at the moment the MeshMeta object requires a cloud volume path even if the files are to be loaded locally, because it wants to know how to handle a root id. We should improve the logic of this requirement, as well as have a direct method to do mesh loading.

There are two workarounds right now:

  1. Use any segmentation cloudpath, even if you're not going to use it to download files. Here's a publicly available one precomputed://gs://neuroglancer-public-data/kasthuri2011/ground_truth

  2. Build the mesh through a method other than the meshmeta — if you can import vertices and faces, then trimesh_io.Mesh(vertices=vertices, faces=faces) will work fine. Trimesh should make this import easy, but then you don't have the extra features needed for the EM neuronal meshes. However, it's also possible that Trimesh does all you need it to do if you're coming in with an obj.

@xleEmesent
Copy link
Author

@ceesem , Thanks for your reply.

Regarding to the 1st workaround where a cloud path is required. If my mesh file has path as : /home/xue/eclipse-workspace/myproject/data/Mesh.obj. What should the cloudpath be here? Sorry I never use the cloudpath before.

I am trying to following the example but I could not figure out right cloudpath in my case here:

    mm = trimesh_io.MeshMeta(
    # cv_path = "precomputed://gs://neuroglancer-public-data/kasthuri2011/ground_truth",
    disk_cache_path = "test_meshes",
    map_gs_to_https=True)

Do I also need to set up google cloud credentials as well?
Many Thanks!!!

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

No branches or pull requests

2 participants