feat: implement separate geometry handling for panorama mask regions
- Replace Delete Geometry with Separate Geometry in O Image Depth Panorama to manage low and high mask areas independently. - Adjust depth processing to ensure low mask regions are displaced to Dome Radius while high mask regions follow existing depth rules. - Update tests to validate new behavior, ensuring outputs align with expected results for both mask states. - Enhance material handling by introducing emission strength in the shadeless group.
This commit is contained in:
@@ -106,7 +106,7 @@ def artifacts(tmp_path, source):
|
||||
cleanup_material_color_input(operator.color_path)
|
||||
|
||||
|
||||
def test_result_replaces_source_with_zero_rotation_and_shadeless_material(source, artifacts, monkeypatch):
|
||||
def test_result_replaces_source_with_zero_rotation_and_emission_material(source, artifacts, monkeypatch):
|
||||
result, operator = artifacts
|
||||
from anyimage.common.node import load_node_group
|
||||
saved = load_node_group("O Image Depth Panorama")
|
||||
@@ -123,11 +123,14 @@ def test_result_replaces_source_with_zero_rotation_and_shadeless_material(source
|
||||
np.testing.assert_allclose(obj.scale, matrix.to_scale(), atol=1e-6)
|
||||
np.testing.assert_array_equal(obj.rotation_euler, (0, 0, 0))
|
||||
material = obj.data.materials[0]
|
||||
assert not any(n.bl_idname == "ShaderNodeUVMap" for n in material.node_tree.nodes)
|
||||
assert any(n.type == "GROUP" and n.node_tree.name == "O Shadeless" for n in material.node_tree.nodes)
|
||||
assert [n.node_tree.name for n in material.node_tree.nodes if n.type == "GROUP"] == ["O Shadeless"]
|
||||
texture = next(n for n in material.node_tree.nodes if n.type == "TEX_IMAGE")
|
||||
nodes = material.node_tree.nodes
|
||||
assert not any(n.bl_idname == "ShaderNodeUVMap" or n.type == "GROUP" for n in nodes)
|
||||
texture = next(n for n in nodes if n.type == "TEX_IMAGE")
|
||||
emission = next(n for n in nodes if n.type == "EMISSION")
|
||||
output = next(n for n in nodes if n.type == "OUTPUT_MATERIAL")
|
||||
assert texture.extension == "REPEAT"
|
||||
assert emission.inputs["Color"].links[0].from_socket == texture.outputs["Color"]
|
||||
assert output.inputs["Surface"].links[0].from_socket == emission.outputs["Emission"]
|
||||
assert bpy.context.view_layer.objects.active == obj
|
||||
assert all(image.packed_file for image in bpy.data.images if image.name.endswith(("_color.png", "_depth.exr")))
|
||||
graph = bpy.context.evaluated_depsgraph_get()
|
||||
|
||||
Reference in New Issue
Block a user