View Issue Details

IDProjectCategoryView StatusLast Update
0001869DraftFeaturepublic2015-01-12 18:59
Reporterr-frank Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version7
Product Version0.14 
Summary0001869: Clones displayed in wrong view mode
DescriptionWhen cloning a part in Draft Workbench the clone is displayed in "As is"-Mode while your Part is displayed in for example wireframe Mode.
Steps To ReproduceSay you create a part consisting of added/cutted Solids in Part Module Workbench.
You change to Wireframe-View-Mode.
You change to Draft-Workbench.
You make a clone of your part.
The clone is displayed in "As is"-Mode while your Part is displayed in wireframe Mode.
Additional InformationVerified with Daily PPA (0.15) in Linuix Mint.
TagsNo tags attached.
FreeCAD Information

Activities

yorik

2014-12-29 20:30

administrator   ~0005467

Last edited: 2015-01-07 15:40

Hm this is more complicated than I thought, it affect all Python features:

None of the python features created in a specific override mode are getting that specific mode. The python features that exist in the document when the override mode is changed are correctly handled, but not those that are created after the mode change.

The problem is apparently that at the moment the ViewProvider::setOverrideMode() function is run, python features still don't have their display mode list complete, and therefore setOverride() exits without finding a corresponding display mode.

I'm not sure how this can be solved...

wmayer

2015-01-12 13:21

administrator   ~0005633

Can you have a look again? To me this seems like it's fixed now.

yorik

2015-01-12 16:01

administrator   ~0005636

It's still happening for me... Can you check this workflow?

1. Create a Draft rectangle (make sure Preferences->Draft->"Fill objects with faces when possible" is checked, so the rectangle has a face)

2. Switch from "as-is" to "wireframe" override

3. Create another Draft rectangle

The second rectangle still shows the face. As far as I tested this happens with all python features, not only Draft. I added a few std::cout in Gui::ViewProvider::setOverrideMode(), and it is correctly called, but it doesn't find the corresponding display mode in the object, so it simply bails out.

wmayer

2015-01-12 16:56

administrator   ~0005637

Now I see what you mean. I thought it's about copying the "DisplayMode" property of the view provider. OK, I can confirm the issue.

r-frank

2015-01-12 17:36

reporter   ~0005638

The same with solid models (That's what i meant with my opening post).
- go to Part Design workbench
- create new document
- create sketch on XZ-Plane
- sketch a rectangle in first quadrant (i.e. upper right are, all coordinates should
  have positive values)
- do revolution around horizontal axis
- switch to wireframe mode
- switch to draft workbench
- mark revolution in tree view
- do "clone"

Thanks for looking into this

wmayer

2015-01-12 18:36

administrator   ~0005639

The point is when setOverrideMode is called the display modes of a custom view provider is empty and thus the call has no effect. Afterwards the Python view provider is set as proxy to the C++ view provider.

yorik

2015-01-12 18:40

administrator   ~0005640

The problem is that it will be complicated for freecad to know when a proxy has been added, since it depends on the user... Maybe the easiest solution would be for the python view providers to run the setOverride function manually? For example in their init function...

yorik

2015-01-12 18:41

administrator   ~0005641

Last edited: 2015-01-12 18:41

Ah Werner you are way too fast :)

Related Changesets

FreeCAD: master bdfaaee8

2015-01-12 19:36:04

wmayer

Details Diff
+ fixes 0001869: Clones displayed in wrong view mode Affected Issues
0001869
mod - src/Gui/ViewProvider.h Diff File
mod - src/Gui/ViewProviderPythonFeature.h Diff File

Issue History

Date Modified Username Field Change
2014-12-21 13:44 r-frank New Issue
2014-12-22 13:58 yorik Assigned To => yorik
2014-12-22 13:58 yorik Status new => assigned
2014-12-29 20:30 yorik Note Added: 0005467
2015-01-02 18:26 normandc Project FreeCAD => Draft
2015-01-07 15:40 yorik Note Edited: 0005467
2015-01-12 13:21 wmayer Note Added: 0005633
2015-01-12 16:01 yorik Note Added: 0005636
2015-01-12 16:56 wmayer Note Added: 0005637
2015-01-12 17:36 r-frank Note Added: 0005638
2015-01-12 18:36 wmayer Note Added: 0005639
2015-01-12 18:40 yorik Note Added: 0005640
2015-01-12 18:41 yorik Note Added: 0005641
2015-01-12 18:41 yorik Note Edited: 0005641
2015-01-12 18:59 wmayer Changeset attached => FreeCAD Master master bdfaaee8
2015-01-12 18:59 wmayer Assigned To yorik => wmayer
2015-01-12 18:59 wmayer Status assigned => closed
2015-01-12 18:59 wmayer Resolution open => fixed