facebookincubator / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
2.1k stars 332 forks source link

Output Directory Issues on Windows #109

Closed tylocook closed 5 years ago

tylocook commented 6 years ago

While running the Windows binary, I've run into some odd behavior surrounding the -o flag.

In my case, I am running the commandline as Administrator for sanity's sake. I also made sure the delete any folders/files created between running commands, so consider all output folders as non-existent before running the tool.

Here are the calls to the binary and results:

-o path with backslashes on my C:

FBX2glTF-windows-x64.exe -o "C:\u000790410058_hr" -i "E:\EDrive\Products_10k\u000790410058\u000790410058_hr.fbx"

ERROR:: Couldn't open file for writing: C:\u000790410058_hr_out/u000790410058_hr.gltf

-o path with forwardslashes on my C:

FBX2glTF-windows-x64.exe -o "C:/u000790410058_hr" -i "E:\EDrive\Products_10k\u000790410058\u000790410058_hr.fbx"

Warning: animation 'Take 001' has zero channels. Skipping.
Wrote 4261 bytes of glTF to C:/u000790410058_hr_out/u000790410058_hr.gltf.
Wrote 9864 bytes of binary data to C:/u000790410058_hr_out/buffer.bin.

I also have a D drive that mirrors the same behavior as the C drive above.

-o path with backslashes on my E:

FBX2glTF-windows-x64.exe -o "E:\u000790410058_hr" -i "E:\EDrive\Products_10k\u000790410058\u000790410058_hr.fbx"  

ERROR: Failed to create folder: E:\u000790410058_hr_out/'

-o path with forwardslashes on my E:

FBX2glTF-windows-x64.exe -o "E:/u000790410058_hr" -i "E:\EDrive\Products_10k\u000790410058\u000790410058_hr.fbx"

ERROR: Failed to create folder: E:/u000790410058_hr_out/'

In summary, for some reason, this program has no problem creating an output folder on my C drive, but cannot create the files inside of that output folder properly when using backslashes. This problem does not exist when using forwardslashes.

With my E drive, however, it's unable to create an output folder no matter which style of slash I use. This one is truly a mystery to me.

As a side note, attempting to escape the backslash by using \\ did not help.

zellski commented 6 years ago

Thank you for the detailed bug report. I have to be upfront about my near-complete unfamiliarity with Windows-specific programming. I can't usefully guess how D: and E: differ in your system to make for such different behaviour...

That said, I can at least investigate and see if anything obvious falls out. And if you happen to know any strong Windows developers that are looking to help out with an open source project... :-)

tylocook commented 6 years ago

I wish I could help myself, but C++ is not my strong suit. It's been 10+ years for me.

There are perhaps multiple bugs going on here, so let's focus on one.

My immediate thought on why the forwardslash and backslash problem is happening for all drives (it's a problem happening on C and D drives as well) is that it looks like you may be hard coding UNIX paths.

For example, when I specify C:\u000790410058_hr_out as my output directory, it succeeds in creating the directory, but gives an error when trying to create the file.

ERROR:: Couldn't open file for writing: C:\u000790410058_hr_out/u000790410058_hr.gltf

See the forward slash just after C:\u000790410058_hr_out ?

So, a good place to start would be to use backslashes for all paths on Windows and forwardslashes for all paths on UNIX.

zellski commented 5 years ago

@tylocook Are you by any chance able to give this a whirl, with a recent pull & build from master? There's been quite a few bug fixes in the file/path handling.

zellski commented 5 years ago

This should've been all fixed when we moved to boost::filesystem.

harrypatrick442 commented 3 years ago

I dont even get a file output. I get a couple of warnings but no errors. This is all but useless. Sigh.