Hi!

So, I did not realize I needed to reset the data path if attempting to 
import wavefront files from various different locations. It's a little 
misleading that the code error message spits back the whole path to the 
wavefront file (looks right) and says it can't read it.

I am now having good results importing wavefront files where I reset the 
Chrono data path to the base wavefront directory before attempting to 
import the wavefront file.

Thanks for the tip, Jingquan!

-Emily

On Thursday, September 19, 2024 at 10:27:01 PM UTC-4 [email protected] wrote:

> Hi Emily,
>
> Can you please check that if you setup the correct data path? E.g.:
> """
> !!!! Set this path before running the demo!
> """
> chrono.SetChronoDataPath(chrono.GetChronoDataPath())
> veh.SetDataPath(chrono.GetChronoDataPath() + 'vehicle/')
> Best,
> Jingquan
> On Thursday, September 19, 2024 at 8:23:32 PM UTC-5 Emily Leigh wrote:
>
>> Hi!
>>
>> I am encountering difficulty importing external wavefront files to 
>> Pychrono (win-64_pychrono-8.00-py39_3631), as in wavefront files as 
>> exported from Blender. I recreated the problem with some of the wavefront 
>> files included in the Pychrono code distribution, after I imported these 
>> wavefront files into Blender and then re-exported them. I was also able to 
>> create the same problem by importing the wavefront files into Meshlab 
>> (2020.07, portable Windows version) and re-exporting them several different 
>> ways.
>>
>> Could you comment on the EXACT export options that might be used to save 
>> a wavefront file that's able to be successfully imported to Pychrono?
>>
>> #----------------------------------------------------
>> import pychrono as chrono
>>
>> try:
>>     mesh = chrono.ChTriangleMeshConnected()
>>     success = 
>> mesh.LoadWavefrontMesh(chrono.etChronoDataFile('models/bulldozer/shoe_view.obj'))
>>  
>> #OK!
>>
>>     if not success:
>>         print("Try 1 (native Wavefront)=>Error loading mesh!")
>>
>> except Exception as e:
>>     print("An error occurred: ", e)
>>
>> try:
>>     mesh = chrono.ChTriangleMeshConnected()
>>     success = 
>> mesh.LoadWavefrontMesh(chrono.etChronoDataFile('models/RE-EXPORT/shoe_view_out.obj'))
>>  
>> #FAIL!
>>
>>     if not success:
>>         print("Try 2 (Wavefront imported into MeshLab and 
>> re-exported)=>Error loading mesh!")
>>
>> except Exception as e:
>>     print("An error occurred: ", e)
>> #----------------------------------------------------
>> Code output looks like this:    
>>
>> Error loading OBJ file ...path2file...
>> tiny_obj warning message:
>> tiny_obj error message:  Cannot open file ...path2file...
>>
>> Try 2 (Wavefront imported into MeshLab and re-exported)=>Error loading 
>> mesh!
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/372bf6ab-5fbb-4215-bb79-f77bc67114d5n%40googlegroups.com.

Reply via email to