mesh icon indicating copy to clipboard operation
mesh copied to clipboard

Mesh and Meshviewer cannot be used

Open ghost opened this issue 5 years ago • 9 comments

I had compiled and install Boost and the psbody-mesh package following the README.md using Makefile in the repository. And run the test successfully by the command $ make tests as well as $ make documentation.

But when I use the command $ meshviewer view sphere.obj, it occurs an error, ValueError: Could not load file.

Tarceback reports that the error occurs in File "psbody/mesh/serialization/serialization.py", line 98, in load_from_obj_cpp from .loadobj import loadobj.

Then I found there is not loadobj file in the whole directory, as well as aabb_normals, spatialsearch, plyutils. It indicates the Cmakelist.txt in ./mesh is no use.

Do you know how to deal with the problem?

ghost avatar Oct 14 '20 19:10 ghost

Finally, I found that the file CMakeLists.txt in mesh/mesh hadn't used in BOOST_INCLUDE_DIRS=/path/to/boost/include make all. It caused these files whose names were aabb_normals, spatialsearch, plyutils, loadobj hadn't generated. As a result, we cannot import them, becuase they don't exist at all.

In the end, I cmake the file CMakeLists.txt in mesh/mesh, and get these missing files. Then I successfully fix this bug.

ghost avatar Oct 19 '20 13:10 ghost

I got the same error, could you please share exactly what worked?

khushgrover avatar Oct 23 '20 19:10 khushgrover

I got the same error, could you please share exactly what worked?

cd mesh/mesh/cmake/
cmake ..
make

then you can see aabb_normals.so, spatialsearch.so, plyutils.so and loadobj.so files in the folder mesh/mesh/cmake. follow your bug, put these files into correct folders.

ghost avatar Oct 28 '20 05:10 ghost

Hi @faneggs , thank you for sharing! What should I do after copying *.so to the correct folder?

from .loadobj import loadobj In "psbody/mesh/serialization/serialization.py", line 98 I think the loadobj should a be py file, but now we only have a .so file.

Could you please share more details? Thx

ryancll avatar Oct 28 '20 12:10 ryancll

Using this command

$ meshviewer view sphere.obj

it occurs an error, ValueError: Could not load file. I got it working by specifying the actual path for the object.

$ meshviewer view data/unittest/sphere.obj

khushgrover avatar Oct 28 '20 12:10 khushgrover

Hi @faneggs , thank you for sharing! What should I do after copying *.so to the correct folder?

from .loadobj import loadobj In "psbody/mesh/serialization/serialization.py", line 98 I think the loadobj should a be py file, but now we only have a .so file.

Could you please share more details? Thx

the .so file is a dynamic link library that can be imported by any language.

ghost avatar Nov 09 '20 07:11 ghost

if you are using python3, then you might see an error following after cmake ..:

CMake Error at cmake/thirdparty.cmake:35 (message):
  [numpy] the following error occured: File "<string>", line 1

      import numpy; print numpy.get_include()
                              ^

  SyntaxError: invalid syntax

   - Consider setting PYTHON_ROOT in the environment
Call Stack (most recent call first):
  CMakeLists.txt:17 (include)


-- Configuring incomplete, errors occurred!

Open and edit the file ./mesh/cmake/thirdparty.cmake Replace import numpy; print numpy.get_include() with import numpy; print(numpy.get_include()) in this file

cmake .. agian

ghost avatar Nov 13 '20 06:11 ghost

@faneggs @khushgrover I followed these steps

  1. git clone https://github.com/MPI-IS/mesh.git

  2. cd mesh

  3. make all BOOST_INCLUDE_DIRS=/usr/include/boost/

  4. make tests and make documentation

  5. after this cd mesh/cmake and cmake .. and make at the end this shows building the missing files like loadobj.so

  6. meshviewer view sphere.obj still shows the error

    v, vt, vn, f, ft, fn, mtl_path, landm, segm = loadobj(filename) ValueError: Could not load file

I didn't understand the part when you said copy the files to the exact location. as in copy where. the missing files(loadobj.so etc) are generated in the dir mesh/mesh/cmake . Do I need to move them somewhere?

meshviewer view data/unittest/sphere.obj this works though!!

trinanjan12 avatar Nov 17 '20 15:11 trinanjan12

@faneggs @khushgrover I followed these steps

  1. git clone https://github.com/MPI-IS/mesh.git
  2. cd mesh
  3. make all BOOST_INCLUDE_DIRS=/usr/include/boost/
  4. make tests and make documentation
  5. after this cd mesh/cmake and cmake .. and make at the end this shows building the missing files like loadobj.so
  6. meshviewer view sphere.obj still shows the error v, vt, vn, f, ft, fn, mtl_path, landm, segm = loadobj(filename) ValueError: Could not load file

I didn't understand the part when you said copy the files to the exact location. as in copy where. the missing files(loadobj.so etc) are generated in the dir mesh/mesh/cmake . Do I need to move them somewhere?

meshviewer view data/unittest/sphere.obj this works though!!

./mesh/geometry/spatialsearch.so ./mesh/serialization/plyutils.so ./mesh/spatialsearch.so ./mesh/serialization/loadobj.so

ghost avatar Nov 25 '20 12:11 ghost