- Implement tests for image layer functionality including alpha curve and depth layer behavior. - Create tests for image plane evaluation and modifier input handling. - Add tests to verify the saved asset inventory and its persistence. - Introduce tests for the documentation command to ensure correct project version deployment. - Validate the extension manifest structure and required permissions. - Develop tests for the packaging process, ensuring correct platform handling and dependency management. - Enhance image depth plane group functionality with new split threshold input and surface processing.
53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
import unittest
|
|
from types import SimpleNamespace
|
|
from tests.anyimage.common.support import load_common_modules
|
|
|
|
class ModifierInputsTest(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
cls.modules = load_common_modules()
|
|
|
|
def test_runtime_modifier_enum_input_uses_string_identifier(self):
|
|
enum_items = (
|
|
SimpleNamespace(identifier="SURFACE"),
|
|
SimpleNamespace(identifier="BALLOON"),
|
|
)
|
|
value_property = SimpleNamespace(type="ENUM", enum_items=enum_items)
|
|
input_slot = SimpleNamespace(
|
|
value=None,
|
|
bl_rna=SimpleNamespace(properties={"value": value_property}),
|
|
)
|
|
modifier = SimpleNamespace(
|
|
properties=SimpleNamespace(
|
|
inputs=SimpleNamespace(Shape=input_slot),
|
|
)
|
|
)
|
|
|
|
self.modules.object.set_modifier_input(modifier, "Shape", 1)
|
|
|
|
self.assertEqual(input_slot.value, "BALLOON")
|
|
|
|
|
|
def test_modifier_inputs_support_rna_and_dictionary_values(self):
|
|
value_property = SimpleNamespace(type="FLOAT")
|
|
input_slot = SimpleNamespace(
|
|
value=None,
|
|
bl_rna=SimpleNamespace(properties={"value": value_property}),
|
|
)
|
|
runtime_modifier = SimpleNamespace(
|
|
properties=SimpleNamespace(
|
|
inputs=SimpleNamespace(Thickness=input_slot),
|
|
)
|
|
)
|
|
|
|
self.modules.object.set_modifier_input(runtime_modifier, "Thickness", 2.0)
|
|
|
|
self.assertEqual(input_slot.value, 2.0)
|
|
|
|
class LegacyModifier(dict):
|
|
properties = None
|
|
|
|
legacy_modifier = LegacyModifier()
|
|
self.modules.object.set_modifier_input(legacy_modifier, "Shape", 1)
|
|
self.assertEqual(legacy_modifier["Shape"], 1)
|