Title: `bim.update_current_style` — switching to External style has no visible effect in the viewport · Issue #7990 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: `bim.update_current_style` — switching to External style has no visible effect in the viewport · Issue #7990 · IfcOpenShell/IfcOpenShell
X Title: `bim.update_current_style` — switching to External style has no visible effect in the viewport · Issue #7990 · IfcOpenShell/IfcOpenShell
Description: Bug Description Description: Clicking the "Update Current Style" button (the refresh icon in the Styles panel) with the style type set to External does nothing visually in the viewport, even when the object is selected and the material h...
Open Graph Description: Bug Description Description: Clicking the "Update Current Style" button (the refresh icon in the Styles panel) with the style type set to External does nothing visually in the viewport, even when t...
X Description: Bug Description Description: Clicking the "Update Current Style" button (the refresh icon in the Styles panel) with the style type set to External does nothing visually in the viewport, e...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/7990
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`bim.update_current_style` — switching to External style has no visible effect in the viewport","articleBody":"### Bug Description\n\n**Description:**\n\nClicking the \"Update Current Style\" button (the refresh icon in the Styles panel) with the style type set to `External` does nothing visually in the viewport, even when the object is selected and the material has a valid `IfcExternallyDefinedSurfaceStyle` pointing to a `.blend` file.\n\n**Root cause (two compounding problems):**\n\n1. **Fast-path flip is a no-op when state is already External.** `switch_shading` has a fast path for materials that already have both `BIM_Output_External` and `BIM_Output_Flat` nodes: it just flips `is_active_output` between them. However, after `activate_external_style` first sets up the dual-branch, `BIM_Output_External` starts as the active output. Clicking the button again reads `active_style_type = 'External'`, finds the dual-branch, sets `ext.is_active_output = True` (already True) and `fast.is_active_output = False` (already False) — a complete no-op.\n \n2. **Even when the flip does execute, `material.update_tag()` alone does not trigger a viewport redraw.** Blender does not re-evaluate the shader from a material-level `update_tag()` call alone; `node_tree.update_tag()` and `view_layer.update()` are also required.\n \n\n**Fix:**\n\nRemove the fast-path entirely for the External case. Always call `bpy.ops.bim.activate_external_style`, which re-loads the latest material from the `.blend` file, rebuilds the external branch via `update_external_branch` / `setup_dual_branch`, and goes through Blender's normal operator path (clipboard copy/paste) which reliably triggers a viewport refresh.\n\n**Steps to reproduce:**\n\n1. Open a model with an `IfcExternallyDefinedSurfaceStyle` pointing to a `.blend` file\n2. Select an object using that style\n3. Ensure the style type dropdown shows `External`\n4. Click the refresh (update current style) button\n5. Viewport does not change\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-04-22T18:30:29Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/7990"}
| 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:ced46651-72a5-dc91-5548-092e8bfb2725 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFE6:2F671E:48FC28:61012D:6B04BE36 |
| html-safe-nonce | 8230abd0298a7a28256e7133523f69dafed501236aad90a550391dde5d0e304b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkU2OjJGNjcxRTo0OEZDMjg6NjEwMTJEOjZCMDRCRTM2IiwidmlzaXRvcl9pZCI6Ijg0Nzg3MjYxODE0MDA1NzE0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2167e7d38ae5a92ec25871631f936ecbd3f1af56edea4d9258fee44e74f6bda2 |
| hovercard-subject-tag | issue:4311070591 |
| 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/7990/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f99f45bf9c162ca523d48842eaae0a329eb45026d0778e7cf1ade70d974b8914/IfcOpenShell/IfcOpenShell/issues/7990 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f99f45bf9c162ca523d48842eaae0a329eb45026d0778e7cf1ade70d974b8914/IfcOpenShell/IfcOpenShell/issues/7990 |
| og:image:alt | Bug Description Description: Clicking the "Update Current Style" button (the refresh icon in the Styles panel) with the style type set to External does nothing visually in the viewport, even when t... |
| 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 | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| 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 | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| 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