Created
February 27, 2024 13:53
-
-
Save mishazawa/0b48409afdb10aeda56ece4d1a265042 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Usage: | |
| # python3 convert_base64_to_fbx.py ./out.fbx ./base64_file | |
| import io | |
| import base64 | |
| import sys | |
| BASE_CONTENT = sys.argv[2] | |
| OUT_FILE_PATH = sys.argv[1] | |
| if __name__ == "__main__": | |
| with open(BASE_CONTENT, 'r') as in_file: | |
| str_content = in_file.read() | |
| with open(OUT_FILE_PATH, 'wb') as out_file: | |
| data = io.BytesIO(base64.decodebytes(str_content.encode('ascii'))) | |
| out_file.write(data.read()) |
This file contains hidden or 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
| # Usage: | |
| # python3 convert_fbx_to_base64.py ./in.fbx > ./base64_file | |
| import sys, base64 | |
| def main(): | |
| with open(sys.argv[1], 'rb') as f: | |
| content = (base64.b64encode(f.read())).decode('ascii') | |
| print(content) | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment