Modifiers: Armature deformation test for various modifier settings

Test for armature deform modifier settings that are not yet covered by other tests:

- Vertex Group vs. Envelope deformation and both combined.
- Vertex group masking ('vertex_group' setting of the modifier)
- Inverted vertex group masking
- Preserve Volume (dual quaternions)
- Vertex Group/Envelope influence mixing (bone option)
- B-Bone deformation
- Multi-modifier mixing

Each case has a new test/expected mesh pair in the modifiers test.

Pull Request: https://projects.blender.org/blender/blender/pulls/141054
This commit is contained in:
Lukas Tönne
2025-07-01 14:18:58 +02:00
parent c49e9e1773
commit fe869232ee
3 changed files with 87 additions and 3 deletions

View File

@@ -61,6 +61,23 @@ class ModifierSpec:
" with parameters: " + str(self.modifier_parameters)
class MultiModifierSpec:
"""
Holds a list of Deform modifiers that must be applied together to yield the expected result.
"""
def __init__(self, modifiers):
"""
Constructs a multi-modifier spec.
:arg modifiers - list of modifier specs
"""
self.modifiers = modifiers
def __str__(self):
return "Multi-Modifier: [" + ', '.join(str(modspec) for modspec in self.modifiers) + "]"
class ParticleSystemSpec:
"""
Holds a Particle System modifier and its parameters.
@@ -491,6 +508,13 @@ class SpecMeshTest(MeshTest):
self._apply_modifier(
evaluated_test_object, operation.modifier_name)
elif isinstance(operation, MultiModifierSpec):
for modspec in operation.modifiers:
self._add_modifier(evaluated_test_object, modspec)
if self.apply_modifier:
self._apply_all_modifiers(
evaluated_test_object)
elif isinstance(operation, OperatorSpecEditMode):
self._apply_operator_edit_mode(
evaluated_test_object, operation)
@@ -598,6 +622,12 @@ class SpecMeshTest(MeshTest):
else:
raise Exception("This object type is not yet supported!")
def _apply_all_modifiers(self, test_object):
if test_object.type in ['CURVE', 'MESH']:
bpy.ops.object.convert(target='MESH')
else:
raise Exception("This object type is not yet supported!")
def _bake_current_simulation(self, test_object, test_modifier_name, frame_end):
"""
FLUID: Bakes the simulation