Bonsai loads another IFC than what I selected in Open IFC File Dialog !?

edited June 2025 in General

Sorry, I have to come back with my Bonsai not-working-for-me problems.

As already said, Bonsai will only work for me for a Blender session, only after I deactivated Bonsai, closed and reopened Blender. After a Blender restart, Bonsai will abort loading IFCs with an error Message, but it will not work as expected anyway. And deleting any (!) pycache Folders in the whole Blender Settings Folder before does not help in any way.

When I try to open this IFC from that path :

(Which BTW, is in IFC 4.0 not 4x3 format)

It will load that other IFC (blue highlighted), shown at the bottom instead !? :
(Which resides at a completely different path on disk)

Has anybody any clue how this can be possible ?

  • loading any another file than chosen in the Open IFC File Dialog at all
  • Discrepancy between File-I-want-to-open and File listed in Spatial Decomposition

Any clue of any hidden Bonsai Cache or Settings - which could lead to this strange behavior of Bonsai.
I mean I can try to open any path containing any IFC file - Bonsai will load that special File only again !?

Where could Bonsai save that outdated file/path information (which it takes as a parent order) at all ?

Well, there is a recent Blender file txt and a recent IFC file txt in Blender settings, both look inconspicuous - and deleteing these does not help either.

Comments

  • BTW,
    I already tested .... if, while testing Bonsai issues, I might have accidentally overwritten all those IFCs with that other IFC data at one point .... but when I open any of the IFCs, intended to open in Bonsai, in ODA's OpenIFCViewer, they still look like they were and should look like.

  • edited June 2025

    Looks like the culprit is my Startup.blend

    At least I started from scratch,

    • activating main AddOns first - restart - Bonsai - check
    • activating all Addons I could not live without - restart - Bonsai - check
    • carefully adapting main needed Blender Settings - restart - Bonsai - check
    • adding my Startup Blend - restart - Bonsai - check
      • restart - Bonsai - FAIL

    It's a pity Bonsai writes a few of those paths into the Blend File - here in my startup file when I overwrite it to update.
    (And seems to mix the somehow up - in/for IFC File Open Dialog)
    Also Pity that Blender saves its Settings in a not so non human readable *.blend format instead of an XML.
    Or pity that I have to save so many "global user settings" in a Startup.blend file instead.
    Pity that "Settings" (like used to in Modo) or worse, my Startup File - can go corrupt.

    I put already so much work in my Startup Files.
    (A bunch of template Cameras - set up with Photographer features, Wireframe ON 90% - no outline highlighted, Eevee Raytracing on, default Viewport Render mode, Dummy template Geometry, a few basic Materials, Statistics ON, Day/Night Light System, Palette Visibility and Location, ..........)

    90% of which would just be basic global always user/office standard Settings ....
    (like things as MMB = Pan, SPACEBAR = Tools, .... which are stored in Settings as it should ...)

  • No chance.
    Did my Settings from scratch. Even did my Startup File again. (Clean file, did Viewport Settings and such, but appended my Geometry, Lights Cameras and World Settings from the old Startup File)

    Then I updated and activated Bonsai. Open an IFC from Open File Dialog - Bonsai instead opens that other File again ....
    No clue what's going on there.

  • OK, it seems like I can load the File that I want - when I disable "Should start fresh Session" option in open dialog and open directly.

    But doing the same, disable fresh session, but with the "enable advanced Mode" - for loading from N-Panel, it will load that other IFC File instead again ....

    When opening my Startup.blend in a Text Editor and search for the name of that unwanted IFC which Bonsai prefers to open instead, I can find Name and Path inside my old Startup File.

    Unfortunately that unwanted IFC path also unwontedly found its way into my Startup File from scratch :(
    (Probably via appending previous "World" settings, which I also needed to import)

    Besides the unwanted Path, it looks like there are also many of my other IFCs I tried to open.
    And it looks like that unwanted path is placed either on top of - or mixed up with - data Speckle AddOn saved, also including Paths. Just that that unwanted IFC File/Path was never (!) used in Speckle, at least not the last 8-10 weeks.

    Nevertheless, I don't think it is ok that Bonsai uses/prefers that wrong IFC and path from my startup File - instead of just opening the IFC I choose in IFC Open File Dialog.

    I do not get why it seems to work to open the IFC I have chosen - when I deactivate "Should start fresh Session" - as the current open unsaved Blender File is of course also always a child of my (maybe) corrupt Startup.blend and is identical to a "fresh Session".

  • OK, it seems like I can load the File that I want - when I disable "Should start fresh Session" option in open dialog and open directly.

    Seems like it works for Blender 4.5 Beta only.
    In Blender 5.0 Alpha, the same workaround works for a single Blender Session only though.
    (Deactivating Blender - restart Blender and activating Bonsai works ok - also loads the desired file - closing Blender 5 and after a restart it will no more load an IFC, just the warning :

    os: Darwin
    os_version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041
    python_version: 3.11.11
    architecture: ('64bit', '')
    machine: arm64
    processor: arm
    blender_version: 5.0.0 Alpha
    bonsai_version: 0.8.3-alpha250623
    bonsai_commit_hash: 4574351
    bonsai_commit_date: 2025-06-23T19:06:16+05:00
    last_actions: 
    last_error: Traceback (most recent call last):
      File "/Users/user/Library/Application Support/Blender/5.0/extensions/.local/lib/python3.11/site-packages/bonsai/bim/module/project/operator.py", line 1004, in finish_loading_project
        bpy.ops.bim.load_project_elements()
      File "/Applications/Blender500.app/Contents/Resources/5.0/scripts/modules/bpy/ops.py", line 109, in __call__
        ret = _op_call(self.idname_py(), kw)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Error: Python: Traceback (most recent call last):
      File "/Users/usera/Library/Application Support/Blender/5.0/extensions/.local/lib/python3.11/site-packages/bonsai/bim/module/project/operator.py", line 1064, in execute
        bonsai.bim.schema.reload(self.file.schema_identifier)
        ^^^^^^^^^^^^^^^^^
    AttributeError: **module 'bonsai.bim' has no attribute 'schema'**
    Location: /Applications/Blender500.app/Contents/Resources/5.0/scripts/modules/bpy/ops.py:109
    
    
    ifc: US_POOL_HOUSE_BRICSCAD_IFC.ifc
    schema: IFC4X3
    preprocessor_version: IfcOpenShell 0.8.2-alpha250328
    originating_system: Bonsai 0.8.2-alpha250328-0bf065c
    
  • edited July 2025

    Latest Bonsai build ....
    Unfortunately I am still fighting with Bonsai loading another IFC than what I choose in Open IFC dialog.
    (With standard open IFC Project dialog AND with Advanced Mode in IFC Panel)

    I can only open an IFC of choice when I use the standard Open IFC Project - and deactivate "should start fresh session"
    (This workaround does not work with Advanced Mode though !?)

  • OMG

    I always wondered why no one of all here with decent Blender insight could help me.

    I think, after feels like 3 months of suffering, I think I finally found the Problem.

    It looks like at one point, when I had opened that IFC
    (that unwontedly always opens when I want to open any other IFC)

    • I had the Git dropdown expanded and accidentally hit the "Create 'Path/....' repository (Initialize a Git repository)" button
    • This setup/setting seems to be written in the current Blender File (Which originates from holy Startup Blend File in this case)
    • unfortunately ... after Bonsai testing and deleting all Bonsai/IFC stuff ... I did some updates to that unsaved file ... to update my Startup Blend File (File > Defaults > Save Startup File > Overwrite !)
    • This has contaminated my Startup.blend with the Git Setup and the unwanted Path and File
    • This led to, when trying to open any IFC File ... (and selecting "Should start fresh Session" option OR "Enable Advanced Mode") .... to load that unwanted Git repository linked File instead.
    • WTH

    If anybody at one point runs into the same problem,
    Solution was :

    • Check Git Tab's Settings for the File and its Path
    • go to that Folder and (temporarily) rename that File
    • open a new Blend file
    • now Git Tab recognizes that there is no File, so no more valid repository
    • go to Bonsai's "Quality and Coordination" Tab > Purge "everything" to delete any lost rests of IFC data
    • update your Startup Blend File (File > Defaults > Save Startup File > Overwrite !)
    • now all traces of Git repository settings in your Startup File should be gone

    At least for me Bonsai finally works again as for all other users and as expected.

    I can now again open any file I want and also choose any of the "Open IFC Project" Options like "Should start fresh Session" option and/or "Enable Advanced Mode".

    Finally peace in this part of the world again.

    Owura_qusteverugiMoult
Sign In or Register to comment.