kevinzakka / obj2mjcf

A CLI for processing composite Wavefront OBJ files for use in MuJoCo.
MIT License
164 stars 18 forks source link

Incompatibility with Python 3.7 #4

Closed saeejithnair closed 2 years ago

saeejithnair commented 2 years ago

Hey, thanks for making this tool! Not a big deal, but one of the function calls isn't compatible with Python 3.7 and requires 3.8+

Steps to reproduce: Running obj2mjcf --obj-dir meshes/ --verbose --vhacd-args.enable, results in the following error:

Processing meshes/model.obj
INFO:root:Saving processed meshes to meshes/model
INFO:root:Decomposing /home/smnair/work/nutrition/Room_Essentials_Kitchen_Towels_16_x_26_2_count/meshes/model.obj
Traceback (most recent call last):
  File "/home/smnair/anaconda3/envs/nutrition/bin/obj2mjcf", line 8, in <module>
    sys.exit(main())
  File "/home/smnair/anaconda3/envs/nutrition/lib/python3.7/site-packages/obj2mjcf/_cli.py", line 508, in main
    process_obj(obj_file, args)
  File "/home/smnair/anaconda3/envs/nutrition/lib/python3.7/site-packages/obj2mjcf/_cli.py", line 239, in process_obj
    decomp_success = decompose_convex(filename, work_dir, args.vhacd_args)
  File "/home/smnair/anaconda3/envs/nutrition/lib/python3.7/site-packages/obj2mjcf/_cli.py", line 208, in decompose_convex
    file_to_delete.unlink(missing_ok=True)
TypeError: unlink() got an unexpected keyword argument 'missing_ok'

Based on this Stackoverflow post, it looks like the missing_ok parameter was only added to Pathlib in Python 3.8.

kevinzakka commented 2 years ago

Oh wow, nice catch! This is the price I pay for no unit tests 😅 I'll patch it up asap!

kevinzakka commented 2 years ago

OK should now be fixed via #5! Do let me know if you run into any more issues, appreciate it!

saeejithnair commented 2 years ago

Awesome, thanks for the fix, plus for adding lxml to the dependencies!