Skip to content

BlendShape Editing Window ​

A tool that lets you reorder, rename, delete, duplicate and merge the blend shapes of a mesh, add in-between frames and bake a coefficient into a shape, and then save the result as a new mesh. You can also store shapes made on one mesh in a "storage asset" and import them into another mesh with the same vertex count.

Window: さたにあしょっぴんぐ/エディタカスタマイザー/Blendshape/ブレンドシェイプ改変ウィンドウ in the top menu

You can also open it from the menu at the top right of a SkinnedMeshRenderer's Inspector → 「ブレンドシェイプ改変ウィンドウで開く」 (Open in BlendShape Editing Window); that renderer becomes the source.

Workflow ​

  1. Set a SkinnedMeshRenderer (a renderer in the scene) or a Mesh (a mesh asset) in the fields at the top and press 「読み込む」 (Load)
  2. Edit the shapes in the list (see the table below)
  3. Check the result with 「プレビュー」 (Preview)
  4. Write it out as a mesh asset with 「新しいメッシュとして保存...」 (Save as New Mesh...) under 「保存」 (Save)

The source mesh (an FBX, for example) is not modified. The result only becomes an asset when you save.

If you loaded with only a Mesh and then set a SkinnedMeshRenderer that uses the same mesh in the fields at the top, the button changes to 「このレンダラーを対象にする」 (Use This Renderer as the Target). Pressing it keeps your edits and makes that renderer the target of the scene preview and of the replacement after saving (switching to another renderer works the same way).

What you can do in the list ​

OperationHow
ReorderDrag the left edge of a row (not available while searching)
RenameEdit the name field in place
Duplicate / Delete「複製」 (Duplicate) and 「削除」 (Delete) at the right of a row. To delete several at once, check the rows and press 「チェックした行を削除」 (Delete Checked Rows)
Add an empty shape「空のシェイプを追加」 (Add Empty Shape). A shape that does not move is added at the end (add frames to give it a form)
MergeCheck two or more rows and press 「合成...」 (Merge...). Creates one shape that is the sum of each shape multiplied by its coefficient (you can also choose whether to delete the sources)
Edit framesOpen the ▸ of a row to change frame weights, delete frames and add in-between frames. The frame editing window opened with 「編集」 (Edit) lets you edit while looking at the form
Bake a coefficientOpen the ▸ of a row, enter a coefficient, then press 「新しいシェイプに」 (As New Shape: adds the scaled form as another shape) or 「このシェイプを置換」 (Replace This Shape). ×1.5 corresponds to weight 150, and ×-1 gives the movement in the opposite direction
SearchEnter a part of a name in 「検索」 (Search) at the top to show only the matching rows. A row that stops matching because you renamed it during the search stays in the list until you change the search text (so that you can go on to the next row)

「チェックした行を削除」 (Delete Checked Rows), 「合成...」 (Merge...) and 「書き出し...」 (Export...) apply to every checked row (use 「全部チェック」 (Check All) and 「チェックを外す」 (Uncheck All) at the top to check or uncheck rows in bulk). When rows hidden by the search are still checked, their number is shown below the buttons. Pressing 「合成...」, 「書き出し...」 or 「取り込み...」 (Import...) opens the corresponding section in the lower part of the window and scrolls it into view.

The 「最終フレーム」 (last frame) of a shape is its frame with the largest weight (normally 100). Merging and the source of a frame delta use this form.

Frame editing window ​

Opened with 「編集」 (Edit) on a row. You can edit the frames while looking at a 3D view of the form with only that shape applied.

  • Use the 評価ウェイト (Evaluation Weight) slider to check the form at a given weight (「-100〜200」 extends it beyond the normal range, and 「自動スイープ」 (Auto Sweep) moves it back and forth)
  • In the フレーム (Frames) list, change the weight of each frame or delete it
  • フレームを追加 (Add Frame): choose a weight and the source of the delta (「0」 = a frame that does not move / 「このシェイプの最終フレーム」 (Last Frame of This Shape) × 0.5 = an in-between form / another shape) and add it. When a frame with the same weight already exists, for example, 「追加」 (Add) is disabled and the reason is shown below
  • フレームのデルタを差し替え (Replace Frame Delta): replaces the form of the chosen frame with the form of another shape × a coefficient
  • In the view: left drag = rotate / right or middle drag = pan / wheel = zoom

Preview ​

MethodDescription
Preview window「プレビューウィンドウを開く」 (Open Preview Window), or Blendshape/ブレンドシェイプ プレビュー in the menu. Draws the working set in a separate view, with sliders to move the weights. Nothing is added to the scene
Preview in the scene「作業中の構成をシーンでプレビュー」 (Preview the Working Set in the Scene). Check the form in the scene, together with the rest of the avatar. Only available when there is a target SkinnedMeshRenderer (if you loaded with only a Mesh, set a renderer in the fields at the top and press 「このレンダラーを対象にする」)

Preview in the scene ​

Instead of the source renderer, a copy holding the mesh of the working set is drawn in the scene. The mesh and the weights of the renderer itself are not modified (and nothing is saved into the scene or the prefab). Duplicating or building the avatar during the preview never picks up the working mesh.

  • The weights of the copy follow the renderer's current weights (changes made in the Inspector or by an animation show up too). Shapes you reordered or renamed still move with the weight of their original shape
  • Check a row to try that shape's weight anywhere from -100 to 200. For a shape that exists in the source mesh this moves the renderer's actual weight (Ctrl+Z reverts it). For a shape created while editing (duplicated, merged, coefficient-baked and so on) the window keeps the weight only during the preview and does not write it to the renderer. When several rows are checked, the topmost one in the list is the target
  • The preview stops automatically on recompile, when entering Play mode, when the window is closed, when another mesh is loaded, and when the working set can no longer be built (the source mesh was deleted, for example). After saving, updating the original mesh directly, reloading, switching the target renderer, or restoring from a backup, a preview that was on is started again with the new contents
  • During the preview, clicking that mesh in the Scene view does not select it (select it from the Hierarchy)
  • While a preview of Modular Avatar or another NDMF tool is active on that renderer, the original form drawn by NDMF overlaps the copy. In that case turn off Tools > NDM Framework > Enable Previews, or use the preview window
  • Rebuilding the temporary mesh takes a few seconds on a mesh with many shapes. In that case turn off 「編集のたびにプレビューを更新する」 (Update the Preview on Every Edit) and press 「プレビューを更新」 (Update Preview) by hand (it starts OFF for meshes with more than 150 shapes)
  • When Legacy Clamp BlendShape Weights in Project Settings is ON, weights are clamped to 0–100. A button to turn it OFF is shown in place

Saving ​

ButtonDescription
新しいメッシュとして保存... (Save as New Mesh...)Choose a location and create a mesh asset (.asset). An FBX-derived mesh cannot be modified directly, so this is the one you normally use
元のメッシュを直接更新 (Update the Source Mesh Directly)Only available when the source is a mesh asset in Unity's own format (.asset / .mesh). It cannot be undone, so keep a backup first
  • With 「保存後、レンダラーのメッシュを保存したものに差し替える」 (After Saving, Replace the Renderer's Mesh with the Saved One) ON, the source renderer starts using the saved mesh (Ctrl+Z reverts it). Even if the order changed, that renderer's weights are moved to the new order
  • When you pick an existing file in 「新しいメッシュとして保存...」: if the file contains exactly one mesh, its content is replaced (references to that mesh are kept; a draft or backups of the overwritten mesh, if any, are deleted). If you pick the very file that contains the source mesh, it is handled the same as 「元のメッシュを直接更新」. Files that contain anything else are not overwritten, and neither are files where replacing the content would break references (the mesh inside was created as a sub-asset of another asset, so its ID inside the asset differs) — save under another name instead
  • When 「元のメッシュを直接更新」 changes the order, the weights of the source renderer are moved to the new order (this is not reverted by Ctrl+Z, because the change to the mesh itself cannot be reverted). If you press Ctrl+Z after the update for a weight you moved with the slider before the update, the weight of a different shape may change (weights are remembered by index)
  • When other renderers use a mesh whose order changed, their weights are not moved (their weights end up on different shapes). Be careful when using 「元のメッシュを直接更新」

Storage asset (export / import) ​

Shapes you made can be kept in an asset separate from the mesh (BlendShapeDataAsset) and imported later into a mesh with the same vertex count (another version of the same base body, for example).

  • Export: check rows and press 「書き出し...」 (Export...) → choose the storage asset (or 「新規アセットを作る...」 (Create New Asset...) if there is none) → 「チェックした N 本を追加」 (Add the N Checked). A shape with the same name in the storage asset is replaced. However, if a checked shape has the same name as a shape that the current edit has imported from that storage asset, nothing is exported (the reason appears at the bottom of the window; replacing it would change the imported form after an Undo or a recompile). Save the mesh first, or rename the shape before exporting
  • Import: 「取り込み...」 (Import...) → choose a storage asset → check the shapes to import → 「チェックした N 本を取り込む」 (Import the N Checked). They are added at the end of the list
    • 「⚠ 別メッシュ由来 (頂点数は一致)」 (From another mesh; vertex count matches) can be imported, but the form may not fit. 「✕ 頂点数が違う」 (Vertex count differs) cannot be imported
    • Until you save the mesh, an imported shape keeps reading the content of the storage asset. Do not modify or delete the shape with the same name in the storage asset in the meantime (if it is deleted, that import and every operation after it are dropped)

Undo and carrying work over ​

Edits are kept as "the source mesh + a record of operations".

  • Ctrl+Z / Ctrl+Y undo / redo one operation at a time. Operations resumed from a draft, and operations made before switching the target renderer, cannot be undone with Ctrl+Z (only the operations added after that can; the area at the top of the window shows how far you can go back, for example "Ctrl+Z で戻せるのは直近の N 件" (Ctrl+Z can revert only the latest N))
  • Edits survive a script recompile (the next time the window is drawn, the source mesh is read again and the operations are replayed)
  • The record of operations is saved automatically as a draft under Library/SataniaCustomEditor/BlendShapeEditor/ in the project. Even after closing the window or Unity, you are asked 「続きから / 破棄」 (Continue / Discard) the next time you load the same mesh (no draft is made for a mesh that is not an asset)
  • When you save, the record of operations and the draft are emptied and the saved mesh becomes the new source (Ctrl+Z cannot go back past the save)
  • If the source mesh is reimported while editing (an FBX was overwritten, for example), the new mesh is read and the operations are replayed

When an operation can no longer be replayed ​

If an operation can no longer be replayed (a shape disappeared from the source mesh, for example), that operation and every operation after it are dropped and a notice is shown at the top of the window (the Ctrl+Z history is also cut there).

  • The whole record of operations from before the drop (including the operations that were kept) is saved as a backup in the same folder as the draft, as ….failed.<date and time>.json (the newest five per mesh; no backup is made for a mesh that is not an asset)
  • While a backup exists, the area at the top of the window shows 「操作の記録の控えがあります」 (There is a backup of the record of operations); it is shown even after you dismiss the notice or reopen the window or Unity. After fixing whatever made the replay fail (the source mesh, or the storage asset an import came from), press 「控えから戻す」 (Restore from Backup) to read the backup again and replay it from the start. When everything replays, that backup is removed. A backup you do not need can be deleted with 「控えを消す」 (Delete Backup)
  • If the current record has operations that are not in the backup when you restore (you kept editing after the drop), you are asked to confirm, and the current record is also saved as another backup before it is replaced (so 「控えから戻す」 can later bring back the state from before the replacement)
  • 「元のメッシュを直接更新」 deletes the backups for that mesh (the operations in them no longer fit the updated mesh)
  • If the draft file is broken and cannot be read, it is moved aside to ….unreadable.json and the mesh is loaded without a draft

Notes

  • Merging and coefficient baking add the normal and tangent deltas with the same coefficient as they are (for forms with large movement, the shading can look slightly unnatural)
  • Loading, updating the preview and saving take a few seconds on a mesh with many vertices and shapes (an avatar's base body, for example)
  • If you press the ⊙ at the right end of an object field (the button that opens the picker window) while a name or a weight is still being typed, the typed text is discarded without being committed (the same as Unity's Inspector). Commit it with Enter or Tab first. When you press any other button or field, the typed text is committed first

MIT License