Is it possible to postpone immediate changes?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
Grue
Posts: 23
Joined: Thu Oct 20, 2016 8:50 am
Location: Moscow
Contact:

Is it possible to postpone immediate changes?

Post by Grue »

I have two calculation-heavy models -- one has a spreadsheet (data from that spreadsheet is used in parts and sketches), another model uses Draft b-spline as the base of the object. In both cases any tiny change in spreadsheet or b-spline leads to loooooong and slow rebuild of the object. It's okay to wait if the object is rebuilt once, or twice, no problem. But it's very difficult to modify several values in the spreadsheet, because every small change takes several seconds and it's almost impossible to adjust b-spline (tracing over another image) because every dot movement is delayed too for many seconds. I have to move about 50 dots, waiting and waiting after every dot movement... eeew.

Is there any way to postpone all immediate changes until I finish spreadsheet or draft editing? Right now I have to destroy all objects except b-spline and image, move b-spline to fit my new image and then redo everything again. Ewwwwww!

Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 2ce5c8d2e3020d05005ed71f710e09e9aa561f40
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Life sucks, then you die.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Is it possible to postpone immediate changes?

Post by DeepSOIC »

Hi!
FreeCAD itself doesn't offer this functionality yet.
In Lattice add-on WB, there are a few hacky tools that can suspend recomputes.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Is it possible to postpone immediate changes?

Post by wmayer »

When changing a parameter then a property of an object will be changed and marked as touched. This property notifies the object it belongs to and marks this also as touched.

At this point no heavy computations took place. Later on the document will be recomputed and internally this creates an adjacency list and recomputes all touched objects and objects that depend touched objects -- this is the step that can take a long time.

So, by design a change doesn't cause an immediate recompute. But the point is that with the GUI there are a lot of actions that trigger the recompute of the document.

In order to avoid unnecessary recomputes a flag must be introduced to the document and when set it ignores any triggered recomputes. It would then only do the recompute if you explicitly press the refresh button in the main tool bar.
User avatar
Grue
Posts: 23
Joined: Thu Oct 20, 2016 8:50 am
Location: Moscow
Contact:

Re: Is it possible to postpone immediate changes?

Post by Grue »

DeepSOIC wrote:Hi!
FreeCAD itself doesn't offer this functionality yet.
In Lattice add-on WB, there are a few hacky tools that can suspend recomputes.
Excellent! Lattice2 works. Thank you. This feature should be a part of standard distribution, really. It takes only a few unions and subtractions before you can't work on low-level parts of the design anymore because of recomputation lag...

BTW now I get a lot of messages like this during total recompute:

Code: Select all

Document::recompute: The graph must be a DAG.
Document::recompute: The graph must be a DAG.
Document::recompute: The graph must be a DAG.
Is that ok? Nothing is broken in the document.
Life sucks, then you die.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Is it possible to postpone immediate changes?

Post by DeepSOIC »

Grue wrote:BTW now I get a lot of messages like this during total recompute:

Code: Select all

Document::recompute: The graph must be a DAG.
Document::recompute: The graph must be a DAG.
Document::recompute: The graph must be a DAG.
Is that ok?
This is OK. This is due to the way Lattice disables recomputes: it adds an object that has dependency on itself. The object breaks FreeCAD recompute system, effectively freezing it. The message is FreeCAD recompute system complaining there is a circular dependency.

It's a hack. Hopefully, a proper recompute control system will be introduced to FreeCAD at some point.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Is it possible to postpone immediate changes?

Post by triplus »

Stop recomputes, auto recomputes and manual recomputes are the things that came up in the past years.

P.S. Currently we only have auto recomputes by default.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Is it possible to postpone immediate changes?

Post by wmayer »

With git commit 01996d8 you can now disable recomputes of a document via context menu in the tree view. To re-enable do it via context menu or press the refresh button (if active).
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Is it possible to postpone immediate changes?

Post by triplus »

Nice!
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Is it possible to postpone immediate changes?

Post by bejant »

Grue wrote:another model uses Draft b-spline as the base of the object. In both cases any tiny change in spreadsheet or b-spline leads to loooooong and slow rebuild of the object. It's okay to wait if the object is rebuilt once, or twice, no problem. But it's very difficult to modify several values in the spreadsheet, because every small change takes several seconds and it's almost impossible to adjust b-spline (tracing over another image) because every dot movement is delayed too for many seconds. I have to move about 50 dots, waiting and waiting after every dot movement
I had that same experience with revising a model made using B-splines, but they were not linked to a spreadsheet. I thought I had filed a ticket to disable recomputes as a B-spline was being changed, similar what was done in Sketcher, but I can't find that ticket (I was going to ask that it be closed).
wmayer wrote:But the point is that with the GUI there are a lot of actions that trigger the recompute of the document.
wmayer wrote:With git commit 01996d8 you can now disable recomputes of a document via context menu in the tree view. To re-enable do it via context menu or press the refresh button (if active).
Thanks for this - I think it will be a big time-saver!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Is it possible to postpone immediate changes?

Post by DeepSOIC »

wmayer wrote:With git commit 01996d8 you can now disable recomputes of a document via context menu in the tree view. To re-enable do it via context menu or press the refresh button (if active).
Cool!!! Now I should do something to Lattice tools to use it if available.
Post Reply