Skip to content

Commit a89db99

Browse files
committed
Build patches from several shapes and lighting conditions
A patch is now a grid rather than two fixed tiles: the shapes ticked in the Patch panel run across it, the lighting conditions ticked there run down it, and the whole thing is one image per material in materials/ as before. Shapes - Flat swatch, sphere, cube and cylinder, ticked individually; the default pair reproduces the patch earlier versions rendered - The solids are built to sit inside one bounding sphere and share one three-quarter camera, so each fills as much of its tile as its own form allows and the texture reads at one scale across a row. Framing solves asin(r/d) against the sphere, not the tangent against a bounding box, which left the subject at a fifth of its tile - The cylinder lies on its side. Upright, every wall normal is horizontal while a preset's lights are all above, so the lower half turned away from all of them at once and the base went black - Only the flat swatch takes the straight-on orthographic camera, so one repeat fills its tile exactly Lighting conditions - Taken from the lighting presets the Stage panel uses, built-in and saved, ticked in a list of their own and refreshed on demand. Switching to the Patches part fills the list, so it is never stale from another file or machine - No Lights is left out: a patch scene has no HDRI and the swatch would come out black. With nothing ticked, one row under a built-in studio rig - Presets are stored relative to the subject's size, so they rebuild around a patch shape unchanged: a swatch under Studio Soft is lit the way a product at a Target Size of 1.0 is - Pre-flight warns when a ticked preset can no longer be read, which would otherwise drop a row without saying so Grid - Column headings, row labels and the material's name, drawn with the same blf path the contact sheets use, and switchable off - Tiles render on transparent film and composite onto the grid's white background - Tile Size is now the size of one tile rather than of one half Variants - The Patch panel is gone from the Variants part, which is about textures on products. A job file can still set pool_patches for a run that wants both Tests - test_parts.py covers the shape meshes, which camera each asks for, the lighting list and its ticks surviving a refresh, grid growth in both axes, and how much of its tile each shape fills - test_materials.py reads tiles at computed offsets with labels off, rather than splitting the image in half
1 parent da88e1e commit a89db99

4 files changed

Lines changed: 644 additions & 120 deletions

File tree

‎README.md‎

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ control while rendering swatches.
2626
| Part | What it writes | About |
2727
| --- | --- | --- |
2828
| **Clay** | Every product from every view, as clay: `AA_01_Widget_Front_clay.png` | Form |
29-
| **Patches** | One image per pool material: a flat swatch beside a lit ball, in `materials/` | CMF |
29+
| **Patches** | One image per pool material: a grid of the material on each ticked shape, under each ticked lighting condition, in `materials/` | CMF |
3030
| **Variants** | Every product from every view, several times over, each in a different draw of textures: `AA_01_Widget_Front_v01.png` | CMF × Form |
3131

3232
Each part needs a different half of the tool, which is what the switcher is for:
@@ -484,21 +484,58 @@ The pool's contents are recorded in the manifest's provenance block.
484484

485485
**Material patches.** Switch the **Part** to **Patches** and press **Render Material
486486
Patches** to write one image per ticked material into `materials/` in the output folder.
487-
Each shows a flat swatch, one repeat seen straight on, next to a ball under studio lights,
488-
with the material's name above. **Patch Size** is the pixel size of each half.
487+
Each image is a grid: the **shapes** you ticked across it, the **lighting conditions** you
488+
ticked down it.
489+
490+
```
491+
Flat Sphere Cube
492+
Studio Soft [ tile ] [ tile ] [ tile ]
493+
Studio Hard [ tile ] [ tile ] [ tile ]
494+
Dramatic [ tile ] [ tile ] [ tile ]
495+
```
496+
497+
Three shapes and three lighting conditions is nine tiles in one file per material. **Tile
498+
Size** is the pixel size of one tile, and **Labels** prints the material's name across the
499+
top, the shape names along it and the lighting names down the side.
500+
501+
| Shape | What it shows |
502+
| --- | --- |
503+
| **Flat** | One repeat of the texture seen straight on, filling the tile: colour and pattern scale as authored. Orthographic, so there is no perspective to read around |
504+
| **Sphere** | Continuous curvature, one highlight, and the falloff to the terminator |
505+
| **Cube** | Three faces at once, so the box projection's seams show honestly rather than being hidden by a curve |
506+
| **Cylinder** | A sweep in one axis only, which is what most machined parts are |
507+
508+
The solid shapes are all built to sit inside one sphere and share one three-quarter camera,
509+
so a shape fills as much of its tile as its own form allows and the texture reads at the same
510+
scale right across a row. The flat swatch gets a straight-on orthographic camera of its own.
511+
512+
**Lighting conditions** are the same presets the **Stage** panel uses — the built-in four,
513+
plus any you saved there with **+**. Tick as many as you want; each becomes a row. The
514+
refresh button beside the list picks up presets you have saved since. *No Lights* is left
515+
out, since a patch scene has no HDRI and the swatch would come out black. With nothing
516+
ticked, one row is rendered under a built-in studio rig.
517+
518+
A preset stores its positions and sizes as multiples of the subject's size, so it rebuilds
519+
around a patch shape with no extra work — which means **a swatch under Studio Soft is lit
520+
the way a product scaled to a Target Size of `1.0` is lit under Studio Soft**. The same
521+
**Intensity** applies. That is what makes a patch worth comparing against a render.
489522

490523
Patches go through the same job queue as every other output, so they get the progress bar,
491524
the time left, Esc, Skip Existing and manifest rows of their own (`kind` is `patch`).
492525

493-
In the **Variants** part, **Render patches too** adds them to a variants run, so a texture
494-
dataset can ship its swatches beside its renders. In a sharded command-line run the first
495-
shard makes them, and rendering just the active product skips them.
526+
Patches render in a scene of their own with the scene's colour management, on transparent
527+
film composited onto the grid's white background, and the pool materials are deleted again
528+
after each run, so your scene is untouched. They use Cycles when your engine is Workbench,
529+
which cannot show textures — pre-flight stops the run if the Cycles add-on is switched off
530+
and the engine is Workbench, since there would be nothing to stand in with.
531+
532+
Patches belong to the **Patches** part only; the Variants part is about textures on
533+
products. A command-line job can still set `pool_patches` to get both from one run, which is
534+
what a sharded dataset build wants:
496535

497-
Patches render in a scene of their own with the scene's colour management, and the pool
498-
materials are deleted again after each run, so your scene is untouched. They use Cycles when
499-
your engine is Workbench, which cannot show textures — pre-flight stops the run if the
500-
Cycles add-on is switched off and the engine is Workbench, since there would be nothing to
501-
stand in with.
536+
```json
537+
{ "settings": { "part": "VARIANTS", "pool_variants": 8, "pool_patches": true } }
538+
```
502539

503540
### 6. Output
504541

@@ -559,6 +596,7 @@ uses none of them.
559596
| Error | AO pass on, but the Cycles add-on is off | |
560597
| Error | The texture pool is empty, or textures it uses have moved | |
561598
| Error | Patches with Workbench as the engine and the Cycles add-on off, so nothing can stand in for it | |
599+
| Warning | A ticked patch lighting condition whose saved preset can no longer be read, so that row is skipped | |
562600
| Warning | Output folder is `//` relative but the `.blend` was never saved, so `//` points nowhere useful | Save the file |
563601
| Warning | Output folder does not exist yet | Create it |
564602
| Warning | Cameras are out of date (Reframe off): a product was turned, scaled or added, or the views, padding or resolution changed since Build Cameras | Rebuild cameras |

0 commit comments

Comments
 (0)