Govern task context and advance execution pointer
This commit is contained in:
21
tools/web/generate-camera-fixture.py
Normal file
21
tools/web/generate-camera-fixture.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import bpy
|
||||
|
||||
def main(output):
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
camera = bpy.data.cameras.new("WebGapCamera")
|
||||
camera.lens = 52.0
|
||||
camera.clip_start = 0.1
|
||||
camera.clip_end = 2500.0
|
||||
camera.sensor_width = 36.0
|
||||
camera.type = "PERSP"
|
||||
object_ = bpy.data.objects.new("WebGapCameraObject", camera)
|
||||
bpy.context.collection.objects.link(object_)
|
||||
object_.location = (1.0, -2.0, 3.0)
|
||||
bpy.ops.wm.save_as_mainfile(filepath=output, compress=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = sys.argv[sys.argv.index("--") + 1:]
|
||||
if len(args) != 1: raise SystemExit("usage: blender -b --python generate-camera-fixture.py -- OUTPUT")
|
||||
main(args[0])
|
||||
Reference in New Issue
Block a user