vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
467 stars 75 forks source link

SaveAsWavefront fails with spaces in path #70

Closed talanc closed 3 years ago

talanc commented 3 years ago

I'm trying to call SaveAsWavefront with a directory which has spaces in it but it throw an exception. https://github.com/vpenades/SharpGLTF/blob/e5557766242542eb02a2632f05e412d2f1a35007/src/SharpGLTF.Toolkit/Schema2/MeshExtensions.cs#L746 https://github.com/vpenades/SharpGLTF/blob/e5557766242542eb02a2632f05e412d2f1a35007/src/SharpGLTF.Toolkit/Schema2/MeshExtensions.cs#L757

I'm guessing it's a restriction where OBJ files cannot have spaces in the filename. But should that restriction apply to the full path? For example: C:\Dir1\Dir Two\mesh.obj

If yes, then close the issue.

If not, then change the code to only check for spaces on the filename portion of the path. I'm able to make the changes and submit a PR if you're keen.

vpenades commented 3 years ago

You're right, it should apply only to the filename only. I'll fix it ASAP