Changeset View
Changeset View
Standalone View
Standalone View
tests/python/modifiers.py
| Context not available. | |||||
| import bpy | import bpy | ||||
| import os | import os | ||||
| import sys | import sys | ||||
| import math | |||||
| from random import shuffle, seed | from random import shuffle, seed | ||||
| seed(0) | seed(0) | ||||
| sys.path.append(os.path.dirname(os.path.realpath(__file__))) | sys.path.append(os.path.dirname(os.path.realpath(__file__))) | ||||
| Context not available. | |||||
| def main(): | def main(): | ||||
| mask_first_list = get_generate_modifiers_list("testCubeMaskFirst", randomize=True) | mask_first_list = get_generate_modifiers_list("testCubeMaskFirst", randomize=True) | ||||
| mask_vertex_group = "testCubeMaskFirst" + "_mask" | mask_vertex_group = "testCubeMaskFirst" + "_mask" | ||||
| mask_first_list.insert(0, ModifierSpec('mask', 'MASK', {'vertex_group': mask_vertex_group})) | mask_first_list.insert(0, ModifierSpec('mask', 'MASK', {'vertex_group': mask_vertex_group})) | ||||
| Context not available. | |||||
| # [ModifierSpec('hook', 'HOOK', {'object': bpy.data.objects["EmptyHook"], 'vertex_group': "HookVertexGroup"})]], | # [ModifierSpec('hook', 'HOOK', {'object': bpy.data.objects["EmptyHook"], 'vertex_group': "HookVertexGroup"})]], | ||||
| # 20 | # 20 | ||||
| #ModifierSpec('laplacian_deform', 'LAPLACIANDEFORM', {}) Laplacian requires a more complex mesh | # ModifierSpec('laplacian_deform', 'LAPLACIANDEFORM', {}) Laplacian requires a more complex mesh | ||||
| ########################################## | |||||
| # Mesh Deform Modifier requires human input | |||||
zazizizou: Style: simply write
`# Mesh deform modifier requires user input, so skip.` | |||||
| ########################################## | |||||
| # mesh_test = MeshTest("testMonkeyDeform", "expectedMonkeyDeform",[ | |||||
| # ModifierSpec('mesh_deform', 'MESH_DEFORM', {'object': bpy.data.objects["testDeformStructure"]}), | |||||
| # OperatorSpec('meshdeform_bind',{'modifier':'MeshDeform'},'FACE',{i for in range(500)}) | |||||
| # ] ,True) | |||||
| ["testCubeLattice", "expectedCubeLattice", | ["testCubeLattice", "expectedCubeLattice", | ||||
| [ModifierSpec('lattice', 'LATTICE', {'object': bpy.data.objects["testLattice"]})]], | [ModifierSpec('lattice', 'LATTICE', {'object': bpy.data.objects["testLattice"]})]], | ||||
| ["testPlaneShrinkWrap", "expectedPlaneShrinkWrap", | |||||
| [ModifierSpec('shrinkwrap', 'SHRINKWRAP', {'target': bpy.data.objects["testCubeWrap"], 'offset': 0.5})]], | |||||
| ["testCylinderSimpleDeform", "expectedCylinderSimpleDeform", | |||||
| [ModifierSpec('simple_deform', 'SIMPLE_DEFORM', {'angle': math.radians(180), 'deform_axis': 'Z'})]], | |||||
| ["testPlaneSmooth", "expectedPlaneSmooth", | |||||
| [ModifierSpec('smooth', 'SMOOTH', {'iterations': 11})]], | |||||
| ######################################## | |||||
zazizizouUnsubmitted Done Inline ActionsSuch block comments should reflect what you can see in the blend file as text, e.g. 'List of Deform Modifiers' or 'One Generate Modifiers' zazizizou: Such block comments should reflect what you can see in the blend file as text, e.g. 'List of… | |||||
| # Smooth corrective requires a complex mesh | |||||
| ######################################## | |||||
| ["testBalloonLaplacianSmooth", "expectedBalloonLaplacianSmooth", | |||||
| [ModifierSpec('laplaciansmooth', 'LAPLACIANSMOOTH', {'lambda_factor': 12, 'lambda_border': 12})]], | |||||
| ####################################### | |||||
| # Surface Deform and Warp requires human input | |||||
| ####################################### | |||||
| ####################################### | |||||
| # Wave - complex to test | |||||
| ###################################### | |||||
| ] | ] | ||||
| modifiers_test = ModifierTest(tests) | modifiers_test = ModifierTest(tests) | ||||
| Context not available. | |||||
| main() | main() | ||||
| except: | except: | ||||
| import traceback | import traceback | ||||
| traceback.print_exc() | traceback.print_exc() | ||||
| sys.exit(1) | sys.exit(1) | ||||
| Context not available. | |||||
Style: simply write
# Mesh deform modifier requires user input, so skip.