I think that is the correct behavior. The ShapeColor and Transparency properties are the default color/transparency for all faces in a shape, but can be overridden by the DiffuseColor property to get per face color and transparency. In other words, DiffuseColor takes the priority. That is why when you open transparent-shape-cube.FCStd (also the .stp file) in FreeCAD, you see an opaque shape without transparency, which is the same as in CADA. If you then changes the Transparency property, FreeCAD will apply this to all colors in DiffuseColor, and hence you see all faces with transparency.easyw-fc wrote: ↑Sun Oct 10, 2021 8:11 am here the issue I found:
1) the transparent-shape-cube.stp file is imported and rendered as transparent object in FC, but it is displayed as solid in CADA
(please note that there is a small issue in FC loading a transparent object ... the obj is loaded with its transparency value, but it is not displayed transparent until its transparent property is sligtly changed)
STEP Export/Import colors override (?)
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: STEP Export/Import colors override (?)
Re: STEP Export/Import colors override (?)
Maybe this is related to this post and the described changes in RGB color space handling introduced in opencascade 7.5.0andr.syn wrote: ↑Thu Sep 09, 2021 11:02 pm Hello, everyone!
Does anyone notice that colors in STEP models exported from FreeCAD are wrong?
I mean the case when you open them in a different program (if you import those STEPs back in FreeCAD colors would be the same).
But opened with another program, colors do not just look differently at the screen, they have different RGB values.
...
Regards
Re: STEP Export/Import colors override (?)
If this is a correct behaviour, which I agree, then FC has an issue here...realthunder wrote: ↑Sun Oct 10, 2021 9:19 am I think that is the correct behavior. The ShapeColor and Transparency properties are the default color/transparency for all faces in a shape, but can be overridden by the DiffuseColor property to get per face color and transparency. In other words, DiffuseColor takes the priority. That is why when you open transparent-shape-cube.FCStd (also the .stp file) in FreeCAD, you see an opaque shape without transparency, which is the same as in CADA. If you then changes the Transparency property, FreeCAD will apply this to all colors in DiffuseColor, and hence you see all faces with transparency.
1) get a shape with coloured faces (not transparent)
2) modify the transparency of the shape
3) the displayed result is a shape with also transparent faces
4) save that FC file
5) close and reload the file... the display result will be a solid shape with solid faces even if the shape has te transparent property set to a non solid value
Probably FC should apply to all faces the same transparency applied to shape
Here a small video on it:
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: STEP Export/Import colors override (?)
I have add a commit to do just that. Please check.
Re: STEP Export/Import colors override (?)
It is just fine!
Many Thanks
@realthunder do you think you could have a look also at the dialog to set color per faces, to see if it is possible to add a field to set also transparency for faces?
That would help a lot in handling this property without the need to use python through the console.
Re: STEP Export/Import colors override (?)
The good news is that dialog is a Qt-standard one, that already supports alpha channel. So it's just the ColorButton widget that needs to be tweaked to allow that to be enabled.
ETA: git commit 70ad1396e
Re: STEP Export/Import colors override (?)
May as well add the last bit, I suppose! Please have a look at PR 5106.
Re: STEP Export/Import colors override (?)
I've tried to build and I get this error:
Code: Select all
Downloads/FreeCAD-daily-src/src/Mod/Part/Gui/TaskFaceColors.cpp:275:25: error: ‘class Gui::ColorButton’ has no member named ‘setAllowTransparency’
275 | d->ui->colorButton->setAllowTransparency(true);
EDIT:
@chennes
I think I missed your previous commit http://github.com/FreeCAD/FreeCAD/commit/70ad1396e ...
I'll check it later during the day
Last edited by easyw-fc on Mon Oct 11, 2021 8:36 am, edited 1 time in total.
Re: STEP Export/Import colors override (?)
If the test regarding the STEP import using a commercial / proprietary CAD software is still needed, ping me.
Regards / Viele Grüße
Max
Max
Re: STEP Export/Import colors override (?)
yes please...
you may test this three files
transparent-shape-cube.stp
https://forum.freecadweb.org/download/f ... ?id=166580
this should appear as a solid cube with different colored faces
transparent-faces-cube.stp
https://forum.freecadweb.org/download/f ... ?id=166581
this should appear as a transparent cube with different colored faces
transparent-shape-faces-cube.stp
https://forum.freecadweb.org/download/f ... ?id=166582
also this should appear as a transparent cube with different colored faces
with the same level of transparency of the previous file