View Issue Details

IDProjectCategoryView StatusLast Update
0000433FreeCADBugpublic2011-10-25 13:15
ReporternormandcAssigned Towmayer 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target Version0.12Fixed in Version0.12 
Summary0000433: Use of Pad/Pocket on some sketch profiles disables selection/preselection highlighting
DescriptionThis bug was introduced in the latest commits.

Steps to reproduce:

1 - Create a new sketch, create a closed profile consisting of one of the following:
  a) a single rectangle
  b) an arc joined with one or more lines
  c) a polygon with more than 3 sides
2 - Pad it or pocket it over an existing Pad
3 - Preselection and selection highligthing cease to function.

Note that selection is still active, just highlighting is not showing.
Additional InformationFreeCAD v0.12-bzr4535 (svn4889) on Ubuntu 10.04 LTS 64-Bit
TagsNo tags attached.

Activities

normandc

2011-09-07 01:51

manager   ~0001047

Last edited: 2011-09-07 01:52

Ok, should have tried that before posting the bug: save the document, close it and reopen it, and preselection/selection hightlighting works again. No need to restart FreeCAD.

wmayer

2011-09-07 05:45

administrator   ~0001048

I can't reproduce this behaviour with svn4889. In fact yesterday I discovered the bug that if an object is in editing mode the highlighting of (pre-)/selection didn't work. But commit 4889 should have fixed this now.

normandc

2011-09-10 23:29

manager   ~0001055

I still have the bug in the latest bzr4551 (svn4905). I'll try to test on another machine on Ubuntu 11.04.

wmayer

2011-09-11 06:39

administrator   ~0001057

Under Ubuntu I can confirm this problem. For me the selection&highlighting even doesn't work at all for the sketch object and derived shapes.

Selection of the sketch only works in editing mode and it also fails if you click on ALT+TAB to activate another application and come back again with ALT+TAB. After pressing the ALT key it again works in editing mode but still not in viewing mode.

wmayer

2011-09-11 10:55

administrator   ~0001059

So far this only seems to happen after a sketch was in editing mode. Then the highlighting&selection doesn't work for any object.

When duplicating the 3d view under View > Create View the new window works. But also when editing and leaving a sketch it doesn't work anymore.

wmayer

2011-09-11 11:16

administrator   ~0001060

OK the problem seems to be that the highlighting gets overridden by the normal representation. If you e.g. make a pad from a sketch and set the transparency e.g. to 80% then you can see the highlighting again. So, it seems that something happens to the viewer or its root node.

normandc

2011-09-11 14:33

manager   ~0001061

I confirm the bug on Ubuntu 11.04 64-Bit. I don't have a 32-Bit Ubuntu system to test.

yorik

2011-09-14 12:19

administrator   ~0001066

discovered more info ( http://forum.freecadweb.org/viewtopic.php?f=3&t=1201&p=10124#p10124 ) seems indeed that the problem is not inside the viewprovider, but when you do things directly with coin nodes (like in the sketcher and draft modules).

Couple of situations:
- open a new document, draw a Part Box. Selection/preselection works
- draw a Draft Rectangle. Selection/preselection doesn't work anymore, on neither of the 2 objects

or

- open a new document, draw a Draft Rectangle. Selection/preselection doesn't work
- draw a Part Box, selection still doesn't work on neither of the 2 objects

or

- open a new document, draw an Arch Structure (which uses the part pythonfeature viewprovider), select/preselect works
- add an Arch Wall (which contains a Draft Line), select/preselect still works

or

- save one of those "bad" documents, reopen, selection works fine again

so it looks like the problem is when the draft module uses pivy. A further confirmation, if I make a Draft Rectangle by script, with no pivy involved (import Draft, Draft.makeRectangle(2,2) ) then selection still works.

yorik

2011-09-14 12:36

administrator   ~0001067

doing this:

- draw a Part Box
>>> from pivy import coin
>>> sg = Gui.ActiveDocument.ActiveView.getSceneGraph()
>>> sg.addChild(coin.SoCube())

doesn't disable preselection. Adding a draft "tracker" object (temporary lines) neither. The problem is probably withing the event callback mechanism...

Jriegel

2011-09-15 07:02

administrator   ~0001069

Mhh, strange, but a show stopper for the 0.12 release...

yorik

2011-09-15 17:12

administrator   ~0001070

I found the culprit, at least in the Draft module:
changing the transparency value of a So Material disables selection/preselection highlight. The following code produces the problem:

>>> from pivy import coin
>>> m=coin.SoMaterial()
>>> m.transparency.setValue(.5)
>>> c=coin.SoCube()
>>> s=coin.SoSeparator()
>>> s.addChild(m)
>>> s.addChild(c)
>>> Gui.ActiveDocument.ActiveView.getSceneGraph().addChild(s)

wmayer

2011-09-17 07:45

administrator   ~0001110

Indeed setting the transparency must be the problem. This example is even shorter:
Create a part object
Gui.ActiveDocument.ActiveObject.Transparency=1
Gui.ActiveDocument.ActiveObject.Transparency=0

wmayer

2011-09-17 08:07

administrator   ~0001111

Here is a workaround:
GLRender is implemented this way:
1. render selection
2. render highlighted
3. render full geometry
4. render highlighted
5. render selection

This fixes the bug as posted by the OP. But this still doesn't fix the transparency issue. So, transparency must be something different.
To fix the transparency issue in ViewProviderExt we must use SoSeparator instead of SoGroup.

This workaround was committed in r4934.

wmayer

2011-09-18 06:03

administrator   ~0001124

It seems that we have two issues here: the transparency stuff and the other thing (caused by drawing a rectangle) which shows similar symptoms.

The transparency apparently is a general issue and you can observe the same behaviour with a mesh. If you make e.g. a cube in the Mesh workbench, go to "Flat Lines", set and unset the transparency you can't see the edges anymore. I think there is some caching problem or so. I observed this for the new SoBrep* classes too and using a separator instead of a group fixed it. So, for this problem we at least know that this is not a problem with these SoBrep* classes.

Then the other point I still don't know by what exactly this is caused. I don't think that we therefore change a transparency somewhere so it must be something different.

Jriegel

2011-09-21 14:17

administrator   ~0001129

Mhh,
in some cases after working in PartDesign the mouse interaction don't work.
So I think maybe this whole issue is a kind of filter problem of the SoFCUnifiedSelection node to filter messages out its not supposed to....
Just a thought.

Selection and Preselection highlighting still strange and often not working...

yorik

2011-10-15 14:11

administrator   ~0001162

The transparency issue seems to be solved now. I reenabled the transparency of the Draft point marker, just draw some Draft stuff to see. Preselection still works after that.

I haven't seen anymore problems with preselection hilight. Can someone else confirm?

Jriegel

2011-10-25 07:43

administrator   ~0001189

Yep, the problems on Windows are gone to. So I think we can close now

Jriegel

2011-10-25 07:44

administrator   ~0001190

double draw on M$ and Linux solve the problems. thanks to Werner

wmayer

2011-10-25 13:15

administrator   ~0001192

Not very nice but works.

Issue History

Date Modified Username Field Change
2011-09-07 01:47 normandc New Issue
2011-09-07 01:51 normandc Note Added: 0001047
2011-09-07 01:52 normandc Note Edited: 0001047
2011-09-07 05:45 wmayer Note Added: 0001048
2011-09-10 23:29 normandc Note Added: 0001055
2011-09-11 06:39 wmayer Note Added: 0001057
2011-09-11 10:55 wmayer Note Added: 0001059
2011-09-11 11:16 wmayer Note Added: 0001060
2011-09-11 14:33 normandc Note Added: 0001061
2011-09-14 12:19 yorik Note Added: 0001066
2011-09-14 12:36 yorik Note Added: 0001067
2011-09-15 07:02 Jriegel Note Added: 0001069
2011-09-15 07:02 Jriegel Status new => assigned
2011-09-15 07:02 Jriegel Assigned To => wmayer
2011-09-15 07:02 Jriegel Priority normal => high
2011-09-15 17:12 yorik Note Added: 0001070
2011-09-16 05:06 Jriegel Product Version trunk =>
2011-09-16 05:06 Jriegel Target Version => 0.12
2011-09-17 07:45 wmayer Note Added: 0001110
2011-09-17 07:50 wmayer Severity minor => major
2011-09-17 08:07 wmayer Note Added: 0001111
2011-09-18 06:03 wmayer Note Added: 0001124
2011-09-21 14:17 Jriegel Note Added: 0001129
2011-10-15 14:11 yorik Note Added: 0001162
2011-10-25 07:43 Jriegel Note Added: 0001189
2011-10-25 07:44 Jriegel Note Added: 0001190
2011-10-25 07:44 Jriegel Status assigned => resolved
2011-10-25 07:44 Jriegel Fixed in Version => 0.12
2011-10-25 07:44 Jriegel Resolution open => fixed
2011-10-25 13:15 wmayer Note Added: 0001192
2011-10-25 13:15 wmayer Status resolved => closed