(scene)
| 358 | |
| 359 | @persistent |
| 360 | def load_post(scene): |
| 361 | global global_subscription_owner |
| 362 | active_object_key = bpy.types.LayerObjects, "active" |
| 363 | bpy.msgbus.subscribe_rna( |
| 364 | key=active_object_key, owner=global_subscription_owner, args=(), notify=active_object_callback |
| 365 | ) |
| 366 | |
| 367 | ifcopenshell.api.owner.settings.get_user = get_user |
| 368 | ifcopenshell.api.owner.settings.get_application = get_application |
| 369 | AuthoringData.type_thumbnails = {} |
| 370 | |
| 371 | preferences = tool.Blender.get_addon_preferences() |
| 372 | if not preferences.should_setup_toolbar: |
| 373 | tool.Blender.unregister_toolbar() |
| 374 | |
| 375 | if preferences.should_setup_workspace: |
| 376 | if "BIM" in bpy.data.workspaces: |
| 377 | if preferences.activate_workspace: |
| 378 | bpy.context.window.workspace = bpy.data.workspaces["BIM"] |
| 379 | else: |
| 380 | bpy.ops.workspace.append_activate(idname="BIM", filepath=os.path.join(cwd, "data", "workspace.blend")) |
| 381 | |
| 382 | # After appending the workspace to ensure BIM viewport is affected. |
| 383 | subscribe_to_viewport_shading_changes() |
| 384 | |
| 385 | # To improve usability for new users, we hijack the scene properties |
| 386 | # tab. We override default scene properties panels with our own poll |
| 387 | # to hide them unless the user has chosen to view Blender properties. |
| 388 | for panel in tool.Blender.get_scene_panels_list(): |
| 389 | if panel in bonsai.bim.original_scene_panels_polls: |
| 390 | continue |
| 391 | tool.Blender.override_scene_panel(panel) |
| 392 | tool.Blender.setup_tabs() |
| 393 | |
| 394 | if tool.Ifc.get() and bpy.data.is_saved: |
| 395 | props = tool.Blender.get_bim_props() |
| 396 | props.has_blend_warning = True |
| 397 | |
| 398 | # Bonsai overlays |
| 399 | georeference_props = tool.Georeference.get_georeference_props() |
| 400 | aggregate_props = tool.Aggregate.get_aggregate_props() |
| 401 | nest_props = tool.Nest.get_nest_props() |
| 402 | model_props = tool.Model.get_model_props() |
| 403 | GeoreferenceDecorator.uninstall() |
| 404 | AggregateDecorator.uninstall() |
| 405 | NestDecorator.uninstall() |
| 406 | WallAxisDecorator.uninstall() |
| 407 | SlabDirectionDecorator.uninstall() |
| 408 | if georeference_props.should_visualise: |
| 409 | GeoreferenceDecorator.install(bpy.context) |
| 410 | if aggregate_props.aggregate_decorator: |
| 411 | AggregateDecorator.install(bpy.context) |
| 412 | if nest_props.nest_decorator: |
| 413 | NestDecorator.install(bpy.context) |
| 414 | if model_props.show_wall_axis: |
| 415 | WallAxisDecorator.install(bpy.context) |
| 416 | if model_props.show_slab_direction: |
| 417 | SlabDirectionDecorator.install(bpy.context) |
nothing calls this directly
no test coverage detected