-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The skeletool command for model generation placed model flags before default flags. Normally this isn't a problem, but v_portalgun.flags overrides the default scene scale by specifying the same argument again with a different value. Since its arguments were not last in the command, the scale was not overridden and its animations were incorrect. Fixed by refactoring the convert_asset script into a more general run_command script, which supports the required functionality of reading arguments from a file while also allowing the caller to choose their position relative to other arguments.
- Loading branch information
Showing
6 changed files
with
45 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import subprocess | ||
import shlex | ||
import sys | ||
|
||
# Arguments to commands for converting assets are stored in text files | ||
# | ||
# This helper script allows calling the commands with the arguments from | ||
# such files in a cross-platform way. | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) < 2: | ||
print("Runs a specified command with the given arguments") | ||
print("Arguments prefixed with '@' are read as files containing arguments") | ||
print() | ||
print(f"Usage: {sys.argv[0]} COMMAND [ARG]...") | ||
sys.exit(1) | ||
|
||
command, *args = sys.argv[1:] | ||
parsed_args = [] | ||
|
||
for arg in args: | ||
if arg.startswith('@'): | ||
with open(arg[1:]) as f: | ||
parsed_args += shlex.split(f.read().strip()) | ||
else: | ||
parsed_args.append(arg) | ||
|
||
rc = subprocess.run([ | ||
command, | ||
*parsed_args | ||
]) | ||
sys.exit(rc.returncode) |