This commit is contained in:
Andrej730
2025-01-20 16:16:33 +05:00
parent 3ad247b9a7
commit c0499a2c88
8 changed files with 13 additions and 16 deletions
-2
View File
@@ -336,5 +336,3 @@ def load_post(scene):
WallAxisDecorator.install(bpy.context) WallAxisDecorator.install(bpy.context)
if model_props.show_slab_direction: if model_props.show_slab_direction:
SlabDirectionDecorator.install(bpy.context) SlabDirectionDecorator.install(bpy.context)
@@ -3052,7 +3052,6 @@ class OverrideMove(bpy.types.Operator):
obj.select_set(True) obj.select_set(True)
self.new_active_obj = obj self.new_active_obj = obj
# Get aggregates # Get aggregates
props = context.scene.BIMAggregateProperties props = context.scene.BIMAggregateProperties
not_editing_objs = [o.obj for o in props.not_editing_objects] not_editing_objs = [o.obj for o in props.not_editing_objects]
@@ -33,6 +33,7 @@ def transparent_color(color, alpha=0.1):
color[3] = alpha color[3] = alpha
return color return color
def create_bounding_box(objs): def create_bounding_box(objs):
# Initialize the bounding box coordinates # Initialize the bounding box coordinates
min_x, min_y, min_z = float("inf"), float("inf"), float("inf") min_x, min_y, min_z = float("inf"), float("inf"), float("inf")
@@ -77,6 +78,7 @@ def create_bounding_box(objs):
return indices, edges return indices, edges
class NestDecorator: class NestDecorator:
is_installed = False is_installed = False
handlers = [] handlers = []
@@ -227,12 +229,8 @@ class NestModeDecorator:
if cls.is_installed: if cls.is_installed:
cls.uninstall() cls.uninstall()
handler = cls() handler = cls()
cls.handlers.append( cls.handlers.append(SpaceView3D.draw_handler_add(handler.draw_nest_name, (context,), "WINDOW", "POST_PIXEL"))
SpaceView3D.draw_handler_add(handler.draw_nest_name, (context,), "WINDOW", "POST_PIXEL") cls.handlers.append(SpaceView3D.draw_handler_add(handler.draw_nest_empty, (context,), "WINDOW", "POST_VIEW"))
)
cls.handlers.append(
SpaceView3D.draw_handler_add(handler.draw_nest_empty, (context,), "WINDOW", "POST_VIEW")
)
cls.is_installed = True cls.is_installed = True
@classmethod @classmethod
@@ -49,6 +49,7 @@ class BIMObjectNestProperties(PropertyGroup):
is_editing: BoolProperty(name="Is Editing") is_editing: BoolProperty(name="Is Editing")
relating_object: PointerProperty(name="Nest Host", type=bpy.types.Object, update=update_relating_object) relating_object: PointerProperty(name="Nest Host", type=bpy.types.Object, update=update_relating_object)
def update_nest_decorator(self, context): def update_nest_decorator(self, context):
if self.nest_decorator: if self.nest_decorator:
NestDecorator.install(bpy.context) NestDecorator.install(bpy.context)
+1
View File
@@ -24,6 +24,7 @@ if TYPE_CHECKING:
import ifcopenshell import ifcopenshell
import bonsai.tool as tool import bonsai.tool as tool
def enable_editing_nest(nest, obj=None): def enable_editing_nest(nest, obj=None):
nest.enable_editing(obj) nest.enable_editing(obj)
@@ -45,6 +45,7 @@ def validate_type(
:return: True if the representation type was set and it is a valid :return: True if the representation type was set and it is a valid
combination, or False otherwise. combination, or False otherwise.
""" """
def is_operand(item): def is_operand(item):
return ( return (
item.is_a("IfcBooleanResult") item.is_a("IfcBooleanResult")
@@ -39,7 +39,6 @@ class TestRemoveBoolean(test.bootstrap.IFC4):
assert set(rep.Items) == {first, second} assert set(rep.Items) == {first, second}
assert not self.file.by_type("IfcBooleanResult") assert not self.file.by_type("IfcBooleanResult")
def test_removing_a_top_level_nested_boolean(self): def test_removing_a_top_level_nested_boolean(self):
ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcProject") ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcProject")
model = ifcopenshell.api.context.add_context(self.file, context_type="Model") model = ifcopenshell.api.context.add_context(self.file, context_type="Model")