Prevent crash (CAMTests) in ToolBitRecomputeObserver when the toolbit object has been deleted/missing
by catching ReferenceError before accessing its Document attribute. This ensures slotRecomputedDocument
exits gracefully if the object is no longer valid.
src/Mod/CAM/Path/Tool/toolbit/models/base.py
- Wrapped access to self.toolbit_proxy.obj.Document in try/except to handle ReferenceError
if object is deleted/missing, preventing crash during document recompute.
A bug in the ToolBit model caused an infinite recompute loop and UI freeze when properties such as Diameter, Flutes, or CuttingEdgeHeight were set to expressions. The visual representation update was being triggered during document recompute, which could recursively trigger further recomputes. This fix defers visual updates by queuing them and processing only after the document recompute completes, using a document observer. The observer is cleaned up after use and on object deletion, preventing memory leaks and repeated recompute cycles.
src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- ToolBitRecomputeObserver: Document observer class that triggers queued visual updates after recompute completes via slotRecomputedDocument.
- _queue_visual_update: Queues a visual update to be processed after document recompute.
- _setup_recompute_observer: Registers the document observer for recompute completion.
- _process_queued_visual_update: Processes the queued visual update and cleans up the observer.
- onChanged: Now queues visual updates instead of calling them directly.
- onDelete: Cleans up any pending document observer before object removal.
- Enhance _promote_toolbit to handle embedded toolbits that still have a "Custom" shape type.
- If ShapeType is "Custom" but ShapeID is present, attempt to promote to the correct shape class using ShapeID.
- Log promotion for traceability.
- This improves migration of legacy embedded toolbits and ensures proper shape assignment.
- Use PathUtil.setProperty instead of direct setattr for schema properties to ensure proper FreeCAD notifications.
- Only update custom shape properties if the value has changed, reducing unnecessary recomputation.
- For SpindleDirection and Material, only update the property if the new value differs from the current value, and use PathUtil.setProperty for consistency.
- This prevents overwriting existing values with defaults and avoids triggering unwanted recomputation.
- Change missing property log in shape/doc.py from warning to debug
- Ensure SpindleDirection property exists and is set, defaulting to "Forward"
- Ensure Material property exists and is set, defaulting to "HSS"
- Update SpindleDirection and Material from toolbit file parameters if provided
Fix issue with toolshapes
Renamed fillet to radius
Added Tool Type Filter to library
Fix units so that they honor user preference
Remove the QToolBox widget from the Shape Selector page and combine into a single page.
Fix issue with PropertyBag so that CustomPropertyGroups as a string is converted to enum and enums are handled correctly.
Update TestPathPropertyBag test for enum changes.
Update TestPathToolBitListWidget
Update TestPathToolLibrarySerializer to match new LinuxCNC output
Fix LinuxCNC export too handle ALL tool types, use user preferences for units, and include all lcnc fields
CAM: Add copy/paste support for the ToolBitBrowser
CAM: Move library dropdown and sort order combo to dedicated row to give them more space
CAM: Fix: PathAssetManagerTest failed
CAM: Add YamlSerializer
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
CAM: Fix CodeQL complaints
CAM: add LibraryProperties dialog
CAM: Replace the LibraryEditor
CAM: allow for editing tool number in the tool editor dialog
CAM: Remember last selected library and sort order in preferences
CAM: support natural sort order in tool and library lists
CAM: Fix CodeQL complaints
CAM: Fix: not all attributes included in YAML serialization
CAM: Fix: UTF8 chars not included in LinuxCNC export
Fix: tool library not displayed when loading it for the first time
CAM: Fix: custom shape class not found
CAM: Check dependencies on import for friendlier error messages
CAM: Open file dialogs in home by default
CAM: Show "All Tools" entry in library list in the library editor
CAM: fix: error on sorting tools with no tool number
CAM: Fix: traceback if library contained tool number as string
CAM: Fix: Linter errors in manager.py
CAM: Fix: separator between library and tool buttons
CAM: Add drag & drop support to the library editor
CAM: Fix numerous linter errors on the AssetManager
CAM: Show current library in library editor window title
CAM: Add dedicated icons for library add + remove
CAM: Support F2 key in library editor
CAM: library editor handles delete key when library list is in focus; focus search field by default
CAM: fix: tool list in dock initially not loading
CAM: Fix: library editor did not open from "all tools" list
CAM: Increase precision of parameters in tool summary to 3 digits
fix TestToolBitListWidget