Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
FCuser2019
Posts: 125
Joined: Fri Sep 13, 2019 12:15 pm

Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by FCuser2019 »

Hello, I have discovered this problem:

1) load Assembly4 WB;

2) create a new empty document;

3) create a new Assembly4 container;

4) create e new variable;

5) open the "Animate Assembly" dialog and select the variable created in step 4);

6) close the "Animate Assembly" dialog;

7) save the document;

8) close the document ("Close" or "Close All" command) without quitting FC;

9) reopen the document;

10) click on the "Animate Assembly" tool button --> the "Animate Assembly" tool dialogue is not displayed and the following error message is displayed in the Report View:

Code: Select all

16:01:07  A3 available
16:01:28  Initializing Assembly4 workbench (v0.11.12) ............................ done.
16:03:34  Running the Python command 'Asm4_Animate' failed:
Traceback (most recent call last):
  File "/home/test/.local/share/FreeCAD/Mod/Assembly4/./AnimationLib.py", line 145, in Activated
    self.Variables = self.AnimatedDocument.getObject('Variables') if self.AnimatedDocument else None

Cannot access attribute 'getObject' of deleted object
After this error message, the only way to access the "Animate Assembly" tool dialogue is to exit FC, restart FC and reload the document file.

My FC infos:

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.28751 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 660655e)
Hash: 660655e54c97b5017ff0ac1e030059308cd4e3f5
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * kicadStepUpMod 10.10.5
  * DynamicData 2.32.0
  * Manipulator
  * Assembly4 0.11.12
  * fasteners 0.3.40
Thanks for your attention.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by Zolko »

FCuser2019 wrote: Fri Apr 29, 2022 2:25 pm Hello, I have discovered this problem ...
good catch, thank-you for reporting. It is fixed in the development branch, and will be published in the next version.

(replace line 145 in AnimationLib by )

Code: Select all

self.Variables = self.AnimatedDocument.getObject('Variables') if self.AnimatedDocument in App.listDocuments().values() else None
try the Assembly4 workbench for FreCAD — tutorials here and here
FCuser2019
Posts: 125
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by FCuser2019 »

Hello Zolko, thanks for the fix.
I replaced in the file .local/share/FreeCAD/Mod/Assembly4/AnimationLib.py the line 145 with:

Code: Select all

self.Variables = self.AnimatedDocument.getObject('Variables') if self.AnimatedDocument in App.listDocuments().values() else None
Now, reopening the file, pressing the button of the tool "Animate Assembly" the dialog box is displayed without error messages, but there is a small problem: the ComboBox to select the variable to animate contains only the item "- Select Variable (only float) -".

My updated FC infos:

Code: Select all

OS: Linux Mint 20.2 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.28774 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 716213b)
Hash: 716213beacd25a907f2c164ad8ef8309b8a284b0
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * kicadStepUpMod 10.10.5
  * DynamicData 2.32.0
  * Manipulator
  * Assembly4 0.11.12
  * fasteners 0.3.40
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by Zolko »

FCuser2019 wrote: Thu May 05, 2022 1:35 pm ... but there is a small problem: the ComboBox to select the variable to animate contains only the item "- Select Variable (only float) -".
I think I fixed it in the development branch, thanx for reporting
try the Assembly4 workbench for FreCAD — tutorials here and here
FCuser2019
Posts: 125
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by FCuser2019 »

Hello Zolko, thanks for the fix.

I will download the development version and test it to confirm that the problems are fixed.
FCuser2019
Posts: 125
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: the "Animate Assembly" dialog is not displayed for reopened documents

Post by FCuser2019 »

Hello Zolko, I confirm that the problems described here are fixed in the development version.

In testing I have, perhaps, found another possible problem with the initialisation of "Animate Assembly". I need to do some more tests and will eventually open a new topic.
Post Reply