Part module preference option not activated at startup ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part module preference option not activated at startup ?

Post by triplus »

Anyway i doubt much upstream developer related bypassing will be going on before someone pulls the plug. Therefore for completeness' sake lets say you are a frequent STEP user and do always want to have STEP related settings available in preferences.

Autoload

The solution therefore is one checkbox click away (Part workbench).
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Post by easyw-fc »

triplus wrote: Thu Jul 13, 2017 4:06 pm Autoload

The solution therefore is one checkbox click away (Part workbench).
+1 Like ;)
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Post by vejmarie »

triplus wrote: Thu Jul 13, 2017 4:06 pm Anyway i doubt much upstream developer related bypassing will be going on before someone pulls the plug. Therefore for completeness' sake lets say you are a frequent STEP user and do always want to have STEP related settings available in preferences.

Autoload

The solution therefore is one checkbox click away (Part workbench).
Ok you have the right to believe I am totally crazy, but I think I might be able to apply what yorik has made a few months ago to the Part / STEP parameters. I just made some tests this afternoon on the C++ code size and can adapt it pretty "easily" now. I think it is a good idea to put Import/Export parameter at the highest level of FreeCAD preference tree.

By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part module preference option not activated at startup ?

Post by triplus »

vejmarie wrote: Thu Jul 13, 2017 6:00 pm Ok you have the right to believe I am totally crazy, but I think I might be able to apply what yorik has made a few months ago to the Part / STEP parameters.
I know (at least in Python) it should be easy to load something by default on FreeCAD start. I just tried to explained what is the current situation/guidelines regarding this. I doubt you will get much complaints if you will do it just for STEP importer/exporter preferences purpose. But there are some issues involved if this would be done more frequently. For example enable all options in Autoload and restart FreeCAD. It should become obvious on why such guidelines exist. ;)
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
If i remember correctly first there was one STEP importer/exporter and after another one was made. And as 100% feature parity wasn't achieved both where preserved. Likely your work resulted in STEP importer/exporter that does everything previous two solution did and more. Therefore indeed having just this new one from now on makes the most sense.
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Post by vejmarie »

Ok, I will try to make some cleanup because I just tried the importer into the Part workbench and it is super basic things. I think we shall merge everything into a single importer/exporter. Could take me some time to implement all of this.
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Part module preference option not activated at startup ?

Post by wmayer »

By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Post by easyw-fc »

wmayer wrote: Fri Jul 14, 2017 8:18 am
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
I agree that having a reference for a comparison in STEP loading with the old method (used in so many user cases) can be a feature
wmayer wrote: Fri Jul 14, 2017 8:18 am Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
the color issue is related to this discussion
https://forum.freecadweb.org/viewtopic. ... 00#p182203
@vejmarie is going to add a var (something like 'WriteShapeCompoundMode') that will allow to enable/disable compound management... that will enable colors or simplify the compound for faster handling
it is inside the
freecad-hierarchy\src\Mod\Import\App\ImportOCAF.cpp file line 204
https://github.com/vejmarie/FreeCAD/com ... d0ae348696

Maurice
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Post by vejmarie »

wmayer wrote: Fri Jul 14, 2017 8:18 am
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
I might be wrong but why does it allow to import/export a rather lightweight dataset that the regular importer/exporter can't do ?
I will check the placement issue you reported, that shall be "easy" to fix.

The Color information is not lost as well as the shapes, this is just an acceleration for "big" model which should happen only on user selectable action. I soon have a fix for that, it is not pushed to master yet, as I am trying to sort out how to handle parameters to STEP importer/exporter, which has been written original 15 years ago.

I loved to see a single code running the step importation, I got some users who are totally lost on why we do have different behavior happening currently. The importer into part is importing shapes without color support at all, while the importer into the file menu is supporting colors and get hierarchies.

I think we shall have ways at least to identify the expected behavior of each action, currently they are named the same way, or we should perhaps propose to the end user within the preference menu if he wants basic import or "full" import, allowing us to keep both codes and avoiding to get end user lost.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Post by easyw-fc »

vejmarie wrote: Fri Jul 14, 2017 11:39 am or we should perhaps propose to the end user within the preference menu if he wants basic import or "full" import, allowing us to keep both codes and avoiding to get end user lost.
Actually there is an option when filtering extensions to import in Part CAD import
with the double selection:
STEP
or
STEP with colors
PartImport-filtering.png
PartImport-filtering.png (22.11 KiB) Viewed 1691 times
This could be an easy option to be chosen each time the file is going to be imported, instead of fixing the mode in the preference menu,
but applied to File Import Menu
or a checkbox for 'full STEP' or 'basic STEP' import in the same Import Dialog
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Part module preference option not activated at startup ?

Post by yorik »

I also vote to leave the old, plain Part step importer in place. That's one of the great features of FreeCAD to have several importers/exporters for a file type. It would be a pity to cut into that!
Post Reply