Object style of compounds/booleans/etc. is not applied if changing sub-component

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!
Post Reply
Lupin
Posts: 76
Joined: Sat Mar 13, 2021 10:55 am

Object style of compounds/booleans/etc. is not applied if changing sub-component

Post by Lupin »

Look at this solid:
Zwischenablage-1.png
Zwischenablage-1.png (19.83 KiB) Viewed 679 times

It's a simple cut of a cube and a cylinder:
Zwischenablage-3.png
Zwischenablage-3.png (7.44 KiB) Viewed 679 times

I have also set the cut's transparency to 60 (arbitrary number):
Zwischenablage-4.png
Zwischenablage-4.png (22.6 KiB) Viewed 679 times

But after I change any of the data properties of the sub-components (the cube or cylinder in this case), like the position, angle, length, width, radius, height, the "Cut" looks like this:
Zwischenablage-2.png
Zwischenablage-2.png (12.12 KiB) Viewed 679 times

The transparency is no longer applied to the cut even though the value is still set to 60. You have to go into its view style and edit the transparency field for transparency to be applied again. Even just focusing the field and pressing arrow up, arrow down (which leaves it at the 60 previously set) is enough.

The same happens with compounds as well for example.

Most likely related is the fact, that if you change the view style of one of the sub-components (e. g. make the cube half transparent), that change is not visible, until you change any of its data attributes.
Attachments
object_style_not_applied.FCStd
(7.22 KiB) Downloaded 14 times
User avatar
onekk
Veteran
Posts: 6206
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Object style of compounds/booleans/etc. is not applied if changing sub-component

Post by onekk »

Sub components have not an influence on visualisation of the compounds.

It is s kniw behaviour, sometimes it could seem that the change is possible, but usually it seems "not persistent" as when a "redraw" will occur the object higher in the tree (main object) will prevail over sub object.

There is a way to define individual colors for each surface, but it is not fully implemented yet.

This resides to the fact that the "visualisation" is controlled by the View tab of the "main object".

If you search in the forum there are already done discussion about this topic, done are done by "core developers" so answers are "authoritative" and explain better this behaviour.

Regards.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Lupin
Posts: 76
Joined: Sat Mar 13, 2021 10:55 am

Re: Object style of compounds/booleans/etc. is not applied if changing sub-component

Post by Lupin »

onekk wrote: Sun Jul 24, 2022 7:15 pm It is s kniw behaviour, sometimes it could seem that the change is possible, but usually it seems "not persistent" as when a "redraw" will occur the object higher in the tree (main object) will prevail over sub object.
That the sub-object style doesn't come through to the top, is just a side issue I found and wasn't the main point of my post. The problem is that the style of the main object does not get applied after a geometric change of any of the sub-objects.
User avatar
onekk
Veteran
Posts: 6206
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Object style of compounds/booleans/etc. is not applied if changing sub-component

Post by onekk »

Lupin wrote: Sun Jul 24, 2022 7:44 pm
onekk wrote: Sun Jul 24, 2022 7:15 pm It is s kniw behaviour, sometimes it could seem that the change is possible, but usually it seems "not persistent" as when a "redraw" will occur the object higher in the tree (main object) will prevail over sub object.
That the sub-object style doesn't come through to the top, is just a side issue I found and wasn't the main point of my post. The problem is that the style of the main object does not get applied after a geometric change of any of the sub-objects.
I have noted a thing, when dealing with scripted objects, that if you don't hide the sub-objects in some cases the color of subobjects is "overriding" the grey of the upper object, probably some coin3d glitch, or maybe asking @wmayer would lead to less guesses and some more "authoritative answer".

Recently he is fairly active in the forum and not rarely his answers are new "git commit" that address the problem, hoping this will be the case.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Object style of compounds/booleans/etc. is not applied if changing sub-component

Post by wmayer »

The idea actually was that a boolean/compound inherits colors and transparencies of its input shapes.

With git commit 62dbfc5290 it's now possible to override the transparency of them.
Post Reply