mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Fix section planes not cutting through aggregates and appearing at cursor
This commit is contained in:
@@ -1921,6 +1921,7 @@ class AddSectionPlane(bpy.types.Operator):
|
|||||||
section.empty_display_type = 'SINGLE_ARROW'
|
section.empty_display_type = 'SINGLE_ARROW'
|
||||||
section.empty_display_size = 5
|
section.empty_display_size = 5
|
||||||
section.rotation_euler = Euler((radians(180.0), 0.0, 0.0), 'XYZ')
|
section.rotation_euler = Euler((radians(180.0), 0.0, 0.0), 'XYZ')
|
||||||
|
section.location = bpy.context.scene.cursor.location
|
||||||
section.show_in_front = True
|
section.show_in_front = True
|
||||||
collection = bpy.data.collections.get('Sections')
|
collection = bpy.data.collections.get('Sections')
|
||||||
if not collection:
|
if not collection:
|
||||||
@@ -2018,11 +2019,15 @@ class AddSectionPlane(bpy.types.Operator):
|
|||||||
material.use_nodes = True
|
material.use_nodes = True
|
||||||
|
|
||||||
if bpy.context.scene.BIMProperties.should_section_selected_objects:
|
if bpy.context.scene.BIMProperties.should_section_selected_objects:
|
||||||
objects = bpy.context.selected_objects
|
objects = list(bpy.context.selected_objects)
|
||||||
else:
|
else:
|
||||||
objects = bpy.context.visible_objects
|
objects = list(bpy.context.visible_objects)
|
||||||
|
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
|
aggregate = obj.instance_collection
|
||||||
|
if aggregate and 'IfcRelAggregates/' in aggregate.name:
|
||||||
|
for part in aggregate.objects:
|
||||||
|
objects.append(part)
|
||||||
if not (obj.data \
|
if not (obj.data \
|
||||||
and hasattr(obj.data, 'materials') \
|
and hasattr(obj.data, 'materials') \
|
||||||
and obj.data.materials \
|
and obj.data.materials \
|
||||||
|
|||||||
Reference in New Issue
Block a user