Skip to content

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

@tim-depthkit

Description

@tim-depthkit

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions