Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making draco_encoder and basisu available via PATH on windows results in runtime error within Encoder.py #195

Open
tim-depthkit opened this issue Aug 21, 2023 · 0 comments
Assignees

Comments

@tim-depthkit
Copy link

Describe the bug
If I add the binary locations for draco_encoder and basisu to my PATH on windows, I get errors when Encoder.py attempts to run these executables. It looks like this is due to the shlex.split function not handling windows paths with backslashes properly.

To work around this I can of course remove these binary directories from my PATH, and add the draco_encoder and basisu paths using forward slashes directly within the project config json file, but this may not be ideal for some.

A potential fix would be to modify the check_executables function as follows to transform the backslashes into forward slashes by adding a .replace('\\', '/')

def check_executables(config):
    ok = True

    if which("draco_encoder"):
        config["draco_encoder"] = which("draco_encoder").replace('\\', '/')

    elif not config.get("draco_encoder"):
        print(
            "❌ 'draco_encoder' command doesn't exist. Please build it from https://github.com/google/draco"
        )
        ok = False

    if which("basisu"):
        config["basisu"] = which("basisu").replace('\\', '/')
    elif not config.get("basisu"):
        print(
            "❌ 'basisu' command doesn't exist. Please build it from https://github.com/BinomialLLC/basis_universal"
        )
        ok = False

    if not ok:
        exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants