Title: Bonsai: New Project with a template that has a site — merged surface styles get no Blender material, style editor fails · Issue #10134 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: New Project with a template that has a site — merged surface styles get no Blender material, style editor fails · Issue #10134 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: New Project with a template that has a site — merged surface styles get no Blender material, style editor fails · Issue #10134 · IfcOpenShell/IfcOpenShell
Description: Bug Description Observation Creating a new project from a project template that contains an IfcSite (and its storeys) and surface styles: the styles are in the IFC afterwards, but none of them has a Blender material. Opening any of them ...
Open Graph Description: Bug Description Observation Creating a new project from a project template that contains an IfcSite (and its storeys) and surface styles: the styles are in the IFC afterwards, but none of them has ...
X Description: Bug Description Observation Creating a new project from a project template that contains an IfcSite (and its storeys) and surface styles: the styles are in the IFC afterwards, but none of them has ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10134
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: New Project with a template that has a site — merged surface styles get no Blender material, style editor fails","articleBody":"### Bug Description\n\n**Observation**\n\nCreating a new project from a project template that contains an `IfcSite` (and its storeys) **and** surface styles: the styles are in the IFC afterwards, but none of them has a Blender material. Opening any of them in the style editor (Surface → Shading/Render tab) fails:\n\n```\nFile \".../bonsai/bim/module/style/operator.py\", line 999, in execute\n msprops = tool.Style.get_material_style_props(material)\nFile \".../bonsai/tool/style.py\", line 70, in get_material_style_props\n return material.BIMStyleProperties\nAttributeError: 'NoneType' object has no attribute 'BIMStyleProperties'\n```\n\nMeasured with a template of 39 surface styles: after *New Project* 39 of 39 styles have no Blender material. After saving the project and opening it again with `bim.load_project`, all 39 have one and the style editor works. With `IFC4 Demo Template.ifc` (no site) there is no error. The same traceback was reported on Blender 5.4 alpha in the OSArch forum: https://community.osarch.org/discussion/3782/\n\n**Where it comes from**\n\n`core.create_project` has two paths:\n\n- Template with an `IfcSite`: `tool.Project.append_structure_from_template` (`tool/project.py`, line 133) merges the file with `ifcpatch` `MergeProjects`. Afterwards only orphan spatial elements get Blender objects (`create_objects_for_orphan_spatial_elements`, `bim/module/project/operator.py`, line 165). Nothing creates Blender materials for the merged `IfcSurfaceStyle`s.\n- Template without a site: `append_all_types_from_template` calls `bim.append_library_element` per type, which does create the style materials.\n\nThe first path came with ff143a1ddb45ce31cfc202463399a5966d2f8095 (Road and Bridge templates). None of the shipped templates has both a site and styles (Road/Bridge: site, no styles; Demo templates: styles, no site), so the shipped templates do not show it.\n\n**Minimal reproduction**\n\n1. Put an IFC4 template with an `IfcSite` and at least one `IfcSurfaceStyle` (e.g. assigned to a material) into `\u003cdata dir>/templates/projects/`. Example: https://github.com/modelllogik/native-ifc-template/blob/main/template/native_template.ifc\n2. *New Project* with that template.\n3. Project tab → Styles → open any surface style → Shading.\n\n**Proposal**\n\nAfter the merge in the structure path, create the Blender materials for styles that have none, the same way the importer does when a file is opened (`import_ifc.IfcImporter.create_style`), for example by running `create_styles` of an `IfcImporter` on the merged file, like `create_objects_for_orphan_spatial_elements` already does for spatial elements.\n\nWorkaround for users: save the new project and open it again.\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\nBonsai 0.9.1-alpha261028 (unstable channel), IfcOpenShell 0.9.1a261028, Blender 5.2.0 LTS, Windows. Also seen on Blender 5.4 alpha (macOS) by another user.\n```","author":{"url":"https://github.com/SautaRoc","@type":"Person","name":"SautaRoc"},"datePublished":"2026-11-05T17:48:52Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10134"}
| 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:4a597736-3b90-5a23-a411-b5701f4b9b3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E07A:3C4279:123527:19B269:6B046580 |
| html-safe-nonce | c0e8418e0212d83bd817435b8f85b655423eedb9669d856f02a318b4fddaf635 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDdBOjNDNDI3OToxMjM1Mjc6MTlCMjY5OjZCMDQ2NTgwIiwidmlzaXRvcl9pZCI6IjIwMzkwNTUwOTE1Nzg5ODc5MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c883167050ffeee3085d47274ff9645b75fda6f6dd4a1fed4a88f78b3cefae8c |
| hovercard-subject-tag | issue:6228576025 |
| 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/10134/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be659bc385346b37fed08426b09f391dbf3f7771353c6a283e572d28e1a330a5/IfcOpenShell/IfcOpenShell/issues/10134 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be659bc385346b37fed08426b09f391dbf3f7771353c6a283e572d28e1a330a5/IfcOpenShell/IfcOpenShell/issues/10134 |
| og:image:alt | Bug Description Observation Creating a new project from a project template that contains an IfcSite (and its storeys) and surface styles: the styles are in the IFC afterwards, but none of them has ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SautaRoc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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