Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce object freeze #12580

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Introduce object freeze #12580

merged 2 commits into from
Mar 4, 2024

Conversation

FlachyJoe
Copy link
Contributor

Fix #5545 Switch on and off parametric behaviour of document objects

@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Feb 24, 2024
@FlachyJoe
Copy link
Contributor Author

@wwmayer you're right about DocumentObject::onChanged

@FlachyJoe FlachyJoe marked this pull request as ready for review February 24, 2024 13:00
@chennes
Copy link
Member

chennes commented Feb 26, 2024

@obelisk79 can the DWG take a look at this?

@obelisk79
Copy link
Contributor

I am somewhat confused what the purpose of this PR/Feature is.

Is the intent to 'freeze' an object to save resources on recomputes?
Is it related, or necessary to implement a proper 'suppress feature' functionality?

The referenced issue was closed as 'not planned'. The original mantis ticket referenced some forum posts where the issue wasn't 100% clear to me.

@yorikvanhavre
Copy link
Member

I like this feature. Many objects (TechDraw views, Draft Shape2DViews...) have introduced their own "turn off recomputing" system over time. This is an excellent FreeCAD-wide system IMHO.

@obelisk79 indeed some features, such as those I mentioned here, often depend on a lot more objects (half of your model usually...) and they are slow to recompute. So it turns your workflow VERY slow, like, each time you move something there is a big recompute, and it's a common thing to "turn them off" while you're not using them actively.

With a FreeCAD-wide system I can imagine much better tools and workflows to for ex automatically freeze/unfreeze series of objects, add this to Draft layers, etc...

@wwmayer
Copy link
Contributor

wwmayer commented Feb 27, 2024

The question is whether there is a need to only temporarily switch off the parametric behaviour of an object. If the removal of the parametric behaviour is permanent then a simple copy will do it but if it should be enabled again then a simple copy is not sufficient.

About the recently added suppress feature function I don't know what the exact difference should be. At least compared to the suppress feature function the method of this PR has no extra memory costs.

@FlachyJoe
Copy link
Contributor Author

My own explanation about Suppress vs. Freeze:

  • A suppressed feature do nothing eg. for PartDesign it doesn't add or remove anything to the base shape, for FEM it isn't take into account for calculation.
  • A freezed feature doesn't change eg. it's shape is fixed even if its dependencies change.

@wwmayer SimpleCopy only acts on shape when a freezed object is really immutable. And the freeze sate can be switched off which avoids having to redo an object.

@yorikvanhavre
Copy link
Member

Merging it as we feel the questions are responded and we're happy with the feature.

@yorikvanhavre yorikvanhavre merged commit f633fa4 into FreeCAD:main Mar 4, 2024
9 checks passed
@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 5, 2024

@FlachyJoe Is it normal that I can find the Toggle freeze option in the context menu only when I'm in the Part workbench, not in Part Design ? Interestingly, it can be applied from Part to PD features.

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36277 (Git)
Build type: Release
Branch: main
Hash: 9e1903d46112b3660bf10c6a4537d728101d560b
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: Polish/Poland (pl_PL)

@FlachyJoe
Copy link
Contributor Author

@FEA-eng no, it isn't. Thank you.
In fact it's shown in all WBs but PD. PD certainly overwrite the menu creation. I'll dig this ASAP.

@maxwxyz
Copy link
Collaborator

maxwxyz commented Mar 9, 2024

@FlachyJoe to add to @FEA-eng comment I've added more problems to this issue: #12829

@maxwxyz
Copy link
Collaborator

maxwxyz commented Mar 9, 2024

@FlachyJoe @yorikvanhavre not sure if this as merged functions as intended.
Objects can be manipulated although they are frozen and if they unfreeze the change is done irreversible. So it actually does change the object but the user does not get info about the change. As I understood, its intended to freeze the current state of an object and allow no modifications.

If the intention is just temporarily disable recompute but do whatever you want with the object than it should be renamed but than it does not resolve the issue from the linked forum discussion as I understand.

#12829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants