Job, Operations Group, and Operation visibility

We’ve had complaints since the beginning of Path about he duplicated backplot of the toolpath visualization.
The toolpath is shown by the operation and the job itself. In recent years, we added the Operations group inside the job and it has its own visibility which is very confusing.

I’ve taken a stab at simplifying this. If a few of the power-users could test this out and tell me if it works as expected, I would be grateful.
https://github.com/FreeCAD/FreeCAD/pull/4911

The changes amount to these:
I’ve converted the Operations group into a DocumentObjectGroup. Now it’s just a container for the underlying operations but has no path visualization of its own. Toggling the visibility of the group sets the visibility of all children to the same as the group.

The Job is still a Path::FeatureCompoundPython but the child path commands are not copied to the parent. So the Job behaves exactly as before but shows no toolpath backplot.

So toggling the visibility of the Job will show/hide all operations, stock, and models. Then individual items under the job can be toggled to refine the view.

Let me know what you think.

Hi Brad,

I think this is a fantastic enhancement!

Demo Video:


Although hiding the job doesn’t seem to hide the children for me.

Thanks,

Dan

Fixed. (I’d already fixed it and forgot to include the commit)

Awesome thanks!

I’ve noticed if you toggle the visibility of the operations group the operations will hide, but they don’t show with subsequent visibility (toggle) changes.

You have to right-click and select show on the group for them to reappear.

Is this expected?

Thanks,

Dan

Afternoon, sir.
Running CMake configure as I type. Will build and test on Windows 10, and report back.

Russell

I loaded the three changed *.py files without recompiling. I saw no difference at all. Does this test require a new build in addition to the python files?

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.25157 (Git)
Build type: Release
Branch: Master
Hash: 257cdd8f423f1530b8df6f53e242de629fee4e85
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

Gene

It should not require a full rebuild but also will not affect existing jobs. You’ll see the result only on newly created jobs. If that’s an issue, we can look into migration code but I hate migration code because it sits around long after anyone needs it any more.

Oh, that’s weird. Possible upstream bug.
If I comment out line 1391 in PathJobGui.py, the problem goes away but the previous problem (with job hiding children) returns. As soon as the Job viewprovider has the Gui::ViewProviderGroupExtensionPython extensions, the child groups stop functioning correctly.

Yes, it works with a new job. :blush:

I see the same behavior as dubstar-04, namely that toggling the operations group does not work to bring back the individual paths after they are hidden by a first toggle.

Toggling the job visibility always brings back all the individual paths even if some had been hidden previously. I do not know if this is intentional, but I think the preference would be to restore the previous condition.

My expectation is that when looking at an overall FC model with several jobs one might want to toggle back and forth between jobs to look for differences, etc. Restoring the previous state might be more useful than restoring all. Not a big deal in either case.

I certainly do not need any sort of migration code. The visibility already works. The new changes just make it more convenient.

Gene

https://forum.freecadweb.org/viewtopic.php?f=10&t=60021&sid=61b07d86f146e5f87399f691773c12e8

Afternoon sir.
These are my simple observations.

Scenario 1:

  1. Create Body object.
  2. Select new Body object and create new Job.
  3. Add additional tool to new Job, just for kicks - no other reason, and this is optional.
  4. Click OK to save Job and close Task Panel.
  5. Create PocketShape op on selected face.
  6. All components of Job are now visible in the object tree and viewport.
  7. Select the Job and toggle visibility with the space bar.
  8. All Job subcomponents are hidden as desired, but the Job object in the object tree shows it needs a recompute (little blue circle with white checkmark inside).

Scenario 2:

  1. Perform steps 1 - 6 of Scenario 1, and new Job with single operation is all visible.
  2. Select the Operations group in the object tree and toggle visibility with space bar.
  3. The operation is hidden, both in object tree and viewport, but the Operations group in the object tree remains visible (bright blue, not grayed out), and the Job indicates it needs a recompute.

Scenario 3:

  1. Perform all steps of Scenario 2.
  2. A subsequent toggle of the what-should-now-be-hidden Operations group with the single hidden operation fails to toggle the operation back to visible, and requires another recompute. This is confirmation of Dubstar-04 and GeneFC’s experiences above.


    Summations:
  3. When the parent Job and all children are visible, the toggle of Job to hidden works as desired, changing parent and all children to hidden, with the unwanted requirement of a recompute.
  4. When a subgroup with children is visible, toggling the subgroup to hidden will hide the children, but not the parent, and require a recompute. A subsequent toggle of the same subgroup parent to visible will fail to make children visible, and require a recompute.

Thanks for working on this beast.
Thanks for all you are doing for FreeCAD.

Russell

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.25200 (Git)
Build type: Release
Branch: feature/nopathjob
Hash: 82bc69c557aa02cda6135b398f106dbc310411ab
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

I’ve done some additional work on this PR for job/op path visibility. I would like to get this in before the feature freeze.
The visibility with this change seems quite natural to me but I would appreciate some testing, especially from some of the long-timers. If we merge this, documentation will need to be updated.

https://github.com/FreeCAD/FreeCAD/pull/4911





Note for testing: With this change, the operations group is created as a regular document group. This does not convert the operations group in existing jobs. The old behavior should be the same for operations group. But any new jobs will have different behavior. So please test that both old and new jobs work without error, even though they’ll have slightly different behavior.

I propose to commit this to master, so that users like Herbert or myself or many others can test it as well. I’m sure that severe bugs can be eliminated if they exist; and if massive problems occur, it may have to be rolled back.

I did a quick test on both an existing path and a new path.

The new path generation seemed just fine, and the visibility control was much more natural and intuitive. I could easily switch visibility on and off by using the space bar on the operation, regardless of whether the Job was visible or not. This also worked correctly for the Cut Material object.

When I opened an existing file with a previously generated path the behavior was similar, with one difference. The green path lines were doubled when both the operation and the Job were made visible. (I recomputed, of course.) Single copies of the lines were visible when either the operation or the Job was made visible.

I will continue to test, but it looks good to me.

Gene

All it takes is to replace three Python files in Mod/Path/PathScripts. Very easy.

Gene

I’d like to suggestion one more improvement for this, currently hiding an entire Job still doesn’t work. When I need to make changes to a Body that is already part of a Job, it would be nice to be able to hide the entire Job in one go, then do my work on the Body.

+1