Govern task context and advance execution pointer
This commit is contained in:
23
tools/web/generate-freestyle-fixture.py
Normal file
23
tools/web/generate-freestyle-fixture.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import bpy
|
||||
|
||||
def main(output):
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
style = bpy.data.linestyles.new("WebGapLineStyle")
|
||||
style.color = (0.2, 0.4, 0.8)
|
||||
style.alpha = 0.75
|
||||
style.thickness = 2.5
|
||||
style.use_chaining = True
|
||||
style.use_dashed_line = True
|
||||
scene = bpy.context.scene
|
||||
scene.render.engine = "BLENDER_WORKBENCH"
|
||||
scene.render.use_freestyle = True
|
||||
line_set = scene.view_layers[0].freestyle_settings.linesets.new("WebGapLineSet")
|
||||
line_set.linestyle = style
|
||||
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-freestyle-fixture.py -- OUTPUT")
|
||||
main(args[0])
|
||||
Reference in New Issue
Block a user