the existing tension map add-on apparently was having issues with armatures, shapekeys and rendering in blender 2.8+, so i decided to give a shot at making a version myself. it should work with armatures, shape keys and other deformation modifiers, and shouldn’t have issues rendering.
its still kinda frustrating how the new depsgraph seems to work, especially for rendering animations. it feels like you have to hack your way into making updates on each frame without breaking some other element of the animation.
anyway, download here:
mesh_tension.py (5.1 KB)
mesh_tension.py (10.5 KB)
- Now generates vertex groups that can be used with modifiers!
- If a modifier uses one of the generated tension vertex groups, it’ll automagically know to not use that modifier for calculating deformation tension
- Added an ‘Always Update’ option per mesh that allow instantaneous feedback while editing the scene rather than only when playing back animations.
mesh_tension.py (10.7 KB)
- Adds a ‘Bias’ option that lets you artificially favour stretching or compression
mesh_tension_1_3.py (10.9 KB)
Feature: If you tag a modifier name with the suffix ‘SKIPTENSION’ it won’t consider that modifier’s deformations as contributing to tension:
Fix: An objects’s tension updates are now paused when in edit mode; hopefully reducing errors where tension calculation ceases to function.
Usage (version 1.1):
Install it in the preferences like any other add-on
Enable it per mesh in the mesh data tab:
- ‘Strength’ multiplies the intensity of the tension values.
- ‘Always Update’ allows for interactive tension updates even when not using the animation system
- In the scene properties, there is also an option to globally disable tension calculations
When enabled, it adds a vertex color called ‘tension_map’ that stores stretch in the green channel and compression in the red channel, and vertex groups ‘tension_stretch’ and ‘tension_compress’.
To use in a shader, add a vertex color attribute. You can separate out the green or red channels to multiply against corresponding maps that show compression or stretching.
To drive a modifier, select one of the tension vertex groups in the modifier’s settings.
-I discovered that to get around crashes, there is apparently a magical ‘Lock Interface’ toggle in the Render menu. So for safety the add-on interface greys itself out and presents a prompt until this is enabled.