Commit 08c50af9 authored by Adam Štěpánek's avatar Adam Štěpánek
Browse files

Add the box layout and a bunch of other stuff

Blender! Fucking finally.
parent be7af7e6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@
!*.js
!*.css
!*.ts
!*.blend
!*.py

# configs are a bit of a special case, yes
!/config/*
+1 −0
Original line number Diff line number Diff line
@@ -77,4 +77,5 @@ COPY config/Xresources /root/.Xresources
# add sources
COPY scripts /scripts
COPY sketches /sketches
COPY blends /blends
RUN chmod +x /scripts/hash.sh /scripts/testbase.sh && ln -st / /scripts/hash.sh

blends/box/box.blend

0 → 100644
+1.11 MiB

File added.

No diff preview for this file type.

blends/box/box.py

0 → 100644
+19 −0
Original line number Diff line number Diff line
import bpy
import math
import os

painting = os.environ["PAINTING"]
out = os.environ["OUT"]
width = float(os.environ["WIDTH"])
height = float(os.environ["HEIGHT"])

bpy.data.objects["Camera"].location.x *= math.sqrt(width / height)

image = bpy.data.images.load(filepath=painting)
canvas = bpy.data.objects["Canvas"]
canvas.material_slots[0].material.node_tree.nodes["Image Texture"].image = image

bpy.data.scenes["Scene"].render.filepath = out
bpy.data.scenes["Scene"].render.resolution_x = width
bpy.data.scenes["Scene"].render.resolution_y = height
bpy.ops.render.render(write_still=True)
+9 −0
Original line number Diff line number Diff line
#!/bin/bash

source /scripts/preamble.sh

run() {
    peffect "dots"
    runim png -size 10x10 xc: -draw 'circle 5,5 1,3' -channel RGB -negate -write mpr:spot +delete \
        $1 -size ${WIDTH}x${HEIGHT} tile:mpr:spot +swap -compose multiply -composite
}
Loading