ShapeSafe

ArtTalentStudio in Modeling


ShapeSafe

Apply modifiers and decimate meshes in Blender without losing a single shape key.

Blender refuses to apply a modifier to a mesh that has shape keys. ShapeSafe applies supportedmodifier stacks to such a mesh and keeps every key: its shape, name, order, value, range,mute state, vertex group, relative key and drivers. It also contains its own decimator thatmeasures the error in every key while it collapses edges, so visemes, blinks andface-tracking keys survive a reduction to a game-ready triangle count.

  • Blender 4.2 LTS to 5.3. Windows validation includes 4.2, 4.5, 5.1, 5.2 and 5.3.
  • Pure Python + numpy (both ship with Blender). No network access, no bundled libraries.
  • Licence: GPL-3.0-or-later

Install

  1. Start Blender 4.2 or newer.
  2. Edit > Preferences > Get Extensions, open the drop-down in the top right corner and choose Install from Disk..., then pick shapesafe-1.0.2.zip. (Dragging the zip into the Blender window does the same.)
  3. The panel is in the 3D Viewport sidebar: press N, tab ShapeSafe. The two main commands are also in Object > Apply.

To remove it: Edit > Preferences > Add-ons, find ShapeSafe, Uninstall.


Quick start

Apply a modifier stack

  1. Select the mesh (Object Mode).
  2. Sidebar > ShapeSafe > Apply with Keys. Leave All selected.
  3. Click Preview to see what will happen (triangle and vertex counts, error per key) without changing anything, or Apply with Keys to do it.
  4. One Ctrl+Z brings the original back.

Decimate an avatar to a triangle budget

  1. Select the mesh.
  2. Sidebar > ShapeSafe > Decimate with Keys. Pick Triangles and click a budget (70k, 32k, 20k, 10k, 7.5k) or type a number.
  3. Preview, read the largest key error in the report, then Decimate.

What is kept

For every shape key: shape, name, order, value, slider min / max, mute, interpolation,relative-to key, vertex group, lock state; the Basis; drivers on key values and onother key properties (also drivers elsewhere that read this mesh's keys); the action(keyframes) and NLA strips of the keys; active key index and the shape-key pin.

For the mesh: UV maps, colour attributes, custom split normals, materials and materialassignment, vertex groups and weights, other attributes, custom properties and meshsettings. The mesh datablock keeps its name.

Blender ties key data to the vertex count, so a mesh with a new vertex count gets a new Keydatablock internally; ShapeSafe copies everything over field by field and gives it the old name.


Apply with Keys

Applies modifiers of the active object (or of all selected meshes).

Mode What is applied
All Every modifier that is enabled in the viewport.
Chosen Only the modifiers ticked in the list in the panel.
Up To From the top of the stack down to the modifier you pick.

Modifiers that are disabled in the viewport are never applied and stay on the stack.Applied modifiers are removed from the stack; the others stay. As in Blender, applying amodifier that sits below one that stays can look different from the viewport; the report saysso when it happens.

Each modifier is handled by one of four methods. The panel shows which one next to eachmodifier in Chosen mode, and the report lists it after the run.

1. Exact (topology-stable modifiers)

Mirror, Array, Subdivision Surface, Solidify, Bevel, Displace, Smooth, Shrinkwrap, SimpleDeform, Cast, Lattice, Wave, Hook, Warp, Corrective / Laplacian Smooth, Triangulate, Wireframe,Edge Split, Mask, Weighted Normal, Geometry Nodes, Armature (when you choose to apply it) andany other modifier that gives the same topology for every key.

The stack is evaluated once per key by Blender itself. ShapeSafe checks that every key givesthe same vertex count and face layout as the Basis. The result is identical to what Blenderwould produce for that key: measured error 0 mm in the tests.

If a key does change the topology the modifier produces (for example a Bevel with an anglelimit, or a Mirror merge when a key pulls centre vertices off the mirror plane), the keys thatmatch stay exact and only the others are rebuilt:

  • first from an evaluation at reduced key strength that still gives the Basis topology (option Amplitude Fallback), which keeps welds and symmetry intact;
  • otherwise by surface transfer (method 4).

For each rebuilt key the report shows how far it is from Blender's own evaluation of that key.

2. Key-aware Decimate (Decimate modifier, Collapse mode)

Blender's result for a Decimate modifier differs from key to key, so it cannot be used.ShapeSafe runs its own decimator with the modifier's ratio (see Decimate with Keys below).The modifier's vertex group and symmetry settings are not used; the report says so.

3. Key-aware Weld (Weld modifier)

Vertices are merged where they are within the merge distance in the Basis, with the samegrouping as Blender's Weld in All mode (identical vertex counts in the tests). In Connectedmode the grouping along chains of short edges can differ from Blender's by a small amount(0.5 % of the vertices in the test).

  • Key-Aware Weld (on by default): vertices stay separate if any key moves them further apart than Key Distance, or if the proposed merge would create a new branching edge. The report counts skipped merges. Closed lips and eyelids that touch in the Basis can still move apart.
  • Merged Position: Average of the group or the First Vertex, in every key.

4. Surface transfer (Boolean, Remesh, Decimate Un-Subdivide / Planar, anything else)

The modifier is evaluated on the Basis. Every new vertex then takes the key movement of theclosest point on the old Basis surface, interpolated inside the old triangle.

  • A new vertex that sits exactly on an old vertex copies that vertex (exact).
  • On closed seams (two old vertices on one spot) the right side is found from the mesh connectivity, so lips are not mixed up.
  • New vertices further than Max Transfer Distance from the old surface (for example the inside of a Boolean cut) receive no key movement. They are counted in the report and collected in the vertex group ShapeSafe_Unmapped. Between half that distance and the full distance the movement fades out.

Decimate with Keys

A quadric-error edge collapse written for meshes with shape keys.

  • Every vertex carries one error quadric per shape (the Basis and each key), built from the faces as they are in that shape. An edge is scored with the weighted sum over all shapes, so an edge that looks harmless in the Basis but matters in "jaw open" is kept.
  • The position of the merged vertex is solved separately in every key.
  • Edges whose two ends move very differently in some key (lip seam, eyelids) are protected and only collapsed when nothing else is left.
  • Open boundaries, UV seams, sharp edges and material borders can be preserved (all on by default). UVs, colours and weights are blended on the surface; a vertex never gets more bone influences than the vertices it was merged from.
  • The target is a ratio or an exact triangle count.
  • The result is a triangle mesh. Quads and n-gons are split along the diagonals Blender already uses to draw them, so triangulating alone does not change the surface.
  • Works on meshes without shape keys as well.

If the Preserve options make the target unreachable (for example every face is its own UVisland), ShapeSafe releases UV seams / sharp edges / material borders, then boundaries, forthe remaining collapses and says so in the report instead of stopping short.


Every option

Panel header

Option Default Meaning
All Selected off Process every selected mesh object instead of only the active one. Objects that cannot be processed are skipped and listed in the report.
Keep Backup off Keep the untouched original as a hidden object named _ShapeSafe_Backup (hidden in viewport and render, with all keys and modifiers).

Apply with Keys

Option Default Meaning
Modifiers All All, Chosen or Up To (see above).
Up To - Last modifier to apply in Up To mode.
Skip Armature on In All and Up To modes, leave Armature modifiers on the stack so the avatar stays rigged. In Chosen mode a ticked Armature is applied in its current pose.
Preview Dry run: computes everything and fills the report, changes nothing.
Apply with Keys Runs the operation.

Decimate with Keys

Option Default Meaning
Target Triangles Ratio (fraction of triangles to keep) or Triangles (count to reach).
Ratio 0.5 Fraction of the triangles to keep.
Triangles 20,000 Triangle count to reach. Exactly this number when the mesh allows it; a closed mesh can only lose triangles in pairs, so an odd target can end one below. Buttons: 70k, 32k, 20k, 10k, 7.5k.
Boundaries on Keep open borders (neck opening, eye holes, cut edges) in place.
UV Seams on Keep UV island borders in place so textures do not smear.
Sharp Edges on Keep edges marked sharp.
Material Borders on Keep the borders between materials in place.
Basis Weight 1.0 How much the Basis shape counts when choosing edges.
Key Weight 1.0 How much each key's shape counts when choosing edges. 0 ignores keys for the choice (key positions are still solved per key).
Key Seam Protection 1.0 An edge is protected when, in some key, its ends move differently by more than this multiple of the edge length. Lower protects more, 0 turns it off.
Protect Group - Vertices with a weight of 0.5 or more in this vertex group are never moved or merged.
Preview / Decimate Dry run / run.

Options

Option Default Meaning
Key-Aware Weld on Weld modifiers: do not merge vertices that a key moves apart.
Key Distance 0 Largest distance two vertices may have in any key and still be merged. 0 = the Weld modifier's merge distance.
Merged Position Average Where a merged vertex ends up in every key: Average or First Vertex.
Amplitude Fallback on Exact method: rebuild a key that changes the topology from a reduced-strength evaluation before falling back to surface transfer.
Max Transfer Distance 0 Surface transfer: new vertices further than this from the old surface get no key movement. 0 = 2 % of the object size.
Measure Errors on Measure the error of every key for the report. Turn off to save time on very large meshes.
Report Popup on Show the report in a popup when the operation finishes.

In the Adjust Last Operation panel only

Option Meaning
Dry Run Same as the Preview buttons. Untick it there to turn a preview into the real run.

Every option has a tooltip. All options are operator properties, so they can be changed inthe Adjust Last Operation panel (bottom left of the viewport, or F9) after running.


The report

After every run (and every preview) a popup and the Last Report sub-panel show:

  • triangles and vertices before and after,
  • the number of keys kept,
  • for each modifier which method was used,
  • the error of every key in millimetres (maximum and mean),
  • warnings: skipped modifiers and why, vertices that could not be mapped, keys that had to be rebuilt, Preserve options that had to be released, a target that could not be reached.

What "error" means depends on the method:

Method Reported error
Exact 0 (the key is Blender's own result). For rebuilt keys: distance to Blender's own evaluation of that key.
Decimate Distance between the original key surface and the decimated key surface, both ways. Sampled at the original's vertices and at the result's vertices, edge midpoints and face centres.
Weld The largest distance a vertex was moved by merging, in that key.
Surface transfer How much further the key is from its original surface than the Basis is from the original Basis (the modifier's own change is not counted). Unmapped vertices are excluded and reported separately.

Millimetres are real-world millimetres: object scale and the scene's unit scale are included.The numbers are measurements at sample points, not mathematical bounds; in the tests theyagree with an independent, denser measurement to within 0.1 mm.


Scripting

import bpy# apply the whole stack of the active objectbpy.ops.shapesafe.apply_modifiers(apply_mode='ALL', skip_armature=True, keep_backup=True)# only two modifiersbpy.ops.shapesafe.apply_modifiers(apply_mode='SELECTED', modifier_names="Mirror\nSubdivision")# decimate every selected mesh to 20,000 triangles, preview firstbpy.ops.shapesafe.decimate(target_mode='COUNT', target_tris=20000, batch=True, dry_run=True)bpy.ops.shapesafe.decimate(target_mode='COUNT', target_tris=20000, batch=True)# the report of the last runreport = bpy.context.window_manager.shapesafe_reportprint(report.title)for row in report.rows:    print(row.name, row.max_mm, row.mean_mm, row.note)

A problem with the input (no mesh, no keys, linked data, ...) is reported as an operatorerror with a plain message; from Python that is a RuntimeError carrying the same text.


Limits (please read)

  • One topology has to serve all keys. Where Blender would give different topology for different keys, some keys cannot be exact (see Exact, rebuilt keys). The report tells you which ones and by how much.
  • Decimated meshes are triangle meshes. Quads are not kept.
  • Decimate modifier options "Vertex Group" and "Symmetry" are not replicated, and the decimator does not enforce left/right symmetry. Use Protect Group to keep an area untouched.
  • Surface transfer needs the new surface to lie on or near the old one. Parts created far from the old surface (the inside of a Boolean cut) do not move with any key; they are reported and put in the vertex group ShapeSafe_Unmapped. A voxel Remesh fuses anything that touches, so closed lips become one surface and can no longer open - that is what Remesh does.
  • Blender's Exact boolean solver welds vertices that share a position (closed lips become one vertex). ShapeSafe cannot undo this; it detects it and warns. Use another solver or leave a tiny gap between the lips in the Basis.
  • Multiresolution and physics / simulation modifiers (Cloth, Soft Body, Fluid, Dynamic Paint, Collision, Particle System, Particle Instance, Explode, Ocean) are not applied. They stay on the stack and the report says why.
  • Linked objects, library overrides, meshes shared by several objects and Edit Mode are refused with a message that says what to do.
  • Exact method cost: the stack is evaluated once per key, so 100 keys under a heavy stack take 100 evaluations.
  • Decimate memory: per-key data is stored only where a key moves the mesh. Avatars whose keys live on the face are cheap; if very many keys each move a very large mesh, memory grows with keys x moved vertices (about 100 bytes each). Above 8 GB ShapeSafe stops with a message instead of exhausting memory.
  • Skin weights after decimation are blended and re-normalised to the sum they had; the number of influences per vertex never grows, but individual weights change slightly.
  • Custom split normals after decimation are carried as directions and re-applied; in the test the mean deviation is below 1 degree, individual corners can differ more.
  • Tangential sliding: the decimator places a merged vertex per key. Along a flat surface the position within the surface can differ a little between keys, which can make a texture slide by a fraction of a millimetre while a key blends in. The shape itself is not affected.
  • Weld in Connected mode can group chains of short edges slightly differently from Blender's Weld modifier.
  • Undo, the popup and the panels were tested in a real Blender window on a virtual display; everything else is tested headless. See TEST_REPORT.md.

Measured results (Blender 4.2.23, 4.5.16, 5.2.4)

All numbers come from the automated tests; TEST_REPORT.md has every test on every version.

What Result
Exact method, 25 modifier cases, every key vs Blender's own result 0 mm
Decimate 50 % on the test head (17,746 -> 8,873 triangles, 27 keys + Basis) worst key: 0.34 mm max, 0.013 mm mean
Same collapse without the per-key terms (internal baseline, not the product) worst key: 4.58 mm max
Mouth seam after 50 % decimation 0.017 mm gap in the Basis, 0 of 27 lip pairs welded
100k-triangle body with 52 face-tracking keys -> exactly 20,000 triangles about 9 s including the error report (4-core test machine)
Same with all 52 keys moving every vertex (stress case) 35 to 39 s
Key settings, drivers, action after the operation, five methods 0 differences

The test meshes are generated by formulas (tests/assets.py), not downloaded: a stylisedhead with coincident lips, a mouth pocket, eye openings and eyeballs, a body, and a mirroredhalf mesh. Your own meshes will give different numbers; the Preview button shows them beforeanything is changed.


Files

Path Content
shapesafe/ The extension (what is inside the zip).
tests/ Test assets, independent measurement code, test suites, runner.
tools/build.sh Builds and validates the zip with blender --command extension.
TEST_REPORT.md Generated test report.
CHANGELOG.md, STORE_NOTES.md, HANDOVER.md Release notes, store material, developer hand-over.

Build: tools/build.sh /path/to/blender. Test: python3 tests/run_tests.py.

$14

Support Period Included

Includes 12 months of

Extend this product’s Support Period +12 months: 50% of product price

Have questions before purchasing?
Login to message

Details
Blender Extension Compatible Yes
Published about 17 hours ago
Blender Version 4.2 - 5.3
Extension Type Add-on
Render Engine Used Cycles
License GPL