Title: Bonsai: drop deleted objects from the snap cache (#8207) by petruconduraru · Pull Request #8301 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: drop deleted objects from the snap cache (#8207) by petruconduraru · Pull Request #8301 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: drop deleted objects from the snap cache (#8207) by petruconduraru · Pull Request #8301 · IfcOpenShell/IfcOpenShell
Description: Problem Activating the measure tool (S M) after deleting an object that was previously snapped to crashes with ReferenceError: StructRNA of type Object has been removed (#8207). Thanks to @theoryshaw for the precise diagnosis. Cause Snapping caches SnapObj entries in tool.Raycast.snap_objs, each holding a direct reference to a Blender object. create_snap_obj iterates that cache and reads snap_obj.obj.name; once the cached object has been deleted, that access hits a freed StructRNA and raises ReferenceError, aborting the snap pass (and the same stale reference would break the raycast passes downstream). Fix At the start of create_snap_obj, prune cache entries whose Blender object no longer exists (detected by the ReferenceError on attribute access). Deleted objects are silently dropped and snapping continues, which is the expected behaviour. Because filter_objects_to_raycast only appends live create_snap_obj results to the raycast list, pruning here also protects the downstream passes. Verification I don't have a Blender session to run the modal tool, but I verified the pruning logic in isolation: a cache with a deleted entry (which raises ReferenceError on .name, exactly as a freed StructRNA does) is reduced to only the live entries, and subsequent .obj.name access no longer raises. 🤖 Generated with Claude Code
Open Graph Description: Problem Activating the measure tool (S M) after deleting an object that was previously snapped to crashes with ReferenceError: StructRNA of type Object has been removed (#8207). Thanks to @theorysh...
X Description: Problem Activating the measure tool (S M) after deleting an object that was previously snapped to crashes with ReferenceError: StructRNA of type Object has been removed (#8207). Thanks to @theorysh...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8301
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:be7b09c3-eb04-eb0e-96c6-c07ea7054be4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DE58:D410B:275349:344286:6B04B63F |
| html-safe-nonce | 6bc72d15f06f7e81436273c2a32d34a7637ce46690a6ea7ecc001459fd2a92d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTU4OkQ0MTBCOjI3NTM0OTozNDQyODY6NkIwNEI2M0YiLCJ2aXNpdG9yX2lkIjoiMjIzOTM0ODc4Njg5Mzk5MzUzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f09095d81261a492474a9640af98b68551907cb637e335ffe0f426e405a15518 |
| hovercard-subject-tag | pull_request:3996461486 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/IfcOpenShell/IfcOpenShell/pull/8301/files |
| twitter:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| og:image:alt | Problem Activating the measure tool (S M) after deleting an object that was previously snapped to crashes with ReferenceError: StructRNA of type Object has been removed (#8207). Thanks to @theorysh... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width