René's URL Explorer Experiment


Title: Bonsai + ifcopenshell.api: merge/reassign redundant materials into one by petruconduraru · Pull Request #8928 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Bonsai + ifcopenshell.api: merge/reassign redundant materials into one by petruconduraru · Pull Request #8928 · IfcOpenShell/IfcOpenShell

X Title: Bonsai + ifcopenshell.api: merge/reassign redundant materials into one by petruconduraru · Pull Request #8928 · IfcOpenShell/IfcOpenShell

Description: Fixes #4779. Thanks @theoryshaw for the detailed screenshots showing the real-world duplicate-material mess (485 materials, 577 styles) this is meant to clean up. Adds ifcopenshell.api.material.merge_materials(). It reassigns every direct assignment, layer, profile, constituent and material list reference from a set of redundant IfcMaterials onto one designated material, then removes the redundant materials. Their own properties and styles are discarded rather than merged in. It reuses the existing assign_material and remove_material usecases so relationship cardinalities are respected. Wires a minimal Bonsai UI on top: a merge mode toggle on the Materials panel, with checkboxes to pick redundant materials and merge them into the currently active one. Scoped to material merging only. Style (IfcSurfaceStyle) merging is materially different and larger, and is left as a follow-up. Test plan: New unit tests for merge_materials covering direct assignment, layer, profile and constituent sets, material lists, and style and pset discard (IFC2X3 and IFC4). test/api/material (104 tests) passes on this branch. New core operator tests (mockery-based). Bonsai test/core/test_material.py (15 tests) passes on this branch in headless Blender 5.2 (OpenCASCADE kernel). Carried from the earlier description and not re-run: test/api/style and the rest of test/core passed when the PR was opened. A live check in headless Blender merged a target plus 2 duplicate materials (direct assignment, layer set, style and pset) via the real operators, with all usages redirected, the duplicates removed, no dangling references, and the file re-opening cleanly. Generated with the assistance of an AI coding tool.

Open Graph Description: Fixes #4779. Thanks @theoryshaw for the detailed screenshots showing the real-world duplicate-material mess (485 materials, 577 styles) this is meant to clean up. Adds ifcopenshell.api.material.me...

X Description: Fixes #4779. Thanks @theoryshaw for the detailed screenshots showing the real-world duplicate-material mess (485 materials, 577 styles) this is meant to clean up. Adds ifcopenshell.api.material.me...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8928

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ca1dd4d4-a6b9-098d-1e0e-dbe946ab8860
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8086:3006E3:9CC123:CFF08A:6B04F558
html-safe-noncecf131e01ec7f9095c7e5036960b02315c7e8b61560591114ceb2ebcddc4d13e4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDg2OjMwMDZFMzo5Q0MxMjM6Q0ZGMDhBOjZCMDRGNTU4IiwidmlzaXRvcl9pZCI6IjM5MTY5MzAwMjczNjI3NzY0MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac244f09150669fcdfbf761faf18554bd3538ac1d0f5ae126fa3b6cddb3d674ec0
hovercard-subject-tagpull_request:4125310966
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
twitter:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
og:image:altFixes #4779. Thanks @theoryshaw for the detailed screenshots showing the real-world duplicate-material mess (485 materials, 577 styles) this is meant to clean up. Adds ifcopenshell.api.material.me...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2c3971d6ab4be607cf9a26ac26ef0a7bfce380ec2ba14642e64028ad07a492b9
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3f1d45dee14b3f87c64e9017a9c08d011561786
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fpull%2F8928%2Ffiles
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%2Fpull%2F8928%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
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
Sign up for GitHub https://github.com/signup?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
petruconduraruhttps://github.com/petruconduraru
IfcOpenShell:v0.9.0https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.9.0
BIMvoice:feat-4779-material-mergehttps://github.com/BIMvoice/IfcOpenShell/tree/feat-4779-material-merge
Conversation 1 https://github.com/IfcOpenShell/IfcOpenShell/pull/8928
Commits 1 https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/commits
Checks 8 https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/checks
Files changed https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Bonsai + ifcopenshell.api: merge/reassign redundant materials into one https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#top
Show all changes 1 commit https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
1b6b125 Add material merge API and Bonsai UI petruconduraru Jul 24, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/commits/1b6b125ea22a7a8acd1ad324886b5961ea833320
Clear filters https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
__init__.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e741b382ce47b6258ad57a61c777dfd716142a6532e248268b7634350ce39a32
operator.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-5e3cb06b65bc56e623212245177f621076b72e6fe6e39ea3ac81e3383148d1e8
prop.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
ui.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
material.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-1e46bd1161a95834b0a9e6fe2803954db380fe177fc5c014ecb21b9abb8e4d7b
test_material.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-bafeb6523c77d6405f1e5fd102d761230654e4a06677b133243f8ecc173a0903
__init__.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
merge_materials.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-fbbb54de0e8b595e08e25b28ac71ad441ee3b08fa06531fb9df55a770820578c
test_merge_materials.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-4dd44643bf7b113e57d6d21ac2d8d64c6228d876e3752589d95aa41cf271fdf8
src/bonsai/bonsai/bim/module/material/__init__.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e741b382ce47b6258ad57a61c777dfd716142a6532e248268b7634350ce39a32
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/bonsai/bim/module/material/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e741b382ce47b6258ad57a61c777dfd716142a6532e248268b7634350ce39a32
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e741b382ce47b6258ad57a61c777dfd716142a6532e248268b7634350ce39a32
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e741b382ce47b6258ad57a61c777dfd716142a6532e248268b7634350ce39a32
src/bonsai/bonsai/bim/module/material/operator.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-5e3cb06b65bc56e623212245177f621076b72e6fe6e39ea3ac81e3383148d1e8
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/bonsai/bim/module/material/operator.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-5e3cb06b65bc56e623212245177f621076b72e6fe6e39ea3ac81e3383148d1e8
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-5e3cb06b65bc56e623212245177f621076b72e6fe6e39ea3ac81e3383148d1e8
src/bonsai/bonsai/bim/module/material/prop.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/bonsai/bim/module/material/prop.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-8e09e3397ce9fa448298f398d79905f9845a7bcc68637e9752131fa09c29a4c2
src/bonsai/bonsai/bim/module/material/ui.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/bonsai/bim/module/material/ui.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-19abf5b91aa884834859357942b3c94ab548eaab5f8aa1a8aa9745cc4404623c
src/bonsai/bonsai/core/material.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-1e46bd1161a95834b0a9e6fe2803954db380fe177fc5c014ecb21b9abb8e4d7b
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/bonsai/core/material.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-1e46bd1161a95834b0a9e6fe2803954db380fe177fc5c014ecb21b9abb8e4d7b
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-1e46bd1161a95834b0a9e6fe2803954db380fe177fc5c014ecb21b9abb8e4d7b
src/bonsai/test/core/test_material.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-bafeb6523c77d6405f1e5fd102d761230654e4a06677b133243f8ecc173a0903
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/bonsai/test/core/test_material.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-bafeb6523c77d6405f1e5fd102d761230654e4a06677b133243f8ecc173a0903
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-bafeb6523c77d6405f1e5fd102d761230654e4a06677b133243f8ecc173a0903
src/ifcopenshell-python/ifcopenshell/api/material/__init__.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/ifcopenshell-python/ifcopenshell/api/material/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-e06877865c8c44f90cc9e8ac7d0bc6c2c94a86a186ed2d0f487fc814e01c6909
src/ifcopenshell-python/ifcopenshell/api/material/merge_materials.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files#diff-fbbb54de0e8b595e08e25b28ac71ad441ee3b08fa06531fb9df55a770820578c
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/1b6b125ea22a7a8acd1ad324886b5961ea833320/src/ifcopenshell-python/ifcopenshell/api/material/merge_materials.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8928/{{ revealButtonHref }}
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8928/files
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-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.