René's URL Explorer Experiment


Title: Bonsai: linked IFC models render white in Material Preview / Rendered (link cache only sets diffuse_color) and purposed fix · Issue #10140 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Bonsai: linked IFC models render white in Material Preview / Rendered (link cache only sets diffuse_color) and purposed fix · Issue #10140 · IfcOpenShell/IfcOpenShell

X Title: Bonsai: linked IFC models render white in Material Preview / Rendered (link cache only sets diffuse_color) and purposed fix · Issue #10140 · IfcOpenShell/IfcOpenShell

Description: Bug Description Bonsai / Blender: 0.9.0-post1 / 5.2 LTS (Windows). Same code on the v0.8.0 branch today. What happens Linking an IFC (Project > Links > Link IFC) shows the correct colours in Solid view, but every material is white in Mat...

Open Graph Description: Bug Description Bonsai / Blender: 0.9.0-post1 / 5.2 LTS (Windows). Same code on the v0.8.0 branch today. What happens Linking an IFC (Project > Links > Link IFC) shows the correct colours in Solid ...

X Description: Bug Description Bonsai / Blender: 0.9.0-post1 / 5.2 LTS (Windows). Same code on the v0.8.0 branch today. What happens Linking an IFC (Project > Links > Link IFC) shows the correct colours in ...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10140

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: linked IFC models render white in Material Preview / Rendered (link cache only sets diffuse_color) and purposed fix","articleBody":"### Bug Description\n\n**Bonsai / Blender:** 0.9.0-post1 / 5.2 LTS (Windows). Same code on the v0.8.0 branch today.\n\n### What happens\nLinking an IFC (Project > Links > Link IFC) shows the correct colours in Solid view, but every material is\nwhite in Material Preview and Rendered (EEVEE and Cycles). Opening the same IFC normally renders in colour.\nThis makes linked models unusable for rendering, which is where linking helps most for big files.\n\n### Steps\n1. Link any IFC with coloured surface styles (Project > Links > Link IFC).\n2. Switch the viewport to Material Preview or render.\n3. Everything is white. In the `.ifc.cache.blend`, each material's `diffuse_color` is right but its\n   Principled BSDF Base Color is the default 0.8 grey/white.\n\n### Cause\n`LoadLinkedProject` creates the cache materials with only the viewport colour:\n\n- `execute()` > `process_chunk()`: `bpy.data.materials.new(\"Chunk\")` + `blender_mat.diffuse_color = mat`\n- `process_occurrence()`: `bpy.data.materials.new(material_name)` + `blender_mat.diffuse_color = diffuse`\n\nIn Blender 5.x `materials.new()` comes with a Principled BSDF (checked on 5.2), and nothing sets its Base Color.\nTransparency is also only in the viewport alpha, so glass renders opaque.\n\n### Suggested fix\nSmall helper used at both places, so the shader matches the viewport colour (diff attached, ~20 lines,\nformatted with black -l 120):\n\n```python\ndef create_flat_material(self, name: str, rgba: tuple[float, ...]) -> bpy.types.Material:\n    \"\"\"Material whose shader matches its viewport colour, so linked models render in colour.\"\"\"\n    material = bpy.data.materials.new(name)\n    material.diffuse_color = rgba\n    if material.node_tree:\n        bsdf = next((n for n in material.node_tree.nodes if n.type == \"BSDF_PRINCIPLED\"), None)\n        if bsdf:\n            bsdf.inputs[\"Base Color\"].default_value = (*rgba[:3], 1.0)\n            bsdf.inputs[\"Alpha\"].default_value = rgba[3]\n    if rgba[3] \u003c 1.0:\n        material.surface_render_method = \"BLENDED\"\n    return material\n```\n\nI've tested the same logic on real link caches: a fresh link of a 1,290-object model gave 61 cache\nmaterials, all rendering with their Solid-view colour afterwards (before/after Cycles render attached).\nIn the meantime I'm using a small add-on that applies it in a `save_pre` handler when the cache is saved.\n\n### Possibly worth a follow-up\n- Cache materials are deduplicated by colour, so different IFC styles with the same colour (e.g. \"Glass\" and\n  \"reglit\") become one material, and the names become `Chunk` / `r-g-b-a`. Keeping the style name (or\n  deduplicating by style id) would let users swap linked materials for render materials by name.\n- The colours arrive gamma-adjusted from the iterator (an IFC value of 0.44 becomes 0.194, i.e. squared).\n  Just noting it in case it isn't intended.\n\nHappy to open a PR with this if it's the right direction.\n\n*Disclosure (per AGENTS.md): the investigation, the suggested code and the workaround add-on were written\nwith the assistance of an AI coding tool; I've reviewed and tested them.*\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/sir306","@type":"Person","name":"sir306"},"datePublished":"2026-11-05T23:50:51Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10140"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:18cc3fe2-d213-bc58-a813-b291db5b3aff
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB728:17C468:30877:4313C:6B04617B
html-safe-nonce176f7cba97fe9ced8170c6ef52b3fe135e2e539017f2f20a1624ba69bfa77b31
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzI4OjE3QzQ2ODozMDg3Nzo0MzEzQzo2QjA0NjE3QiIsInZpc2l0b3JfaWQiOiI1MjQ1MzYxNTQyNjgzOTM4NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf1b95078fed91eb53ffd8cf4d61caa5457f7ce5909667448676e0cf2bf6aa49d
hovercard-subject-tagissue:6233790727
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/10140/issue_layout
twitter:imagehttps://opengraph.githubassets.com/84212e99a5b3e58af43a2309d8c067d25c03eca8d0932225fd2ebf5ee4afa7a4/IfcOpenShell/IfcOpenShell/issues/10140
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/84212e99a5b3e58af43a2309d8c067d25c03eca8d0932225fd2ebf5ee4afa7a4/IfcOpenShell/IfcOpenShell/issues/10140
og:image:altBug Description Bonsai / Blender: 0.9.0-post1 / 5.2 LTS (Windows). Same code on the v0.8.0 branch today. What happens Linking an IFC (Project > Links > Link IFC) shows the correct colours in Solid ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesir306
hostnamegithub.com
expected-hostnamegithub.com
None2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release03e114520787ad27289207f153520ef97461127c
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/10140#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10140
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10140
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10140
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10140
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10140
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests936 (936)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10140
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10140
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
#10279https://github.com/IfcOpenShell/IfcOpenShell/pull/10279
#10179https://github.com/IfcOpenShell/IfcOpenShell/pull/10179
Bonsai: linked IFC models render white in Material Preview / Rendered (link cache only sets diffuse_color) and purposed fixhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10140#top
#10279https://github.com/IfcOpenShell/IfcOpenShell/pull/10279
#10179https://github.com/IfcOpenShell/IfcOpenShell/pull/10179
https://github.com/sir306
sir306https://github.com/sir306
on Nov 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10140#issue-6233790727
sir306https://github.com/sir306
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
on Nov 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10140#event-35298700962
sir306https://github.com/sir306
on Nov 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10140#event-35298776987
https://github.com/3adoshka
3adoshkahttps://github.com/3adoshka
on Nov 20, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10140#issuecomment-7025847084
#10279https://github.com/IfcOpenShell/IfcOpenShell/pull/10279
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10140
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10140
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.