28 lines
738 B
Python
28 lines
738 B
Python
#!/usr/bin/env python3
|
|
import pathlib
|
|
import sys
|
|
|
|
import bpy
|
|
|
|
|
|
IMAGE_NAME = "WebGapAssetDownloadImage"
|
|
IMAGE_PATH = "//assets/WebGapAssetDownload.png"
|
|
|
|
|
|
def main():
|
|
arguments = sys.argv[sys.argv.index("--") + 1 :]
|
|
if len(arguments) != 1:
|
|
raise SystemExit("usage: blender -b --factory-startup --python M16-GAP-00264.py -- OUTPUT")
|
|
bpy.ops.wm.read_factory_settings(use_empty=True)
|
|
image = bpy.data.images.new(IMAGE_NAME, width=1, height=1, alpha=True)
|
|
image.filepath = IMAGE_PATH
|
|
image.source = "FILE"
|
|
image.use_fake_user = True
|
|
bpy.ops.wm.save_as_mainfile(
|
|
filepath=str(pathlib.Path(arguments[0]).resolve()), check_existing=False, compress=True
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|