Title: Measure tool crashes with ReferenceError: StructRNA of type Object has been removed · Issue #8207 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Measure tool crashes with ReferenceError: StructRNA of type Object has been removed · Issue #8207 · IfcOpenShell/IfcOpenShell
X Title: Measure tool crashes with ReferenceError: StructRNA of type Object has been removed · Issue #8207 · IfcOpenShell/IfcOpenShell
Description: Bug Description Describe the bug Activating the measure tool (S M hotkey) throws a ReferenceError and aborts when the snap cache holds a reference to a Blender object that has since been deleted. The snapping system caches SnapObj entrie...
Open Graph Description: Bug Description Describe the bug Activating the measure tool (S M hotkey) throws a ReferenceError and aborts when the snap cache holds a reference to a Blender object that has since been deleted. T...
X Description: Bug Description Describe the bug Activating the measure tool (S M hotkey) throws a ReferenceError and aborts when the snap cache holds a reference to a Blender object that has since been deleted. T...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8207
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Measure tool crashes with ReferenceError: StructRNA of type Object has been removed","articleBody":"### Bug Description\n\n\n\nDescribe the bug\n\nActivating the measure tool (S M hotkey) throws a ReferenceError and aborts when the snap cache holds a reference to a Blender object that has since been deleted. The snapping system caches SnapObj entries that each keep a direct reference to a Blender object; once that object is deleted, the next snap pass accesses snap_obj.obj.name on the freed object and crashes.\n\nTo Reproduce\n\nOpen a model and use the measure tool / polyline snapping so that objects get cached for snapping.\nDelete one of the objects that was previously hovered/snapped to.\nInvoke the measure tool again (S M) and move the mouse over the viewport.\nCrash.\nExpected behavior\n\nDeleted objects are silently dropped from the snap cache and snapping continues without error.\n\nConsole output\n\n\nFile \".../bonsai/tool/raycast.py\", line 973, in create_snap_obj\n if obj.name == snap_obj.obj.name:\n ^^^^^^^^^^^^^^^^^\nReferenceError: StructRNA of type Object has been removed\n(Full traceback originates from workspace.py → measure_tool → polyline.invoke → Snap.detect_snapping_points → Raycast.filter_objects_to_raycast → Raycast.create_snap_obj.)\n\nRoot cause\n\nRaycast.create_snap_obj iterates cls.snap_objs and compares snap_obj.obj.name without validating that the cached object still exists. A deleted object's StructRNA is invalidated, so any attribute access raises ReferenceError.\n\n\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\nPython: Traceback (most recent call last):\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\project\\workspace.py\", line 109, in execute\n getattr(self, f\"hotkey_{self.hotkey}\")()\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\project\\workspace.py\", line 135, in hotkey_S_M\n bpy.ops.bim.measure_tool(\"INVOKE_DEFAULT\", measure_type=measure_type)\n File \"C:\\Program Files\\Blender Foundation\\Blender 4.5\\4.5\\scripts\\modules\\bpy\\ops.py\", line 107, in __call__\n ret = _op_call(self.idname_py(), kw, C_exec, C_undo)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRuntimeError: Error: Python: Traceback (most recent call last):\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\project\\operator.py\", line 3148, in invoke\n super().invoke(context, event)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\model\\polyline.py\", line 1000, in invoke\n self._init_snapping_points(context, event)\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\bim\\module\\model\\polyline.py\", line 1012, in _init_snapping_points\n detected_snaps = tool.Snap.detect_snapping_points(context, event, self.objs_2d_bbox, self.tool_state)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\tool\\snap.py\", line 390, in detect_snapping_points\n objs_to_raycast = tool.Raycast.filter_objects_to_raycast(context, event, objs_2d_bbox)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\tool\\raycast.py\", line 744, in filter_objects_to_raycast\n snap_obj = cls.create_snap_obj(obj)\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\Ryan Schultz\\AppData\\Roaming\\Blender Foundation\\Blender\\4.5\\extensions\\.local\\lib\\python3.11\\site-packages\\bonsai\\tool\\raycast.py\", line 973, in create_snap_obj\n if obj.name == snap_obj.obj.name:\n ^^^^^^^^^^^^^^^^^\nReferenceError: StructRNA of type Object has been removed\nLocation: C:\\Program Files\\Blender Foundation\\Blender 4.5\\4.5\\scripts\\modules\\bpy\\ops.py:107\n```","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-06-25T16:48:22Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8207"}
| 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:51339d6b-e717-f34d-bb58-a9c8ffc1b7f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E48A:13E066:5D699:7BA19:6B04AEB0 |
| html-safe-nonce | aefc6936c4d1ed50621bca052844a5da74da701212d055557fe2486042ca90a9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDhBOjEzRTA2Njo1RDY5OTo3QkExOTo2QjA0QUVCMCIsInZpc2l0b3JfaWQiOiIzMzI4MjEzMjIwODA3OTc4NjcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fa6378645b6ff29832c330db4c915af608ff412dc37a0b4b9173ad43b35dd228 |
| hovercard-subject-tag | issue:4745777394 |
| 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/8207/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba895c04032291008646bd21ebb76058a8fbfcd8857cacceb669e5a0398996cf/IfcOpenShell/IfcOpenShell/issues/8207 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba895c04032291008646bd21ebb76058a8fbfcd8857cacceb669e5a0398996cf/IfcOpenShell/IfcOpenShell/issues/8207 |
| og:image:alt | Bug Description Describe the bug Activating the measure tool (S M hotkey) throws a ReferenceError and aborts when the snap cache holds a reference to a Blender object that has since been deleted. 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 | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| 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