mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +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 = bpy.data.materials.new('Section Override')
|
||||||
material.use_nodes = True
|
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 \
|
if not (obj.data \
|
||||||
and hasattr(obj.data, 'materials') \
|
and hasattr(obj.data, 'materials') \
|
||||||
and obj.data.materials \
|
and obj.data.materials \
|
||||||
|
|||||||
@@ -849,6 +849,7 @@ class BIMProperties(PropertyGroup):
|
|||||||
property_set_templates: EnumProperty(items=getPropertySetTemplates, name="Pset Template Files")
|
property_set_templates: EnumProperty(items=getPropertySetTemplates, name="Pset Template Files")
|
||||||
active_property_set_template: PointerProperty(type=PropertySetTemplate)
|
active_property_set_template: PointerProperty(type=PropertySetTemplate)
|
||||||
property_templates: CollectionProperty(name='Property Templates', type=PropertyTemplate)
|
property_templates: CollectionProperty(name='Property Templates', type=PropertyTemplate)
|
||||||
|
should_section_selected_objects: BoolProperty(name="Section Selected Objects", default=False)
|
||||||
|
|
||||||
|
|
||||||
class BCFProperties(PropertyGroup):
|
class BCFProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -449,6 +449,10 @@ class BIM_PT_section_plane(Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.use_property_split = True
|
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 = layout.row(align=True)
|
||||||
row.operator('bim.add_section_plane')
|
row.operator('bim.add_section_plane')
|
||||||
|
|||||||
Reference in New Issue
Block a user