Commit: 6514033f74a7fa20dd6f43ce72e1250328a7e81b
Author: Jeroen Bakker
Date:   Wed Dec 16 12:04:23 2020 +0100
Branches: shot-tools-development
https://developer.blender.org/rB6514033f74a7fa20dd6f43ce72e1250328a7e81b

Added an example configuration

Initial example configuration was extracted from the design. It will be
updated so the API can be discussed with TDs.

===================================================================

A       shot-builder/docs/examples/shot-builder/characters.py
A       shot-builder/docs/examples/shot-builder/config.py
A       shot-builder/docs/examples/shot-builder/hooks.py
A       shot-builder/docs/examples/shot-builder/shots.py

===================================================================

diff --git a/shot-builder/docs/examples/shot-builder/characters.py 
b/shot-builder/docs/examples/shot-builder/characters.py
new file mode 100644
index 00000000000..f34fe6998ed
--- /dev/null
+++ b/shot-builder/docs/examples/shot-builder/characters.py
@@ -0,0 +1,17 @@
+class Asset(shot_builder.some_module.Asset):
+    asset_file = "/{asset_type}/{name}/{name}.blend"
+    collection = "{class_name}"
+    name = "{class_name}"
+
+
+class Character(Asset):
+    asset_type = 'char'
+
+
+class Ellie(Character):
+    collection = "{class_name}-{variant_name}"
+    variants = {'default', 'short_hair'}
+
+
+class Victoria(Character): pass
+class Rex(Character): pass
diff --git a/shot-builder/docs/examples/shot-builder/config.py 
b/shot-builder/docs/examples/shot-builder/config.py
new file mode 100644
index 00000000000..491bda75aec
--- /dev/null
+++ b/shot-builder/docs/examples/shot-builder/config.py
@@ -0,0 +1,17 @@
+PRODUCTION_NAME = "Sprite Fright"
+
+"""
+    A set of files to read the configuration from.
+"""
+CONFIGURATION_FILES = {
+    "hooks.py"
+    "characters.py",
+    "shots.py"
+}
+
+TASK_TYPES = {
+    'anim',
+    'lighting',
+}
+
+TASK_FILE_NAME = "shots/{shot_id}/{shot_id}.{task_type}.blend"
\ No newline at end of file
diff --git a/shot-builder/docs/examples/shot-builder/hooks.py 
b/shot-builder/docs/examples/shot-builder/hooks.py
new file mode 100644
index 00000000000..6f77aba58d2
--- /dev/null
+++ b/shot-builder/docs/examples/shot-builder/hooks.py
@@ -0,0 +1,25 @@
+@shot_builder.production_settings_hook
+def spring_production_settings(scene: bpy.types.Scene, **kwargs: dict) -> None:
+    """
+    This is an example for a `production_settings_hook`. A production
+    hook contains global configuration that is applied to a shot as first.
+
+    A production can only have a single `production_settings_hook`. When
+    multiple `production_settings_hooks` are defined a configuration error
+    will be given.
+    """
+    scene.render.resolution_x = 1920
+    scene.render.resolution_y = 1080
+    scene.render.resolution_percentage = 100
+    scene.render.engine = 'CYCLES'
+    scene.cycles.samples = 1024
+
+
+@shot_tools.hook(match_task_type='anim')
+def anim_task(scene: bpy.types.Scene, **kwargs: dict) -> None:
+    """
+    This hook is called when animation task file is built.
+
+    Task specific overrides to scene settings can be done.
+    """
+    scene.render.engine = 'WORKBENCH'
diff --git a/shot-builder/docs/examples/shot-builder/shots.py 
b/shot-builder/docs/examples/shot-builder/shots.py
new file mode 100644
index 00000000000..89c103f7b0d
--- /dev/null
+++ b/shot-builder/docs/examples/shot-builder/shots.py
@@ -0,0 +1,21 @@
+class Shot_01_020_A(shot_builder.some_module.Shot):
+    shot_id = '01_020_A'
+    assets = {
+        characters.Ellie(variant=”short_hair”, location=(0.0, 0.0, 0.0)),
+        characters.Rex,
+        sets.LogOverChasm,
+    }
+
+
+class AllHumansShot(shot_builder.some_module.Shot):
+    assets = {
+        characters.Ellie(variant=”short_hair”),
+        characters.Rex,
+        characters.Victoria,
+    }
+
+
+class Shot_01_035_A(AllHumansShot):
+    assets = {
+        sets.Camp,
+    }
\ No newline at end of file

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to