mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
New feature to only apply section planes to specific objects
This commit is contained in:
@@ -1927,7 +1927,12 @@ class AddSectionPlane(bpy.types.Operator):
|
||||
material = bpy.data.materials.new('Section Override')
|
||||
material.use_nodes = True
|
||||
|
||||
for obj in bpy.context.visible_objects:
|
||||
if bpy.context.scene.BIMProperties.should_section_selected_objects:
|
||||
objects = bpy.context.selected_objects
|
||||
else:
|
||||
objects = bpy.context.visible_objects
|
||||
|
||||
for obj in objects:
|
||||
if not (obj.data \
|
||||
and hasattr(obj.data, 'materials') \
|
||||
and obj.data.materials \
|
||||
|
||||
@@ -849,6 +849,7 @@ class BIMProperties(PropertyGroup):
|
||||
property_set_templates: EnumProperty(items=getPropertySetTemplates, name="Pset Template Files")
|
||||
active_property_set_template: PointerProperty(type=PropertySetTemplate)
|
||||
property_templates: CollectionProperty(name='Property Templates', type=PropertyTemplate)
|
||||
should_section_selected_objects: BoolProperty(name="Section Selected Objects", default=False)
|
||||
|
||||
|
||||
class BCFProperties(PropertyGroup):
|
||||
|
||||
@@ -449,6 +449,10 @@ class BIM_PT_section_plane(Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
props = bpy.context.scene.BIMProperties
|
||||
|
||||
row = layout.row()
|
||||
row.prop(props, 'should_section_selected_objects')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator('bim.add_section_plane')
|
||||
|
||||
Reference in New Issue
Block a user