Skip to content

Commit

Permalink
fixes: #4563
Browse files Browse the repository at this point in the history
  • Loading branch information
theoryshaw committed Apr 18, 2024
1 parent 3b637a0 commit ea6f0b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/blenderbim/blenderbim/bim/import_ifc.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,11 @@ def create_native_elements(self):
print("Done creating geometry")

def create_spatial_elements(self) -> None:
self.create_generic_elements(self.spatial_elements, unselectable=True)
if bpy.context.preferences.addons["blenderbim"].preferences.spatial_elements_unselectable:

This comment has been minimized.

Copy link
@Gorgious56

Gorgious56 Apr 18, 2024

Contributor

FWIW you can also do to avoid repetition

self.create_generic_elements(
    self.spatial_elements, 
    unselectable=bpy.context.preferences.addons["blenderbim"].preferences.spatial_elements_unselectable
)

Cheers

This comment has been minimized.

Copy link
@theoryshaw

theoryshaw Apr 18, 2024

Author Member

thanks @Gorgious56 , good to know!

self.create_generic_elements(self.spatial_elements, unselectable=True)
else:
self.create_generic_elements(self.spatial_elements, unselectable=False)


def create_elements(self) -> None:
self.create_generic_elements(self.elements)
Expand Down
5 changes: 5 additions & 0 deletions src/blenderbim/blenderbim/bim/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False
)
lock_grids_on_import: BoolProperty(name="Should Lock Grids By Default", default=True)
spatial_elements_unselectable: BoolProperty(name="Should Make Spatial Elements Unselectable By Default", default=True)
decorations_colour: bpy.props.FloatVectorProperty(
name="Decorations Colour", subtype="COLOR", default=(1, 1, 1, 1), min=0.0, max=1.0, size=4
)
Expand Down Expand Up @@ -285,6 +286,10 @@ def draw(self, context):
row.prop(self, "should_play_chaching_sound")
row = layout.row()
row.prop(self, "lock_grids_on_import")
row = layout.row()
row.prop(self, "spatial_elements_unselectable")



row = layout.row()
row.prop(context.scene.BIMProjectProperties, "should_disable_undo_on_save")
Expand Down

1 comment on commit ea6f0b0

@vitorhpmartins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theoryshaw thanks for this support.

Please sign in to comment.