mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
A preference for locking grids upon import
This commit is contained in:
@@ -562,8 +562,9 @@ class IfcImporter:
|
|||||||
if grid.Representation:
|
if grid.Representation:
|
||||||
shape = ifcopenshell.geom.create_shape(self.settings_2d, grid)
|
shape = ifcopenshell.geom.create_shape(self.settings_2d, grid)
|
||||||
grid_obj = self.create_product(grid, shape)
|
grid_obj = self.create_product(grid, shape)
|
||||||
grid_obj.lock_location = (True, True, True)
|
if bpy.context.preferences.addons["blenderbim"].preferences.lock_grids_on_import:
|
||||||
grid_obj.lock_rotation = (True, True, True)
|
grid_obj.lock_location = (True, True, True)
|
||||||
|
grid_obj.lock_rotation = (True, True, True)
|
||||||
collection = bpy.data.collections.new(self.get_name(grid))
|
collection = bpy.data.collections.new(self.get_name(grid))
|
||||||
u_axes = bpy.data.collections.new("UAxes")
|
u_axes = bpy.data.collections.new("UAxes")
|
||||||
collection.children.link(u_axes)
|
collection.children.link(u_axes)
|
||||||
@@ -581,8 +582,9 @@ class IfcImporter:
|
|||||||
shape = ifcopenshell.geom.create_shape(self.settings_2d, axis.AxisCurve)
|
shape = ifcopenshell.geom.create_shape(self.settings_2d, axis.AxisCurve)
|
||||||
mesh = self.create_mesh(axis, shape)
|
mesh = self.create_mesh(axis, shape)
|
||||||
obj = bpy.data.objects.new(f"IfcGridAxis/{axis.AxisTag}", mesh)
|
obj = bpy.data.objects.new(f"IfcGridAxis/{axis.AxisTag}", mesh)
|
||||||
obj.lock_location = (True, True, True)
|
if bpy.context.preferences.addons["blenderbim"].preferences.lock_grids_on_import:
|
||||||
obj.lock_rotation = (True, True, True)
|
obj.lock_location = (True, True, True)
|
||||||
|
obj.lock_rotation = (True, True, True)
|
||||||
self.link_element(axis, obj)
|
self.link_element(axis, obj)
|
||||||
self.set_matrix_world(obj, grid_obj.matrix_world)
|
self.set_matrix_world(obj, grid_obj.matrix_world)
|
||||||
grid_collection.objects.link(obj)
|
grid_collection.objects.link(obj)
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
should_play_chaching_sound: BoolProperty(
|
should_play_chaching_sound: BoolProperty(
|
||||||
name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False
|
name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False
|
||||||
)
|
)
|
||||||
|
lock_grids_on_import: BoolProperty(
|
||||||
|
name="Will lock grids upon import", default=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -149,6 +154,8 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
row.prop(self, "should_hide_empty_props")
|
row.prop(self, "should_hide_empty_props")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(self, "should_play_chaching_sound")
|
row.prop(self, "should_play_chaching_sound")
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(self, "lock_grids_on_import")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(context.scene.BIMProjectProperties, "should_disable_undo_on_save")
|
row.prop(context.scene.BIMProjectProperties, "should_disable_undo_on_save")
|
||||||
|
|||||||
Reference in New Issue
Block a user