Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon Studio

English | Русский

A Blender extension that renders item icons from your models: stepped cel shading, a highlight, thin inner lines, a thick outline around the silhouette, a transparent background and an exact pixel size.

Classic Comic Painted

Requires Blender 4.2 or newer (tested in 5.2).

Installation

  1. Download icon_studio-<version>.zip (or build it, see Building).
  2. Blender → Edit → Preferences → Get Extensions → the ⌄ menu in the top right → Install from Disk… → pick the zip. You can also drag the zip into the Blender window.
  3. The panel: 3D Viewport → sidebar (N) → Icon Studio tab.

Quick start

  1. Set Up Studio adds a camera and a key light to the scene (the Icon Studio collection) and switches the render settings to the ones icons need: EEVEE, transparent film, View Transform: Standard. The button is shown while the file has no studio; Preview / Render also create the studio on their own.
  2. Import a model (File → Import / Append), select all of its objects → New Item from Selection → enter the icon name, e.g. tool_console. This name becomes the file name.
    • The objects move into the Icon Items/<name> collection.
    • Their materials get the toon shader: colour and texture are taken from the Base Color of the existing Principled BSDF; the original shader stays in the material.
  3. Adjust the item in the panel and press Preview: the camera frames the item and the other items are hidden. Look through the camera with Numpad 0.
  4. Render Item saves the icon to the Output folder (icons/ next to the .blend by default).

Render All Items renders every item in Icon Items at once. To see how everything is set up, an empty file shows an Add Example Item button (a crate).

It works well to keep one .blend with all the items of a project: each item's settings are stored on its collection and saved with the file.

Item settings

Field What it does
Style Shader: Classic (soft cel shading, three bands), Comic (hard light/shadow, ink hatching in the shadows, lines on material boundaries, pen-like lines) or Painted (soft shadow edge, smooth form, darker crevices, brush-like tone variation, soft highlight)
Size Icon size: 256×256, 512×256, 256×512, 512×512 or custom
Yaw / Pitch Camera angle: rotation around the item and tilt from above (30° / 25° by default, a 3/4 view)
Lens mm Camera focal length (50 by default; lower is stronger perspective, 85–100 is softer, 0 is an orthographic camera)
Padding Margin around the item (share of the size)
Outline px Outer outline width in pixels of the final icon; its colour is next to it (#141210 by default)
Lines px Inner line width (Freestyle), 0 for none; their colour is next to it (#4F4B47 by default)
Crease angle Edges sharper than this angle get an inner line

Scene-wide settings: the Output folder and Square copy, which also saves the icon fitted into a square of the given size with a suffix (200×200 and _sqr by default).

Shaders

Three node groups (Shader Editor → Add → Group) with the same Color input and Shader output, so changing the style just switches the group in the Icon Studio Shader node of the item's materials.

Icon Studio Toon (Classic): Color, Shadow Tint, Shadow / Mid (brightness of the shadow and middle bands), Light Threshold / Shadow Threshold (where the bands split), Highlight / Highlight Size (hard highlight).

Icon Studio Comic: Color, Shadow Tint, Ink (hatching colour), Shadow, Light Threshold, Deep Threshold (where cross hatching starts), Hatch, Hatch Scale (lower means bigger strokes), Hatch Width, Highlight, Highlight Size.

Icon Studio Painted: Color, Shadow Tint, Shadow, Shadow Edge, Softness, Gradient (share of smooth gradient instead of a band), Occlusion / Occlusion Distance (darkening in crevices), Rim (light edge), Highlight, Highlight Size, Brush / Brush Scale (brush-like tone variation and its size).

When the style changes, the shader inputs in the materials reset to the group's values (colour and texture are kept). To keep a tweak, change the defaults in the group itself (Tab on the group node → Group panel → input values); they apply to every item of that style.

Apply Toon / Remove put the shader on and take it off the materials of the selected objects. The Icon Studio Key Light sun is placed above-left of the camera on every Preview / Render.

How it works

  1. The camera fits the item's bounds into the frame, accounting for perspective and padding; the render runs at 2× resolution.
  2. The toon shaders read the light through Shader to RGB and output Emission, so the icon colours are exactly what was computed, whatever the light strength. That is why rendering is EEVEE only.
  3. Freestyle draws the inner lines (Comic also draws material boundaries, with a wobbling width).
  4. After the render, a fixed-width outline is added around the silhouette (numpy), the image is scaled down to the final size and saved as an 8-bit PNG with transparency.

For the duration of a render the extension switches the scene's engine, transparency and colour management to the needed values and restores the originals afterwards.

Development

icon_studio/            extension source (what goes into the zip)
  blender_manifest.toml extension manifest: id, version, minimum Blender, license
  shaders.py            the three toon node groups, applying/removing the shader on materials
  studio.py             camera, light, items, framing, Freestyle
  render.py             rendering, outline, scaling, PNG
  props.py              item and scene settings
  operators.py, ui.py   buttons and the panel
tests/smoke_test.py     headless check: the example in every style → tests/output/

Check:

blender -b --factory-startup --python tests/smoke_test.py

During development it helps to add the source folder as a local extensions repository: Preferences → Get Extensions → Repositories → + → Add Local Repository, then link icon_studio/ into it (mklink /J <repo>\icon_studio <path>\icon_studio). After edits: F3 → Reload Scripts.

Building

mkdir dist
blender --command extension validate icon_studio
blender --command extension build --source-dir icon_studio --output-dir dist

Bump version in icon_studio/blender_manifest.toml before a release.

License

GPL-3.0-or-later, see LICENSE.

Releases

Contributors

Languages