Skip to content

Commit

Permalink
More Automation
Browse files Browse the repository at this point in the history
* Blender scenes automatically render to files.
* Standardised image file names mean the build process after rendering can be fully automated.
  • Loading branch information
billhails committed Sep 19, 2021
1 parent 59064b2 commit 9c7bc7e
Show file tree
Hide file tree
Showing 205 changed files with 136 additions and 141 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules
package-lock.json
*.blend[0-9]*
themes/
tmp/
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ $(THEMEDIRS): %: FORCE
$(MAKE) -C $@

# easier when publishing a release to have everything in one place
copy: all
for dir in $(THEMEDIRS) ; do cp $$dir/*.sabakitheme.asar . ; done
copy: all | themes
for dir in $(THEMEDIRS) ; do cp $$dir/*.sabakitheme.asar ./themes ; done

themes:
mkdir themes
# vim: noet sw=8
28 changes: 26 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# common makefile fragment included by all of the individual theme Makefiles
# operates in the context of those theme directories
#
# ./tmp is ignored by .gitignore, and blender is configured to render into there

ASAR="^0.13.0"

MAKE_SEAMLESS=../blender/make-seamless

LIGHT_STONES=$(patsubst %-0001.png,theme/images/%.png,$(notdir $(wildcard tmp/Light*-0001.png)))
DARK_STONES=$(patsubst %-0001.png,theme/images/%.png,$(notdir $(wildcard tmp/Dark*-0001.png)))
SEAMLESS_IMAGES=theme/images/Board.png theme/images/Background.png
IMAGES=$(LIGHT_STONES) $(DARK_STONES) $(SEAMLESS_IMAGES)

all: ${NAME}.sabakitheme.asar
all: ${NAME}.sabakitheme.asar package.json

${NAME}.sabakitheme.asar: theme/package.json
asar pack ./theme $@
Expand All @@ -12,9 +23,22 @@ ${NAME}.sabakitheme.asar: theme/package.json
# into the single theme/package.json
#
# https://stedolan.github.io/jq/
theme/package.json: theme.package.json version.json ../common.package.json theme/styles.css theme/images/*.png
theme/package.json: theme.package.json version.json ../common.package.json theme/styles.css $(IMAGES)
jq '{major, minor, patch: (.patch + 1)}' version.json > version.json.tmp
mv version.json.tmp version.json
jq -s '.[0] * {version: "\(.[1].major).\(.[1].minor).\(.[1].patch)"} * .[2]' theme.package.json version.json ../common.package.json > $@

# maintain a package.json for anyone without make
package.json: ../Makefile.common ../package.jq
jq --null-input --arg name ${NAME} --arg asar ${ASAR} --from-file ../package.jq > $@

# copy stones directly from ./tmp to ./theme/images
$(DARK_STONES) $(LIGHT_STONES): theme/images/%.png: tmp/%-0001.png
cp $< $@

# images that need to be seamless require an extra step after copying
$(SEAMLESS_IMAGES): theme/images/%.png: tmp/%-0001.png
cp $< $@
$(MAKE_SEAMLESS) $@

# vim: noet sw=8
Binary file modified agate/theme/images/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed agate/theme/images/Black.png
Binary file not shown.
Binary file modified agate/theme/images/Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added agate/theme/images/Dark0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added agate/theme/images/Light0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed agate/theme/images/White.png
Binary file not shown.
2 changes: 1 addition & 1 deletion agate/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Agate",
"description": "A theme with agate stones for Sabaki",
"version": "1.0.4",
"version": "1.0.7",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
4 changes: 2 additions & 2 deletions agate/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/Black.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/White.png');
background-image: url('images/Light0.png');
}

.shudan-vertex.shudan-sign_1 .shudan-shadow {
Expand Down
2 changes: 1 addition & 1 deletion agate/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 4
"patch": 7
}
Binary file added antique-hard/theme/images/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed antique-hard/theme/images/BambooBoard.png
Binary file not shown.
Binary file added antique-hard/theme/images/Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed antique-hard/theme/images/Carpet.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion antique-hard/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Antique (hard light)",
"description": "A theme with antique single-convex yunzi stones for Sabaki",
"version": "1.0.7",
"version": "1.0.10",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
8 changes: 4 additions & 4 deletions antique-hard/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

.shudan-goban-image {
/* Board texture */
background-image: url('images/BambooBoard.png');
background-image: url('images/Board.png');
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/GreenStone.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/YellowStone.png');
background-image: url('images/Light0.png');
}

.shudan-vertex.shudan-sign_-1 .shudan-shadow {
Expand All @@ -41,5 +41,5 @@ rect.shudan-gridline.shudan-horizontal, rect.shudan-gridline.shudan-vertical {
}

main {
background: #f0f0f0 url('images/Carpet.png') left top;
background: #f0f0f0 url('images/Background.png') left top;
}
2 changes: 1 addition & 1 deletion antique-hard/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 7
"patch": 10
}
Binary file added antique/theme/images/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed antique/theme/images/BambooBoard.png
Binary file not shown.
Binary file added antique/theme/images/Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed antique/theme/images/Carpet.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion antique/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Antique (Soft Light)",
"description": "A theme with antique single-convex yunzi stones for Sabaki",
"version": "1.0.7",
"version": "1.0.10",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
8 changes: 4 additions & 4 deletions antique/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

.shudan-goban-image {
/* Board texture */
background-image: url('images/BambooBoard.png');
background-image: url('images/Board.png');
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/GreenStone.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/YellowStone.png');
background-image: url('images/Light0.png');
}

.shudan-vertex.shudan-sign_-1 .shudan-shadow {
Expand All @@ -41,5 +41,5 @@ rect.shudan-gridline.shudan-horizontal, rect.shudan-gridline.shudan-vertical {
}

main {
background: #f0f0f0 url('images/Carpet.png') left top;
background: #f0f0f0 url('images/Background.png') left top;
}
2 changes: 1 addition & 1 deletion antique/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 7
"patch": 10
}
Binary file added basic/theme/images/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed basic/theme/images/BlackStone.png
Binary file not shown.
Binary file modified basic/theme/images/Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed basic/theme/images/Carpet.png
Binary file not shown.
Binary file added basic/theme/images/Dark0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added basic/theme/images/Light0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed basic/theme/images/WhiteStone.png
Binary file not shown.
2 changes: 1 addition & 1 deletion basic/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Basic",
"description": "A basic theme with glass stones and a beechwood board for Sabaki",
"version": "1.0.5",
"version": "1.0.8",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
6 changes: 3 additions & 3 deletions basic/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/BlackStone.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/WhiteStone.png');
background-image: url('images/Light0.png');
}

/* The default dark grey background was producing noticeable
Expand Down Expand Up @@ -48,4 +48,4 @@ rect.shudan-gridline.shudan-horizontal, rect.shudan-gridline.shudan-vertical {
}


main {background: #f0f0f0 url('images/Carpet.png') left top;}
main {background: #f0f0f0 url('images/Background.png') left top;}
2 changes: 1 addition & 1 deletion basic/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 5
"patch": 8
}
Binary file removed bathroom/theme/images/AventurineStone0.png
Diff not rendered.
Binary file removed bathroom/theme/images/AventurineStone1.png
Diff not rendered.
Binary file removed bathroom/theme/images/AventurineStone2.png
Diff not rendered.
Binary file removed bathroom/theme/images/AventurineStone3.png
Diff not rendered.
Binary file removed bathroom/theme/images/AventurineStone4.png
Diff not rendered.
Binary file added bathroom/theme/images/Background.png
Binary file added bathroom/theme/images/Board.png
Binary file added bathroom/theme/images/Dark0.png
Binary file added bathroom/theme/images/Dark1.png
Binary file added bathroom/theme/images/Dark2.png
Binary file added bathroom/theme/images/Dark3.png
Binary file added bathroom/theme/images/Dark4.png
Binary file added bathroom/theme/images/Light0.png
Binary file added bathroom/theme/images/Light1.png
Binary file added bathroom/theme/images/Light2.png
Binary file added bathroom/theme/images/Light3.png
Binary file added bathroom/theme/images/Light4.png
Binary file removed bathroom/theme/images/MahoganyStone0.png
Diff not rendered.
Binary file removed bathroom/theme/images/MahoganyStone1.png
Diff not rendered.
Binary file removed bathroom/theme/images/MahoganyStone2.png
Diff not rendered.
Binary file removed bathroom/theme/images/MahoganyStone3.png
Diff not rendered.
Binary file removed bathroom/theme/images/MahoganyStone4.png
Diff not rendered.
Binary file removed bathroom/theme/images/MarbleBoard.png
Diff not rendered.
Binary file removed bathroom/theme/images/TiledFloor.png
Diff not rendered.
2 changes: 1 addition & 1 deletion bathroom/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Trump's Bathroom",
"description": "A theme with semi-precious stones and a marble board for Sabaki",
"version": "1.0.7",
"version": "1.0.10",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
24 changes: 12 additions & 12 deletions bathroom/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,47 @@

.shudan-goban-image {
/* Board texture */
background-image: url('images/MarbleBoard.png');
background-image: url('images/Board.png');
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/MahoganyStone0.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_1.shudan-random_1 {
background-image: url('images/MahoganyStone1.png');
background-image: url('images/Dark1.png');
}

.shudan-stone-image.shudan-sign_1.shudan-random_2 {
background-image: url('images/MahoganyStone2.png');
background-image: url('images/Dark2.png');
}

.shudan-stone-image.shudan-sign_1.shudan-random_3 {
background-image: url('images/MahoganyStone3.png');
background-image: url('images/Dark3.png');
}

.shudan-stone-image.shudan-sign_1.shudan-random_4 {
background-image: url('images/MahoganyStone4.png');
background-image: url('images/Dark4.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/AventurineStone0.png');
background-image: url('images/Light0.png');
}

.shudan-stone-image.shudan-sign_-1.shudan-random_1 {
background-image: url('images/AventurineStone1.png');
background-image: url('images/Light1.png');
}

.shudan-stone-image.shudan-sign_-1.shudan-random_2 {
background-image: url('images/AventurineStone2.png');
background-image: url('images/Light2.png');
}

.shudan-stone-image.shudan-sign_-1.shudan-random_3 {
background-image: url('images/AventurineStone3.png');
background-image: url('images/Light3.png');
}

.shudan-stone-image.shudan-sign_-1.shudan-random_4 {
background-image: url('images/AventurineStone4.png');
background-image: url('images/Light4.png');
}

/* The default dark grey background was producing noticeable
Expand Down Expand Up @@ -79,4 +79,4 @@ rect.shudan-gridline.shudan-horizontal, rect.shudan-gridline.shudan-vertical {
stroke: var(--shudan-board-foreground-color);
}

main {background: #f0f0f0 url('images/TiledFloor.png') left top;}
main {background: #f0f0f0 url('images/Background.png') left top;}
2 changes: 1 addition & 1 deletion bathroom/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 7
"patch": 10
}
10 changes: 9 additions & 1 deletion blender/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ for consistent lighting. Each scene nominates its preferred camera
in its
[Scene Properties](https://docs.blender.org/manual/en/latest/scene_layout/scene/properties.html).

Each scene is rendered with a compositing phase that uses a
[File Output Node](https://docs.blender.org/manual/en/latest/compositing/types/output/file.html)
to write images directly, saving development time.

The "Preview" scenes render two stones on their board with the
prevailing lighting, in order to see how the shadows should look
when making adjustments to the css for each theme. See
Expand All @@ -57,7 +61,11 @@ shader with the mix factor determined by a
[light path](https://docs.blender.org/manual/en/latest/render/shader_nodes/input/light_path.html)
node's `Is Camera Ray` output. The upshot of this is that the board
is invisible to the camera but still causes specular and diffuse
reflections on the stones.
reflections on the stones. Each stone has a separate
[View Layer](https://docs.blender.org/manual/en/latest/render/layers/introduction.html)
(actually there is a separate view layer for each stone and all other
stones are disabled from that layer).
The compositor sends each stone image to a separate file.

### Gotchas

Expand Down
Binary file modified blender/SabakiThemes.blend
Binary file not shown.
Binary file added blender/previews/Agate-0001.jpg
Binary file added blender/previews/Antique-0001.jpg
Binary file added blender/previews/Antique-hard-0001.jpg
Binary file added blender/previews/Basic-0001.jpg
Binary file added blender/previews/Bathroom-0001.jpg
Binary file added blender/previews/Jade-0001.jpg
Binary file added blender/previews/Jade-Hard-0001.jpg
Binary file added blender/previews/Sakura-0001.jpg
Binary file added blender/previews/Shell-Slate-0001.jpg
Binary file added blender/previews/Shell-Slate-Hard-0001.jpg
Binary file modified blender/previews/SoftClamshellAndSlatePreview.png
Binary file added blender/previews/Yuki-0001.jpg
Binary file added blender/previews/Yunzi-0001.jpg
Binary file added blender/previews/Yunzi-Hard-0001.jpg
1 change: 0 additions & 1 deletion common.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
"homepage": "https://github.com/billhails/SabakiThemes",
"main": "styles.css"
}
Binary file added jade-hard/theme/images/Background.png
Binary file modified jade-hard/theme/images/Board.png
Binary file removed jade-hard/theme/images/Carpet.png
Diff not rendered.
Binary file added jade-hard/theme/images/Dark0.png
Binary file removed jade-hard/theme/images/DarkStone0.png
Diff not rendered.
Binary file removed jade-hard/theme/images/DarkStone1.png
Diff not rendered.
Binary file removed jade-hard/theme/images/DarkStone2.png
Diff not rendered.
Binary file removed jade-hard/theme/images/DarkStone3.png
Diff not rendered.
Binary file removed jade-hard/theme/images/DarkStone4.png
Diff not rendered.
Binary file added jade-hard/theme/images/Light0.png
Binary file removed jade-hard/theme/images/LightStone0.png
Diff not rendered.
Binary file removed jade-hard/theme/images/LightStone1.png
Diff not rendered.
Binary file removed jade-hard/theme/images/LightStone2.png
Diff not rendered.
Binary file removed jade-hard/theme/images/LightStone3.png
Diff not rendered.
Binary file removed jade-hard/theme/images/LightStone4.png
Diff not rendered.
2 changes: 1 addition & 1 deletion jade-hard/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Jade (hard light)",
"description": "A theme with jade stones for Sabaki",
"version": "1.0.6",
"version": "1.0.9",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
30 changes: 3 additions & 27 deletions jade-hard/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,11 @@
}

.shudan-stone-image.shudan-sign_1 {
background-image: url('images/DarkStone0.png');
}
.shudan-stone-image.shudan-sign_1.shudan-random_1 {
background-image: url('images/DarkStone1.png');
}
.shudan-stone-image.shudan-sign_1.shudan-random_2 {
background-image: url('images/DarkStone2.png');
}
.shudan-stone-image.shudan-sign_1.shudan-random_3 {
background-image: url('images/DarkStone3.png');
}
.shudan-stone-image.shudan-sign_1.shudan-random_4 {
background-image: url('images/DarkStone4.png');
background-image: url('images/Dark0.png');
}

.shudan-stone-image.shudan-sign_-1 {
background-image: url('images/LightStone0.png');
}
.shudan-stone-image.shudan-sign_-1.shudan-random_1 {
background-image: url('images/LightStone1.png');
}
.shudan-stone-image.shudan-sign_-1.shudan-random_2 {
background-image: url('images/LightStone2.png');
}
.shudan-stone-image.shudan-sign_-1.shudan-random_3 {
background-image: url('images/LightStone3.png');
}
.shudan-stone-image.shudan-sign_-1.shudan-random_4 {
background-image: url('images/LightStone4.png');
background-image: url('images/Light0.png');
}

/* The default dark grey background was producing noticeable
Expand Down Expand Up @@ -71,4 +47,4 @@ rect.shudan-gridline.shudan-horizontal, rect.shudan-gridline.shudan-vertical {
stroke: var(--shudan-board-foreground-color);
}

main {background: #f0f0f0 url('images/Carpet.png') left top;}
main {background: #f0f0f0 url('images/Background.png') left top;}
2 changes: 1 addition & 1 deletion jade-hard/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"major": 1,
"minor": 0,
"patch": 6
"patch": 9
}
Binary file added jade/theme/images/Background.png
Binary file modified jade/theme/images/Board.png
Binary file removed jade/theme/images/Carpet.png
Diff not rendered.
Binary file added jade/theme/images/Dark0.png
Binary file removed jade/theme/images/DarkStone0.png
Diff not rendered.
Binary file removed jade/theme/images/DarkStone1.png
Diff not rendered.
Binary file removed jade/theme/images/DarkStone2.png
Diff not rendered.
Binary file removed jade/theme/images/DarkStone3.png
Diff not rendered.
Binary file removed jade/theme/images/DarkStone4.png
Diff not rendered.
Binary file added jade/theme/images/Light0.png
Binary file removed jade/theme/images/LightStone0.png
Diff not rendered.
Binary file removed jade/theme/images/LightStone1.png
Diff not rendered.
Binary file removed jade/theme/images/LightStone2.png
Diff not rendered.
Binary file removed jade/theme/images/LightStone3.png
Diff not rendered.
Binary file removed jade/theme/images/LightStone4.png
Diff not rendered.
2 changes: 1 addition & 1 deletion jade/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Jade (soft light)",
"description": "A theme with jade stones for Sabaki",
"version": "1.0.2",
"version": "1.0.5",
"author": "Bill Hails",
"homepage": "https://github.com/billhails/SabakiThemes",
"license": "CC0-1.0",
Expand Down
Loading

0 comments on commit 9c7bc7e

Please sign in to comment.