All checks were successful
Build and Test / build (pull_request) Successful in 29m22s
Introduces mods/datums/ — a standalone addon that replaces the three stock PartDesign datum commands (Plane, Line, Point) with a single unified Create_DatumCreator command. Features: - 16 smart creation modes (7 plane, 4 axis, 5 point) - Auto-detection engine: selects best mode from geometry selection - Mode override combo for manual selection - Dynamic parameter UI (offset, angle, position, XYZ) - Datums_Type/Params/SourceRefs metadata for edit panel - Edit panel with real-time parameter updates via AttachExtension - Catppuccin Mocha themed plane styling via SDK theme tokens - Injected into partdesign.body and partdesign.feature contexts Also adds CMake install targets for gears and datums addons. Ported from archived ztools with key changes: - Property prefix: ZTools_ -> Datums_ - No document-level datums (Body-only) - PySide -> PySide6 - SDK integration (register_command, inject_commands, get_theme_tokens)
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Datums addon — GUI initialization.
|
|
|
|
Registers the unified datum creator command and injects it into
|
|
PartDesign editing contexts via the Kindred SDK.
|
|
"""
|
|
|
|
|
|
def _register_datum_commands():
|
|
"""Register datum creator command and inject into PartDesign contexts."""
|
|
try:
|
|
from datums.command import register_commands
|
|
|
|
register_commands()
|
|
except Exception as e:
|
|
import FreeCAD
|
|
|
|
FreeCAD.Console.PrintWarning(f"kindred-datums: command registration failed: {e}\n")
|
|
|
|
try:
|
|
from kindred_sdk import inject_commands
|
|
|
|
inject_commands(
|
|
"partdesign.body",
|
|
"Part Design Helper Features",
|
|
["Create_DatumCreator"],
|
|
)
|
|
inject_commands(
|
|
"partdesign.feature",
|
|
"Part Design Helper Features",
|
|
["Create_DatumCreator"],
|
|
)
|
|
except Exception as e:
|
|
import FreeCAD
|
|
|
|
FreeCAD.Console.PrintWarning(f"kindred-datums: context injection failed: {e}\n")
|
|
|
|
|
|
from PySide6.QtCore import QTimer
|
|
|
|
QTimer.singleShot(500, _register_datum_commands)
|