diff --git a/src/bonsai/bonsai/tool/blender.py b/src/bonsai/bonsai/tool/blender.py index 0c73d58599..40c5059563 100644 --- a/src/bonsai/bonsai/tool/blender.py +++ b/src/bonsai/bonsai/tool/blender.py @@ -1328,6 +1328,74 @@ class Blender(bonsai.core.tool.Blender): return True class Modifier: + # ---------------------------------------------------------------------- + # Backward-compat shims for callers still using the pre-refactor API. + # The is_ predicates now live on tool.Parametric; the Array helper + # bag now lives on tool.Array. PR4 migrates each caller; these shims + # are removed in PR5's cleanup. + # ---------------------------------------------------------------------- + + @classmethod + def is_door(cls, element: entity_instance) -> bool: + return tool.Parametric.is_door(element) + + @classmethod + def is_railing(cls, element: entity_instance) -> bool: + return tool.Parametric.is_railing(element) + + @classmethod + def is_roof(cls, element: entity_instance) -> bool: + return tool.Parametric.is_roof(element) + + @classmethod + def is_stair(cls, element: entity_instance) -> bool: + return tool.Parametric.is_stair(element) + + @classmethod + def is_wall(cls, element: entity_instance) -> bool: + return tool.Parametric.is_wall(element) + + @classmethod + def is_window(cls, element: entity_instance) -> bool: + return tool.Parametric.is_window(element) + + class Array: + @classmethod + def bake_children_transform(cls, parent_element: ifcopenshell.entity_instance, item: int) -> None: + tool.Array.bake_children_transform(parent_element, item) + + @classmethod + def constrain_children_to_parent(cls, parent_element: ifcopenshell.entity_instance) -> None: + tool.Array.constrain_children_to_parent(parent_element) + + @classmethod + def get_all_children_objects(cls, parent_element: ifcopenshell.entity_instance) -> list: + return tool.Array.get_all_children_objects(parent_element) + + @classmethod + def get_all_objects(cls, parent_element: ifcopenshell.entity_instance) -> list: + return tool.Array.get_all_objects(parent_element) + + @classmethod + def get_children_objects(cls, modifier_data: dict) -> list: + return tool.Array.get_children_objects(modifier_data) + + @classmethod + def get_modifiers_data(cls, parent_element: ifcopenshell.entity_instance): + return tool.Array.get_modifiers_data(parent_element) + + @classmethod + def remove_constraints(cls, parent_element: ifcopenshell.entity_instance) -> None: + tool.Array.remove_constraints(parent_element) + + @classmethod + def set_children_lock_state( + cls, parent_element: ifcopenshell.entity_instance, item: int, lock: bool + ) -> None: + tool.Array.set_children_lock_state(parent_element, item, lock) + + # ---------------------------------------------------------------------- + @classmethod def try_applying_edit_mode(cls, obj: bpy.types.Object, element: entity_instance) -> bool: """Tries to validate the current BIM modifier parameters for the active object