H2xDev / GodotVMF

A VMF importer for Godot Engine/Redot Engine
MIT License
142 stars 7 forks source link

mdl2obj Linux and macOS support #15

Closed PeachIceTea closed 8 months ago

PeachIceTea commented 8 months ago

Currently the code for mdl2obj is shipped as a Windows executable mdl2obj.exe.

I suppose it makes sense to not ask users on Windows to go install Node.js. For better support of Linux and macOS I would advocate to ship the raw Javascript and ask those users to simply install Node.

I would be happy to create a Pull Request with those changes if you think that is good enough of a solution.

As a side note the mdl2obj repo seems to be missing the source-mdl source code that is required to make it work.

H2xDev commented 8 months ago

Hello! @PeachIceTea

As a side note the mdl2obj repo seems to be missing the source-mdl source code that is required to make it work.

Thank you for notice. I updated dependencies and also added build instructions for macOS and Linux users, but didn't test it. Would be good if you test it.

PeachIceTea commented 8 months ago

The new version does build and run under Linux. Can't test Mac right now, but I believe its safe to assume that pkg for Mac will work as well.

Personally I think I would prefer having source files and using my distros version of Node, but I understand the advantages of shipping something that will just work.

Lachrymogenic commented 8 months ago

Linux user here, Ubuntu 20.04.6 LTS x86_64. mdl2obj compiles just fine, but doesn't run without source-mdl source code. Trying to make it work right now.

PeachIceTea commented 8 months ago

@Lachrymogenic there is a new commit in the mdl2obj repo that fixes that issue. Just run npm i after pulling the newest commit and then npm run build:linux should work.

Lachrymogenic commented 8 months ago

Seems to be some sort of issue with your code, too. wouldnt run unless I converted const [,, input, output] = process.argv; to var [,, input, output] = process.argv; due to an Assignment type error, where I believe output = output || input.replace('.mdl', '.obj'); was writing to a constant.

Seems to work completely fine after changing that one line now. Imports into blender just fine.

H2xDev commented 8 months ago

Seems to work completely fine after changing that one line now. Imports into blender just fine.

I little bit rushed during fix, yes :D Fixed.