Page 1 of 1

Error loading mesh file

Posted: Mon May 06, 2019 8:01 pm
by clevasse
Hello, I am trying to run the static optimization tool and when I load my motion file and start to run I get this error:

Exception:
Error loading mesh file: scapula.obj. The file should exist in same folder
with model.
Loading is aborted.

This scapula file is in the exact same folder that my model is saved in. I have run the forward dynamics tool with the exact folder and model but when I try to run the static optimization tool I'm getting the error above.

Is there something I am doing wrong?

Re: Error loading mesh file

Posted: Mon May 06, 2019 11:47 pm
by mitkof6
You can open the .osim file of the model and examine how the scapula.obj file is included in the model

Code: Select all

<geometry_file>scapula.obj</geometry_file>
or

Code: Select all

<geometry_file>some relative path/scapula.obj</geometry_file>
In the first case, OpenSim searches for the scapula.obj either in the model directory or the global geometry path, which is located in the OpenSim installation path (e.g., C:\OpenSim X.X\Geometry). You can copy the scapula.obj in the Geometry folder as a last resolve.

Re: Error loading mesh file

Posted: Tue May 07, 2019 5:13 am
by clevasse
What if I have the file in the main folder that the model is in and the geometry folder?

Also this is a contact geometry file so the code reads:

<filename>scapula.obj</filename>

Re: Error loading mesh file

Posted: Tue May 07, 2019 7:23 am
by mitkof6
This repository has done something similar (contact geometries) and the .obj files are placed next to the .osim file:

https://github.com/msdemers/landing-opt ... -framework

Are you able to correctly load the model in the OpenSim GUI?

If yes, then there might be some bug in the StaticOptimization tool. It is possible that the StaticOptimization changes the working directory. Try to read the message window for more information.

Maybe you can find a workaround by copying the .obj files in the Geometry folder.

Re: Error loading mesh file

Posted: Tue May 07, 2019 8:13 am
by clevasse
Yes it loads correctly in the GUI. Would trying OpenSim 4.0 potentially fix the bug? I will look at the link you sent me as well.

Re: Error loading mesh file

Posted: Tue Dec 31, 2019 11:01 am
by choltkamp1
did you every resolve this issue. I am having the same issue. My model loads correctly in the GUI however when I go to scale it using the scale tool, i get the same message.

"Error loading Mesh file:./tibial_plane.obj. The file should exist in the same folder as the model. Loading aborted."

The .obj file is clearly in the same folder as the model

Any help would be great. Thanks!