Title: Bonsai: Update Current Style no longer reloads external .blend styles (regression from #8342) · Issue #9477 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: Update Current Style no longer reloads external .blend styles (regression from #8342) · Issue #9477 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: Update Current Style no longer reloads external .blend styles (regression from #8342) · Issue #9477 · IfcOpenShell/IfcOpenShell
Description: Problem The refresh button next to the style type dropdown in the Styles panel (bim.update_current_style, Update Current Style) no longer picks up changes made to an external .blend style. After editing and saving the material in the ref...
Open Graph Description: Problem The refresh button next to the style type dropdown in the Styles panel (bim.update_current_style, Update Current Style) no longer picks up changes made to an external .blend style. After ed...
X Description: Problem The refresh button next to the style type dropdown in the Styles panel (bim.update_current_style, Update Current Style) no longer picks up changes made to an external .blend style. After ed...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9477
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: Update Current Style no longer reloads external .blend styles (regression from #8342)","articleBody":"## Problem\n\nThe refresh button next to the style type dropdown in the Styles panel (`bim.update_current_style`, *Update Current Style*) no longer picks up changes made to an external `.blend` style. After editing and saving the material in the referenced `.blend`, clicking the button (or SHIFT+CLICK to update all styles) leaves the old material in the model.\n\nThis button was added in 6a2bbfa85c for #3293 (\"Option to batch-reload all external IFC styles\"), so reloading is its purpose.\n\n## Steps to reproduce\n\n1. Have an `IfcSurfaceStyle` with an `IfcExternallyDefinedSurfaceStyle` whose `Location` points to a material in a `.blend` file, loaded so the material is in External (Pretty) mode.\n2. Change that material in the `.blend` file and save it.\n3. In Bonsai, select an object that uses the style and click *Update Current Style* in the Styles panel.\n\n**Expected:** the material is re-appended from the `.blend` and shows the changes.\n**Actual:** nothing changes.\n\n## Cause\n\n#8342 (c9f991a690) introduced dual-branch materials: the external node graph is copied into the material once, next to a flat branch, with outputs `BIM_Output_External` and `BIM_Output_Flat`. For those materials, `Style.switch_shading()` now just toggles which output is active and returns:\n\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/23f3874de19d398451f8926722dc33c21aff5b74/src/bonsai/bonsai/tool/style.py#L977-L984\n\n`UpdateCurrentStyle` only sets `active_style_type` on each material, whose update callback ends in `switch_shading()`:\n\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/23f3874de19d398451f8926722dc33c21aff5b74/src/bonsai/bonsai/bim/module/style/operator.py#L208-L251\n\nSo `bim.activate_external_style`, the only code path that re-appends the material from the `.blend`, is never reached. Before #8342, `switch_shading(\"External\")` always called `bim.activate_external_style`, which is why the button used to reload the style.\n\nTrace from temporary debug prints, clicking the button on a wall whose materials were already External:\n\n```\nmat 'GS_Red Hollow Clay Blocks' (#4086400): 'External' -> 'External'\nupdate_shading_style: has_blender_external_style=True Location='../../../../OD_Submodules/OD_Textures/Materials.blend'\nswitch_shading: branch outputs: ext='BIM_Output_External' fast='BIM_Output_Flat'\n -> dual-branch: activated BIM_Output_External\n```\n\nAffects `v0.9.0` (checked at 23f3874de1) and `v0.8.0`.\n\n## Proposed fix\n\nKeep the fast path in `switch_shading()`: viewport shading changes and the Flat/Pretty toggle set `active_style_type` on every material and shouldn't read from disk. In `UpdateCurrentStyle`, when the style type is External, call `bim.activate_external_style` for each updated material, and for all IFC materials on SHIFT+CLICK. For dual-branch materials this goes through `Style.update_external_branch()`, which replaces only the external branch and leaves the flat branch alone. PR to follow.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-09-11T20:15:25Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9477"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8d4c496e-6735-7248-b1d1-03b6e24d0d53 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6E6:1AC6A2:8D395C:BE1AE5:6B04AA7A |
| html-safe-nonce | 97dd0af76b1ff55eb2c5e4874ce6dfa64102be1beefb24cc2edfb00557a760d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkU2OjFBQzZBMjo4RDM5NUM6QkUxQUU1OjZCMDRBQTdBIiwidmlzaXRvcl9pZCI6IjQ1NDEwNDk5NzAxNjU1OTA2NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 359b23dcf927c8185efe88b47745a9d5d9ea9fc6effa11df26d4c6dceadf7e11 |
| hovercard-subject-tag | issue:5428582815 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/9477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b23611cd569e0bd8ac598904ba5438308a96b59ca0b614f774c0ad8b85ca7b7d/IfcOpenShell/IfcOpenShell/issues/9477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b23611cd569e0bd8ac598904ba5438308a96b59ca0b614f774c0ad8b85ca7b7d/IfcOpenShell/IfcOpenShell/issues/9477 |
| og:image:alt | Problem The refresh button next to the style type dropdown in the Styles panel (bim.update_current_style, Update Current Style) no longer picks up changes made to an external .blend style. After ed... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theoryshaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width