diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-05-03 16:30:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-05-04 11:56:33 +0300 |
commit | 5f8f436dca96188b78584a3e23d44d7a81809751 (patch) | |
tree | d37eb1692c8165206bfc83a691090ab60cf32db6 /source/blender/makesdna/DNA_modifier_defaults.h | |
parent | aa1fb4204dc484067edec672c97c4c7b281996b8 (diff) |
Allow surface deform when target mesh increases number of vertices
A studio request actually.
The goal is to cover rather typical situation: when the mesh was
bound to target when the target was on subdivision level 0 but
uses a higher subdivision level for rendering. Example of such
setup is a facial hair bound to the face.
The idea of this change is to use first N vertices from the target
where N is the number of vertices on target during binding process.
While this sounds a bit arbitrary it covers typical modifier setup
used for rigging. Arguably, it is not more arbitrary than using a
number of polygons (which is how the modifier was checking for
changes on target before this change).
Quite straightforward change. A bit tricky part was to not break
the behavior since before this change we did not track number of
vertices sued when binding. The naming I'm also not super happy
with and just followed the existing one. Ideally the variables in
DNA will be prefixed with `target_` but doing it for an existing
field would mean compatibility change, and only using prefix for
the new field will introduce weird semantic where the polygons
count will be even more easily confused with a count on the
deforming mesh.
Differential Revision: https://developer.blender.org/D14830
Diffstat (limited to 'source/blender/makesdna/DNA_modifier_defaults.h')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_defaults.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h index b4b9a869280..92a65a50bd4 100644 --- a/source/blender/makesdna/DNA_modifier_defaults.h +++ b/source/blender/makesdna/DNA_modifier_defaults.h @@ -632,6 +632,7 @@ .falloff = 4.0f, \ .mesh_verts_num = 0, \ .bind_verts_num = 0, \ + .target_verts_num = 0, \ .target_polys_num = 0, \ .flags = 0, \ .mat = _DNA_DEFAULT_UNIT_M4, \ |