Skip to content

CAM: Add Machine Library and Editor#26533

Merged
sliptonic merged 8 commits intoFreeCAD:mainfrom
Connor9220:Machine
Jan 10, 2026
Merged

CAM: Add Machine Library and Editor#26533
sliptonic merged 8 commits intoFreeCAD:mainfrom
Connor9220:Machine

Conversation

@Connor9220
Copy link
Contributor

This PR introduces a machine object and a machine library, along with a new machine editor dialog for creating and editing *.fcm machine asset files. The editor is integrated into the CAM preferences panel, with new Python modules for the dialog and minimal model validation. Machine management (add, edit, delete) is now available in the CAM asset preferences panel.

Key Features:

  • Machines now have a type and units property. The machine type can be used to distinguish between different classes of machines (e.g., mill, lathe, laser).
  • Machine units are stored internally and in the .fcm JSON file as metric. Note: This differs from how toolbits work (which store units in their native units)
  • Support for 2-5 axis machines.
  • Support for multiple spindles (up to 9)
  • Processor defaults
  • JSON Text Editor with basic validation and line numbers.

Machine Library
Screenshot from 2025-12-29 16-09-31

Main Machine Editor Screen
Screenshot from 2025-12-29 16-10-01

Post Processor Parameters
Screenshot from 2025-12-29 16-10-06

JSON Editor
Screenshot from 2025-12-29 16-11-50

@tarman3
Copy link
Contributor

tarman3 commented Dec 29, 2025

what about #25785 ?

@Connor9220
Copy link
Contributor Author

what about #25785 ?

That was a PoC (Proof of Concept). This one supersedes it. This one has a slightly different machine object structure. The editor updates the object directly instead of updating a dict that then get's converted. This one had some post processor stuff that was added in that's removed for THIS PR that we'll add back in a bit later. The idea is to get this out to everyone for input.

@Connor9220
Copy link
Contributor Author

Also, you'll find that this one doesn't have the Machine selector in the template or job at this time. We'll add that back in as we make more progress. This PR doesn't affect ANYTHING functionally at this time.

@github-actions github-actions bot added the Mod: CAM Related to the CAM Workbench label Dec 29, 2025
@maxwxyz maxwxyz added Type: Feature FR for improvements or new features Requires: UI/UX review Issue/PR to be reviewed in terms of UI/UX by the Design Working Group or under refinement. labels Dec 30, 2025
@maxwxyz maxwxyz added this to the 1.2 milestone Dec 30, 2025
Copy link
Collaborator

@maxwxyz maxwxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/FreeCAD/FreeCAD-Enhancement-Proposals/tree/master/FEPs/FEP-0007-consistent-language only buttons should be Title Case, so the labels should all be Sentence case without : at the end.

@github-project-automation github-project-automation bot moved this from Queue to Merge Meeting in Merge Queue Dec 30, 2025
@obelisk79
Copy link
Contributor

obelisk79 commented Dec 30, 2025

What is the purpose of this vertical tab widget? CAM is a bit of a pariah compared to the rest of FreeCAD in its use of these and really should be revisited as a design decision. That being said, it seems to add nothing of value here in preferences and I suggest removing it.

Looking over the rest of the dialogs I don't see anything of particular note that should be adjusted other than what Max has noted above.

image

@sliptonic
Copy link
Member

What is the purpose of this vertical tab widget? CAM is a bit of a pariah compared to the rest of FreeCAD in its use of these and really should be revisited as a design decision. That being said, it seems to add nothing of value here in preferences and I suggest removing it.

Looking over the rest of the dialogs I don't see anything of particular note that should be adjusted other than what Max has noted above.

I really dislike these vertical tab widgets. We've already talked about moving away from them for the operations and using horizontal tabs instead.

The tab widget was added here because there are more kinds of CAM assets. The Assets folder is where all of the tools end up already. Fully expect in the future to see vises, tool holders, possibly materials, etc. The tab widget can be removed until necessary though.

"suppress_commands": self.processing.suppress_commands,
"tool_change": self.processing.tool_change,
"adaptive": self.processing.adaptive,
"chipbreaking_amount": self.processing.chipbreaking_amount,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this defined at the Machine level? Isn't this a property of an operation? Isn't it likely to vary from one op to another?

}

# Output options
data["output"] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add back the boolean to 'output_bcnc_comments'
I was premature to remove it. Now that I understand what it does, I believe it's valid here.

data["blocks"] = blocks

# Processing options
data["processing"] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's two major sections and they pretty closely correspond to the two big phases in postprocessing.
The 'Processing' options correspond to stage 2 and the 'Output' options are used in stage 3 and 4.

So I think this section should keep translate_drill_cycles, split_arcs, suppress_commands, adaptive, tool_before_change, tool_change

show_editor, list_tools_in_preamble, show_op_labels could move to 'output options'

"line_numbers": self.output.line_numbers,
"path_labels": self.output.path_labels,
"machine_name": self.output.machine_name,
"doubles": self.output.doubles,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'doubles' property is supposed to be used in suppressing redundant gcode words.

IIRC, there were originally two controls that did this. One suppressed redundant gcode commands (G0, G1, G81) and the other suppressed redundant words within those commands. For example<

G1 X10 Y10 Z10
G1 X10 Y20 Z10

could be flattened to
G1 X10 Y10 Z10
G1 Y10

Or it could be flattened all the way to
G1 X10 Y10 Z10
Y10

Both are valid gcode but people have strong preferences about it.
I think we should have both
'output_double_commands'
'output_double_parameters'

I'm open to better names for these things.


# Dynamic state (for runtime)
parameter_functions: Dict[str, Callable] = field(default_factory=dict)
parameter_order: List[str] = field(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm skeptical about this.
It doesn't seem like a machine-specific thing. Seems like a postprocessor thing.

self.type_combo.setCurrentIndex(index)

# Get units for suffixes in populate
units = self.units_combo.itemData(self.units_combo.currentIndex())

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable units is not used.
Copy link
Collaborator

@maxwxyz maxwxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adjusting.
In preferences.py line 58 self.asset_path_label = QtGui.QLabel(translate("CAM_PreferencesAssets", "Asset Directory:"))
should be "Asset directory" (sentence case without :)

@Connor9220
Copy link
Contributor Author

Thanks for adjusting. In preferences.py line 58 self.asset_path_label = QtGui.QLabel(translate("CAM_PreferencesAssets", "Asset Directory:")) should be "Asset directory" (sentence case without :)

Pre-existing. But I’ll change it with next update. :)

Connor9220 and others added 7 commits January 8, 2026 19:26
This PR introduces a machine object and a machine library, along with a
new machine editor dialog for creating and editing *.fcm machine asset
files. The editor is integrated into the CAM preferences panel, with new
Python modules for the dialog and minimal model validation. Machine
management (add, edit, delete) is now available in the CAM asset
preferences panel.

Key Features:
- Machines now have a type and units property. The machine type can be
used to distinguish between different classes of machines (e.g., mill,
lathe, laser).
- Machine units are stored internally and in the .fcm JSON file as
metric. Note: This differs from how toolbits work (which store units in
their native units)
- Support for 2-5 axis machines.
- Support for multiple spindles (up to 9)
- Processor defaults
- JSON Text Editor with basic validation and line numbers.
Removed explicit colons from all form labels.
Fixed lint warnings and replaced wildcard imports with explicit
imports for clarity and maintainability.

src/Mod/CAM/Path/Machine/ui/editor/machine_editor.py:
- Removed ':' from all form labels
- Fixed lint warnings (missing docstrings, empty except, etc.)
- Replaced wildcard imports with explicit imports

src/Mod/CAM/Path/Machine/models/__init__.py:
- Updated __all__ and imports for explicit API

src/Mod/CAM/Path/Tool/assets/ui/preferences.py:
- Updated imports to use package-level import

src/Mod/CAM/Path/Machine/models/machine.py:
- Added explanatory comments to empty except blocks
- Fixed duplicate variable assignment
- Added missing class docstrings

src/Mod/CAM/CAMTests/TestMachine.py:
- Fixed unused variable warning by using returned filepath
added back bcnc comment output
@karamellpelle
Copy link

karamellpelle commented Jan 11, 2026

@Connor9220 The current HEAD (50c22e1) now fails when I want to change to CAM workbench:

22:39:40  No module named 'Path.Machine.ui'
22:39:40  Traceback (most recent call last):
  File "C:\Users\karamellpelle\Source\FreeCAD\.pixi\envs\default\Library\Mod\CAM\InitGui.py", line 75, in Initialize
    import Path.Tool.assets.ui.preferences as AssetPreferences
  File "C:\Users\karamellpelle\Source\FreeCAD\.pixi\envs\default\Library\Mod\CAM\Path\Tool\assets\ui\preferences.py", line 29, in <module>
    from ....Machine.ui.editor import MachineEditorDialog

No CAM workbench toolbar shows up. I suspect this PR is the cause? I ran git fetch upstream && git rebase upstream/main && pixi run build && pixi run freecad on a Windows 11 machine. It did work for some days ago.

@sliptonic
Copy link
Member

@Connor9220 The current HEAD (50c22e1) now fails when I want to change to CAM workbench:

22:39:40  No module named 'Path.Machine.ui'
22:39:40  Traceback (most recent call last):
  File "C:\Users\karamellpelle\Source\FreeCAD\.pixi\envs\default\Library\Mod\CAM\InitGui.py", line 75, in Initialize
    import Path.Tool.assets.ui.preferences as AssetPreferences
  File "C:\Users\karamellpelle\Source\FreeCAD\.pixi\envs\default\Library\Mod\CAM\Path\Tool\assets\ui\preferences.py", line 29, in <module>
    from ....Machine.ui.editor import MachineEditorDialog

No CAM workbench toolbar shows up. I suspect this PR is the cause? I ran git fetch upstream && git rebase upstream/main && pixi run build && pixi run freecad on a Windows 11 machine. It did work for some days ago.

I just rebuilt from main (cachyOS) and can't duplicate the problem. I also blew away my pixi build directory and ran pixi run configure first. I often have to do this when switching branches or I don't get a clean build.

Also, you're rebasing on upstream/main. What changes have you made to your active branch? Anything in CAM?

@Connor9220
Copy link
Contributor Author

@karamellpelle I too just did a clean build on Linux with no issues. Could someone else with windows do a build and test?

@karamellpelle
Copy link

@karamellpelle I too just did a clean build on Linux with no issues. Could someone else with windows do a build and test?

I erased the .pixi/envs/default/Library/Mod/CAM directory and then ran pixi run install . The problem existed.

Also, you're rebasing on upstream/main. What changes have you made to your active branch? Anything in CAM?
I haven't done any changes. I did a fork, but only use upstream.

This is the .py-content of .pixi/envs/default/Library/Mod/CAM/Path/ (tree -P '*.py' --prune):

.
├── Base
│   ├── Drillable.py
│   ├── FeedRate.py
│   ├── Generator
│   │   ├── bidirectional_facing.py
│   │   ├── directional_facing.py
│   │   ├── dogboneII.py
│   │   ├── drill.py
│   │   ├── facing_common.py
│   │   ├── helix.py
│   │   ├── linking.py
│   │   ├── rotation.py
│   │   ├── spiral_facing.py
│   │   ├── tapping.py
│   │   ├── threadmilling.py
│   │   ├── toolchange.py
│   │   └── zigzag_facing.py
│   ├── Gui
│   │   ├── GetPoint.py
│   │   ├── IconViewProvider.py
│   │   ├── PreferencesAdvanced.py
│   │   ├── PropertyBag.py
│   │   ├── PropertyEditor.py
│   │   ├── SetupSheet.py
│   │   ├── SetupSheetOpPrototype.py
│   │   ├── Util.py
│   │   └── __init__.py
│   ├── Language.py
│   ├── MachineState.py
│   ├── Property.py
│   ├── PropertyBag.py
│   ├── SetupSheet.py
│   ├── SetupSheetOpPrototype.py
│   ├── Util.py
│   └── __init__.py
├── Dressup
│   ├── Array.py
│   ├── Boundary.py
│   ├── DogboneII.py
│   ├── Gui
│   │   ├── Array.py
│   │   ├── AxisMap.py
│   │   ├── Boundary.py
│   │   ├── Dogbone.py
│   │   ├── DogboneII.py
│   │   ├── Dragknife.py
│   │   ├── LeadInOut.py
│   │   ├── Preferences.py
│   │   ├── RampEntry.py
│   │   ├── TagPreferences.py
│   │   ├── Tags.py
│   │   ├── ZCorrect.py
│   │   └── __init__.py
│   ├── Tags.py
│   ├── Utils.py
│   └── __init__.py
├── Geom.py
├── GuiInit.py
├── Log.py
├── Machine
│   └── models
│       ├── __init__.py
│       └── machine.py
├── Main
│   ├── Gui
│   │   ├── Camotics.py
│   │   ├── Editor.py
│   │   ├── Fixture.py
│   │   ├── Inspect.py
│   │   ├── Job.py
│   │   ├── JobCmd.py
│   │   ├── JobDlg.py
│   │   ├── PreferencesJob.py
│   │   ├── SanityCmd.py
│   │   ├── Simulator.py
│   │   ├── SimulatorGL.py
│   │   └── __init__.py
│   ├── Job.py
│   ├── Sanity
│   │   ├── HTMLTemplate.py
│   │   ├── ImageBuilder.py
│   │   ├── ReportGenerator.py
│   │   └── Sanity.py
│   ├── Stock.py
│   └── __init__.py
├── Op
│   ├── Adaptive.py
│   ├── Area.py
│   ├── Base.py
│   ├── CircularHoleBase.py
│   ├── Custom.py
│   ├── Deburr.py
│   ├── Drilling.py
│   ├── Engrave.py
│   ├── EngraveBase.py
│   ├── FeatureExtension.py
│   ├── Gui
│   │   ├── Adaptive.py
│   │   ├── Array.py
│   │   ├── Base.py
│   │   ├── CircularHoleBase.py
│   │   ├── Comment.py
│   │   ├── Copy.py
│   │   ├── Custom.py
│   │   ├── Deburr.py
│   │   ├── Drilling.py
│   │   ├── Engrave.py
│   │   ├── FeatureExtension.py
│   │   ├── Helix.py
│   │   ├── MillFace.py
│   │   ├── MillFacing.py
│   │   ├── PathShapeTC.py
│   │   ├── Pocket.py
│   │   ├── PocketBase.py
│   │   ├── PocketShape.py
│   │   ├── Probe.py
│   │   ├── Profile.py
│   │   ├── Selection.py
│   │   ├── SimpleCopy.py
│   │   ├── Slot.py
│   │   ├── Stop.py
│   │   ├── Surface.py
│   │   ├── Tapping.py
│   │   ├── ThreadMilling.py
│   │   ├── Vcarve.py
│   │   ├── Waterline.py
│   │   └── __init__.py
│   ├── Helix.py
│   ├── MillFace.py
│   ├── MillFacing.py
│   ├── Pocket.py
│   ├── PocketBase.py
│   ├── PocketShape.py
│   ├── Probe.py
│   ├── Profile.py
│   ├── Slot.py
│   ├── Surface.py
│   ├── SurfaceSupport.py
│   ├── Tapping.py
│   ├── ThreadMilling.py
│   ├── Util.py
│   ├── Vcarve.py
│   ├── Waterline.py
│   └── __init__.py
├── Post
│   ├── Command.py
│   ├── Processor.py
│   ├── Utils.py
│   ├── UtilsArguments.py
│   ├── UtilsExport.py
│   ├── UtilsParse.py
│   ├── __init__.py
│   └── scripts
│       ├── KineticNCBeamicon2_post.py
│       ├── __init__.py
│       ├── centroid_legacy_post.py
│       ├── centroid_post.py
│       ├── dxf_post.py
│       ├── dynapath_4060_post.py
│       ├── dynapath_post.py
│       ├── estlcam_post.py
│       ├── fablin_post.py
│       ├── fangling_post.py
│       ├── fanuc_post.py
│       ├── gcode_pre.py
│       ├── generic_post.py
│       ├── grbl_legacy_post.py
│       ├── grbl_post.py
│       ├── heidenhain_post.py
│       ├── jtech_post.py
│       ├── linuxcnc_legacy_post.py
│       ├── linuxcnc_post.py
│       ├── mach3_mach4_legacy_post.py
│       ├── mach3_mach4_post.py
│       ├── marlin_post.py
│       ├── masso_g3_post.py
│       ├── nccad_post.py
│       ├── opensbp_post.py
│       ├── opensbp_pre.py
│       ├── philips_post.py
│       ├── rml_post.py
│       ├── rrf_post.py
│       ├── slic3r_pre.py
│       ├── smoothie_post.py
│       ├── snapmaker_post.py
│       ├── svg_post.py
│       ├── test_post.py
│       ├── uccnc_post.py
│       └── wedm_post.py
├── Preferences.py
├── Tool
│   ├── Controller.py
│   ├── Gui
│   │   ├── Controller.py
│   │   └── __init__.py
│   ├── __init__.py
│   ├── assets
│   │   ├── __init__.py
│   │   ├── asset.py
│   │   ├── cache.py
│   │   ├── manager.py
│   │   ├── serializer.py
│   │   ├── store
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── filestore.py
│   │   │   └── memory.py
│   │   ├── ui
│   │   │   ├── __init__.py
│   │   │   ├── filedialog.py
│   │   │   ├── preferences.py
│   │   │   └── util.py
│   │   └── uri.py
│   ├── camassets.py
│   ├── docobject
│   │   ├── __init__.py
│   │   ├── models
│   │   │   ├── __init__.py
│   │   │   └── docobject.py
│   │   └── ui
│   │       ├── __init__.py
│   │       ├── docobject.py
│   │       └── property.py
│   ├── library
│   │   ├── __init__.py
│   │   ├── models
│   │   │   ├── __init__.py
│   │   │   └── library.py
│   │   ├── serializers
│   │   │   ├── __init__.py
│   │   │   ├── camotics.py
│   │   │   ├── fctl.py
│   │   │   └── linuxcnc.py
│   │   ├── ui
│   │   │   ├── __init__.py
│   │   │   ├── browser.py
│   │   │   ├── cmd.py
│   │   │   ├── dock.py
│   │   │   ├── editor.py
│   │   │   └── properties.py
│   │   └── util.py
│   ├── migration
│   │   ├── __init__.py
│   │   └── migration.py
│   ├── shape
│   │   ├── __init__.py
│   │   ├── doc.py
│   │   ├── models
│   │   │   ├── __init__.py
│   │   │   ├── ballend.py
│   │   │   ├── base.py
│   │   │   ├── bullnose.py
│   │   │   ├── chamfer.py
│   │   │   ├── custom.py
│   │   │   ├── dovetail.py
│   │   │   ├── drill.py
│   │   │   ├── endmill.py
│   │   │   ├── icon.py
│   │   │   ├── probe.py
│   │   │   ├── radius.py
│   │   │   ├── reamer.py
│   │   │   ├── slittingsaw.py
│   │   │   ├── tap.py
│   │   │   ├── threadmill.py
│   │   │   └── vbit.py
│   │   ├── ui
│   │   │   ├── __init__.py
│   │   │   ├── flowlayout.py
│   │   │   ├── shapebutton.py
│   │   │   ├── shapeselector.py
│   │   │   └── shapewidget.py
│   │   └── util.py
│   └── toolbit
│       ├── __init__.py
│       ├── migration.py
│       ├── mixins
│       │   ├── __init__.py
│       │   ├── cutting.py
│       │   └── rotary.py
│       ├── models
│       │   ├── __init__.py
│       │   ├── ballend.py
│       │   ├── base.py
│       │   ├── bullnose.py
│       │   ├── chamfer.py
│       │   ├── custom.py
│       │   ├── dovetail.py
│       │   ├── drill.py
│       │   ├── endmill.py
│       │   ├── probe.py
│       │   ├── radius.py
│       │   ├── reamer.py
│       │   ├── slittingsaw.py
│       │   ├── tap.py
│       │   ├── threadmill.py
│       │   └── vbit.py
│       ├── serializers
│       │   ├── __init__.py
│       │   ├── camotics.py
│       │   ├── fctb.py
│       │   └── yaml.py
│       ├── ui
│       │   ├── __init__.py
│       │   ├── browser.py
│       │   ├── cmd.py
│       │   ├── editor.py
│       │   ├── file.py
│       │   ├── panel.py
│       │   ├── selector.py
│       │   ├── tablecell.py
│       │   ├── toollist.py
│       │   ├── util.py
│       │   └── view.py
│       └── util.py
└── __init__.py

36 directories, 280 files

@Connor9220
Copy link
Contributor Author

@karamellpelle I see this

I don't see machine_editor.py in your directory structure..
However, Checking my local system, I find this..

CMakeLists.txt: Path/Machine/ui/editor/machine_editor.py

So, the machine_editory.py file IS in the CMakeLists.txt

It's like it's not reading your CMakeLists.txt file or something.

@sliptonic
Copy link
Member

Your source tree doesn't match. Try this:

git fetch --all (fetch from all repos)
git reset --hard upstream/main. (reset your current branch to match upstream/main. This is destructive if you've made local changes. Safe if you're just building our stuff)
rm -fr build (remove your build directory
pixi run configure
pixi run build
pixi run freecad.

@karamellpelle
Copy link

karamellpelle commented Jan 13, 2026

  • Your source tree doesn't match. Try this:

    git fetch --all (fetch from all repos) git reset --hard upstream/main. (reset your current branch to match upstream/main. This is destructive if you've made local changes. Safe if you're just building our stuff) rm -fr build (remove your build directory pixi run configure pixi run build pixi run freecad.

    I did all this now. Still got the same error.

  • I removed the v1-2 app data folder and ran the above executable. Still the same error.

  • After that I cloned the original repo (i.e. 5792b11) into a new folder, did pixi run configure, pixi run build and finally pixi run freecad. Still got the error:

    13:00:35  No module named 'Path.Machine.ui'
    13:00:35  Traceback (most recent call last):
      File "C:\Users\karamellpelle\Source\TmpFC\.pixi\envs\default\Library\Mod\CAM\InitGui.py", line 75, in Initialize
    import Path.Tool.assets.ui.preferences as AssetPreferences
      File "C:\Users\karamellpelle\Source\TmpFC\.pixi\envs\default\Library\Mod\CAM\Path\Tool\assets\ui\preferences.py", line 29, in <module>
        from ....Machine.ui.editor import MachineEditorDialog
    

This is strange. If it works for you, it's good, but maybe keep this in mind if other users gets the same error in the future.

@jffmichi
Copy link
Contributor

I'm also getting the No module named 'Path.Machine.ui' error. That's my build command:

  cmake \
    -B build-makepkg \
    -D BUILD_FLAT_MESH=ON \
    -D BUILD_DESIGNER_PLUGIN=ON \
    -D FREECAD_QT_VERSION=6 \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
    -D CMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects -fPIC -w" \
    -D CMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects -fPIC -w" \
    -D CMAKE_INSTALL_DATADIR=/usr/share/freecad \
    -D CMAKE_INSTALL_DATAROOTDIR=/usr/share \
    -D CMAKE_INSTALL_DOCDIR=/usr/share/freecad/doc \
    -D CMAKE_INSTALL_PREFIX=/usr/lib/freecad \
    -D FREECAD_USE_PCL=OFF \
    -D FREECAD_USE_EXTERNAL_PIVY=ON \
    -D FREECAD_USE_QT_FILEDIALOG=ON \
    -D INSTALL_TO_SITEPACKAGES=ON \
    -D ENABLE_DEVELOPER_TESTS=OFF \
    -G Ninja \
    -S FreeCAD \
    -W no-dev \
    -D FREECAD_USE_EXTERNAL_SMESH=ON \
    -D BUILD_FEM_NETGEN=ON
    
  ninja -C build-makepkg

@karamellpelle
Copy link

I'm also getting the No module named 'Path.Machine.ui' error.

Based on your filepaths, is this Linux or macOS?

@Connor9220
Copy link
Contributor Author

Can you guys check your build directory and see if you find these files?

./Mod/CAM/Path/Machine/models/machine.py
./Mod/CAM/Path/Machine/ui/editor/machine_editor.py

We might be missing some init files in the CMakeLists.txt file.. can you add the following?

Machine/models/init.py
/Machine/ui/editor/init.py

I'm not sure WHY my compile works without these..

@tarman3
Copy link
Contributor

tarman3 commented Jan 14, 2026

I do not have problem described in this issue, but all this files present in CMakeLists.txt

SET(PathPythonMachineUiEditor_SRCS
Path/Machine/ui/editor/machine_editor.py
Path/Machine/ui/editor/__init__.py
)
SET(PathPythonMachineModels_SRCS
Path/Machine/models/__init__.py
Path/Machine/models/machine.py
)

@Connor9220
Copy link
Contributor Author

I do not have problem described in this issue, but all this files present in CMakeLists.txt

SET(PathPythonMachineUiEditor_SRCS
Path/Machine/ui/editor/machine_editor.py
Path/Machine/ui/editor/__init__.py
)
SET(PathPythonMachineModels_SRCS
Path/Machine/models/__init__.py
Path/Machine/models/machine.py
)

Yea, I'm not sure what's going on. This built and worked fine on a Mac yesterday too. (PIXI)

@tarman3
Copy link
Contributor

tarman3 commented Jan 14, 2026

@Connor9220
Copy link
Contributor Author

Those of you having problems with this. Do you have the CAM workbench autoload? What other addons do you have. Again, can you confirm that the python files are in your build director?

@karamellpelle
Copy link

karamellpelle commented Jan 14, 2026

Here's my output from fd on WSL:

~/karamellpelle/Source/TmpFC main ❯ fd --glob --no-ignore --hidden 'machine*.py'
.pixi/envs/default/Lib/importlib/machinery.py
src/Mod/CAM/Path/Machine/ui/editor/machine_editor.py
src/Mod/CAM/Path/Machine/models/machine.py
src/Mod/CAM/Path/Base/MachineState.py
build/debug/Mod/CAM/Path/Machine/ui/editor/machine_editor.py
build/debug/Mod/CAM/Path/Machine/models/machine.py
build/debug/Mod/CAM/Path/Base/MachineState.py
.pixi/envs/default/Library/Mod/CAM/Path/Machine/models/machine.py
.pixi/envs/default/Library/Mod/CAM/Path/Base/MachineState.py

According to preferences, CAM workbench is not autoloaded. EDIT: After setting autoload to true and restarting, FreeCAD shows the error in the log window at start.

@Connor9220
Copy link
Contributor Author

Try setting it to autoload and restart FC and see if that fixes it. Also what OS and Distro? Paste full info from about page?

@karamellpelle
Copy link

karamellpelle commented Jan 14, 2026

Setting CAM wb autoload logs the error: No module named 'Path.Machine.ui' after restart.

The preferences window for WBs shows Loaded but the module failed and never loaded fully. This should actually be a new bug report: If a Workbench fails to load, then don't show Loaded.

OS: Windows 11 build 26200
Architecture: x86_64
Version: 1.2.0dev.45033 (Git)
Build date: 2026/01/13 00:01:17
Build type: Release
Branch: main
Hash: 5792b1173cdc2259226fb22296c1fdb8551f3626
Python 3.11.13, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.0, boost 1_84, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.0.0, OCC 7.8.1
Locale: English/United States (en_US)
Navigation Style/Orbit Style/Rotation Mode: Touchpad/Free Turntable/Window center
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Dark/
Logical DPI/Physical DPI/Pixel Ratio: 96/126.047/1.5
Installed mods: 
  * fasteners 0.5.43

@karamellpelle
Copy link

Here's my pixi info (using Developer PowerShell for VS 2022) in the build folder:

PS C:\Users\karamellpelle\Source\TmpFC> pixi info
System
------------
       Pixi version: 0.48.0
           Platform: win-64
   Virtual packages: __win=10.0.26200=0
                   : __cuda=12.7=0
                   : __archspec=1=x86_64_v4
          Cache dir: C:\Users\karamellpelle\AppData\Local\rattler\cache
       Auth storage: C:\Users\karamellpelle\.rattler\credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: C:\Users\karamellpelle\.pixi\bin
    Environment dir: C:\Users\karamellpelle\.pixi\envs
       Manifest dir: C:\Users\karamellpelle\.pixi\manifests\pixi-global.toml

Workspace
------------
               Name: FreeCAD
            Version: 1.0.0
      Manifest file: C:\Users\karamellpelle\Source\TmpFC\pixi.toml
       Last updated: 13-01-2026 01:48:29

Environments
------------
        Environment: default
           Features: default
           Channels: conda-forge
   Dependency count: 57
       Dependencies: blinker, calculix, ccache, cmake, coin3d, compilers, conda-devenv, debugpy, defusedxml, docutils, doxygen, eigen, fmt, freetype, git, graphviz, hdf5, ifcopenshell, lark, libboost-devel, lxml, matplotlib, nine, ninja, noqt5, numpy, occt, opencamlib, opencv, openssl, pandas, pcl, pip, pivy, ply, pre-commit, pybind11, pycollada, pyside6, python, pythonocc-core, pyyaml, qt6-main, requests, scipy, six, smesh, swig, sympy, tbb-devel, vtk, xerces-c, xlutils, yaml-cpp, zlib, zstd, pthreads-win32
  PyPI Dependencies: freecad-stubs
   Target platforms: osx-arm64, linux-aarch64, linux-64, osx-64, win-64
    Prefix location: C:\Users\karamellpelle\Source\TmpFC\.pixi\envs\default
              Tasks: install-debug, configure, build-release, freecad-release, freecad, test-release, build, build-debug, test-debug, test, initialize, install, freecad-debug, install-release, configure-debug, configure-release


Can you reproduce the error on your computer if you clone into a new folder and pixi-build there? Are the module/path names case-sensitive? I don't know Python.

@Connor9220
Copy link
Contributor Author

I'm getting this in the app image. Let me look into this.

@Connor9220
Copy link
Contributor Author

Connor9220 commented Jan 14, 2026

@karamellpelle Can you change line 929 to this ?

        ${PathPythonMachineUiEditor_SRCS}

and try it again?

@tarman3
Copy link
Contributor

tarman3 commented Jan 14, 2026

There is also no var ${PathPythonToolsMachineModels_SRCS}

@Connor9220
Copy link
Contributor Author

PathPythonToolsMachineModels_SRCS

I removed that one.. was old stuff not needed..

@Connor9220
Copy link
Contributor Author

@tarman3 @sliptonic @karamellpelle @jffmichi See if this fixes the issue: #26940

@tarman3
Copy link
Contributor

tarman3 commented Jan 14, 2026

I did not meet this problem
After fix compiled and working fine as was before for me

@karamellpelle
Copy link

@tarman3 @sliptonic @karamellpelle @jffmichi See if this fixes the issue: #26940

Your PR worked on my machine; the error did not show and I was able to create a CAM job :)

@FEA-eng
Copy link
Contributor

FEA-eng commented Feb 7, 2026

@Connor9220 I wanted to add this to the release notes, but I've noticed the following message in the preferences:

Warning: Machine definition is an experimental feature. Changes made here will not affect any CAM functionality

So for now, you can define machines, but they can't be used anywhere (only stored in the preferences for reference), right? You can't select them when submitting jobs / selecting postprocessors or anything like that?

@Connor9220
Copy link
Contributor Author

@Connor9220 I wanted to add this to the release notes, but I've noticed the following message in the preferences:

Warning: Machine definition is an experimental feature. Changes made here will not affect any CAM functionality

So for now, you can define machines, but they can't be used anywhere (only stored in the preferences for reference), right? You can't select them when submitting jobs / selecting postprocessors or anything like that?

That's correct. We're working on post processors and several other things that needed this code and we didn't want people thinking making changes to the machine would affect things at this time.

@FEA-eng
Copy link
Contributor

FEA-eng commented Feb 7, 2026

That's correct. We're working on post processors and several other things that needed this code and we didn't want people thinking making changes to the machine would affect things at this time.

Thanks, I guess I'll wait before adding it to the release notes then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mod: CAM Related to the CAM Workbench Requires: UI/UX review Issue/PR to be reviewed in terms of UI/UX by the Design Working Group or under refinement. Type: Feature FR for improvements or new features

Projects

Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants