Add comprehensive tests for cutout and mesh functionalities
- Introduced `test_cutout.py` to validate cutout pie menu behavior, image lasso options, and mesh detail calculations. - Added `test_mesh.py` to ensure correct tangent normal rasterization, plane source topology, and depth surface evaluations. - Created `test_mesh_blender.py` to verify material node groups, tangent baking, and local cutout building from Blender images. - Implemented tests for handling alpha regions and ensuring geometry nodes maintain expected behavior.
This commit is contained in:
@@ -99,13 +99,14 @@ def main():
|
||||
material_group = material_node_group(
|
||||
surface_group_name=BALLOON_MATERIAL_NODE_GROUP_NAME,
|
||||
)
|
||||
normal_map = next(
|
||||
node
|
||||
normal_maps = {
|
||||
node.space
|
||||
for node in material_group.nodes
|
||||
if node.bl_idname == "ShaderNodeNormalMap"
|
||||
)
|
||||
assert normal_map.space == "TANGENT"
|
||||
assert abs(input_socket(material_group, "Normal Strength").default_value - 0.5) < 1e-6
|
||||
}
|
||||
assert normal_maps == {"TANGENT", "OBJECT"}
|
||||
assert input_socket(material_group, "Object Space").default_value is False
|
||||
assert input_socket(material_group, "Normal Scale").default_value == 1.0
|
||||
|
||||
source_image = bpy.data.images.new("Reuse Source", 2, 1)
|
||||
shared_normal = bpy.data.images.new("Shared Normal", 2, 1)
|
||||
@@ -115,8 +116,6 @@ def main():
|
||||
material = bpy.data.materials.new("Unrelated Material Name")
|
||||
mark_balloon_material(material, source_image, shared_normal)
|
||||
assert reusable_balloon_material(
|
||||
"unused",
|
||||
"unused",
|
||||
source_image,
|
||||
normal_required=True,
|
||||
) is material
|
||||
|
||||
Reference in New Issue
Block a user