Fixed more overlooked context overrides... #3876

This commit is contained in:
Andrej730
2023-11-20 15:13:32 +05:00
parent ffce41be95
commit 4fba7461c2
3 changed files with 6 additions and 4 deletions
@@ -964,7 +964,8 @@ class ActivateBcfViewpoint(bpy.types.Operator):
context_override = {} context_override = {}
context_override["object"] = context_override["active_object"] = objs[0] context_override["object"] = context_override["active_object"] = objs[0]
context_override["selected_objects"] = context_override["selected_editable_objects"] = objs context_override["selected_objects"] = context_override["selected_editable_objects"] = objs
bpy.ops.object.hide_view_set(context_override, unselected=True) with context.temp_override(**context_override):
bpy.ops.object.hide_view_set(unselected=True)
context.area.type = old context.area.type = old
if viewpoint.visualization_info.components.view_setup_hints: if viewpoint.visualization_info.components.view_setup_hints:
@@ -985,7 +986,7 @@ class ActivateBcfViewpoint(bpy.types.Operator):
old = context.area.type old = context.area.type
context.area.type = "VIEW_3D" context.area.type = "VIEW_3D"
bpy.ops.object.select_pattern(pattern="IfcSpace/*") bpy.ops.object.select_pattern(pattern="IfcSpace/*")
bpy.ops.object.hide_view_set({}) bpy.ops.object.hide_view_set()
context.area.type = old context.area.type = old
def set_openings_visibility(self, is_visible, context): def set_openings_visibility(self, is_visible, context):
+2 -1
View File
@@ -638,7 +638,8 @@ class BIM_OT_remove_section_plane(bpy.types.Operator):
material.node_tree.nodes.remove(override) material.node_tree.nodes.remove(override)
bpy.data.node_groups.remove(bpy.data.node_groups.get("Section Override")) bpy.data.node_groups.remove(bpy.data.node_groups.get("Section Override"))
bpy.data.node_groups.remove(bpy.data.node_groups.get("Section Compare")) bpy.data.node_groups.remove(bpy.data.node_groups.get("Section Compare"))
bpy.ops.object.delete({"selected_objects": [context.active_object]}) with context.temp_override(selected_objects=[context.active_object]):
bpy.ops.object.delete()
class ReloadIfcFile(bpy.types.Operator, tool.Ifc.Operator): class ReloadIfcFile(bpy.types.Operator, tool.Ifc.Operator):
+1 -1
View File
@@ -803,7 +803,7 @@ class TestUpdateTextValue(NewFile):
assert obj is not None, obj assert obj is not None, obj
with bpy.context.temp_override(active_object=obj): with bpy.context.temp_override(active_object=obj):
bpy.ops.bim.enable_editing_text() bpy.ops.bim.enable_editing_text()
bpy.ops.bim.remove_text_literal(1) bpy.ops.bim.remove_text_literal(literal_prop_id=1)
props.literals[0].attributes["Literal"].string_value = "changed_value" props.literals[0].attributes["Literal"].string_value = "changed_value"
props.font_size = "2.5" props.font_size = "2.5"
bpy.ops.bim.disable_editing_text() bpy.ops.bim.disable_editing_text()