Visibility toggle not working after CheckGeometry

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!
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Visibility toggle not working after CheckGeometry

Post by chrisb »

After having checked an object with Part->CheckGeometry the space does no longer toggle the visibility

How to reproduce:
- New document
- switch to PartWorkbench
- create a Part cube, leave the defaults
- select the cube and run CheckGeometry with BOPCheck
- close the check panel
- select the cube, hit space -> nothing happens

Further observations
- it is ok on Ubuntu
- the error does not occur in 0.18
- the error does not occur in 0.19.17798 (Git)
- the error does not occur if an error is found.
- the error does not occur without BOPCheck enabled
- the error is not very recent, but I could not really track it until now.

Can other Mac users please confirm?
Can Windows users please try to reproduce?
Ubuntu works here, but others may test it anyway.

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21671 (Git)
Build type: Release
Branch: master
Hash: f05253f882b336f56aae32593faa5676fd5aafdd
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Visibility toggle not working after CheckGeometry

Post by fc_tofu »

chrisb wrote: Sat Jun 20, 2020 9:05 am After having checked an object with Part->CheckGeometry the space does no longer toggle the visibility
I found the error in recent builds, but cannot reproduce it for now.

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21514 (Git)
Build type: Release
Branch: master
Hash: 89ddab33f692a9bd739171689f9ab0eb58d64b35
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Visibility toggle not working after CheckGeometry

Post by wmayer »

Tested with:
OS: Ubuntu 18.04.4 LTS (XFCE/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21715 (Git)
Build type: Debug
Branch: master
Hash: 0d05fc328d7784f2763ec223c9f943038514629d
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

I can't reproduce it neither under Ubuntu nor Windows 10.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Visibility toggle not working after CheckGeometry

Post by wmayer »

What you can try to do is to check which widgets receive key events by using an event filter:

Code: Select all

from PySide2 import QtCore

class MyEventFilter(QtCore.QObject):
  def eventFilter(self, obj, ev):
    if ev.type() == QtCore.QEvent.KeyPress:
      print("Pressed: '{}' {}".format(ev.text(), obj.metaObject().className()))
    if ev.type() == QtCore.QEvent.KeyRelease:
      print("Release: '{}' {}".format(ev.text(), obj.metaObject().className()))
    return False

filter = MyEventFilter()
app = QtCore.QCoreApplication.instance()
app.installEventFilter(filter)
This observes any key press/release events and prints the class names of the recipients.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Visibility toggle not working after CheckGeometry

Post by chrisb »

I ran the code in the Python console just before selecting the cube. This is the result from Report view (first line is the last from the code):

Code: Select all

>>> app.installEventFilter(filter)
>>> # Gui.Selection.addSelection('Unnamed1','Box')
>>> Gui.runCommand('Part_CheckGeometry',0)
>>> # Gui.Selection.clearSelection()
>>> # Gui.Selection.addSelection('Unnamed1','Box')
>>> 
After that I hit (three times) the space bar without any response in the Report view. Space bar seems to be dropped.

I changed the width of the cube entering "12 cm" including the space. It was visible in the input field but without echo in the Python console. Only numbers enteres and a complete unit where echoed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Visibility toggle not working after CheckGeometry

Post by mario52 »

hi

no problem

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21673 (Git)
Build type: Release
Branch: master
Hash: e1cfaf129866b3482bf8650e8993089a834747f0
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Visibility toggle not working after CheckGeometry

Post by wmayer »

You must enable the Python redirection in the preferences because otherwise the messages are swallowed.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Visibility toggle not working after CheckGeometry

Post by chrisb »

wmayer wrote: Sat Jun 20, 2020 3:27 pm You must enable the Python redirection in the preferences because otherwise the messages are swallowed.
:oops:

- Cleared the Report view
- selected the Cube
- invoked CheckGeometry with BOPCheck
- closed the CheckGeometry panel
- selected Cube again
- up to this moment no output in Report view
- hit spacebar yields in Report view

Code: Select all

Pressed: ' ' QWidgetWindow
Pressed: ' ' Gui::TreeWidget
Release: ' ' QWidgetWindow
Release: ' ' Gui::TreeWidget
Release: ' ' Gui::TreePanel
Release: ' ' QSplitter
Release: ' ' QStackedWidget
Release: ' ' QTabWidget
Release: ' ' Gui::DockWnd::ComboView
Release: ' ' QDockWidget
Release: ' ' Gui::MainWindow
If I switch to another application (e.g. the browser) and back, the spacebar behaviour returns to normal.

Output in Report view is then

Code: Select all

Release: ' ' QWidgetWindow
Release: ' ' Gui::TreeWidget
Release: ' ' Gui::TreePanel
Release: ' ' QSplitter
Release: ' ' QStackedWidget
Release: ' ' QTabWidget
Release: ' ' Gui::DockWnd::ComboView
Release: ' ' QDockWidget
Release: ' ' Gui::MainWindow
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Visibility toggle not working after CheckGeometry

Post by chrisb »

Perhaps the source of the troubles is not the key but rather the selection. If I select after the BOPCheck the cube it properly shows the properties in the Data tab. But in the TreeView the selection is only light blue:
Snip macro screenshot-cb2435.png
Snip macro screenshot-cb2435.png (3.58 KiB) Viewed 1634 times
After switching to the browser and back it is dark blue:
Snip macro screenshot-6efc80.png
Snip macro screenshot-6efc80.png (3.54 KiB) Viewed 1634 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Visibility toggle not working after CheckGeometry

Post by wmayer »

When I run the check geometry function then the selection is cleared. So, maybe on your system it's not properly cleared. When click on an empty space in the tree to make sure it's cleared and then select the box again does the visibility toggle work then?
Post Reply