Feature Request: Add Opacity property for 3D models / enclosures

Hi,
following this conversation @ github
3D model opacity option for 3d-viewer
and looking at this picture
https://kicad-info.s3-us-west-2.amazonaws.com/optimized/2X/f/f148dc1ee4acce2aabd16586ad798d9b3a9ece5a_1_690x483.jpg
at this topic
enclosure design in KiCad

I decided to post a FR at kicad launchpad

This is something I already addressed in the past…

It would be very useful IMO to add the ability to assign an ‘opacity’ value to 3D models for the 3D viewer. This option could be just 4 values like 0,0.25,0.75,1 so to be able to specify the transparency of the 3D model (from invisible=0, to completely opaque=1).
This feature would be very useful for mechanical design involving for examples enclosures.
This is how it could be added to the 3D preferences dialog:

Please feel free to comment or make suggestions.
Maurice

11 Likes

I think this would be a really useful feature. I have already had several other project where it could have been applied instead of making multiple versions of the pcb file.

1 Like

Too late for V5 unfortunately, but a good idea.
Upvoted the FR

1 Like

Also put in a vote. Until this potentially gets implemented one can at least turn a model off and on by adding/removing a character (for instance an easily identifiable underscore) to the file name. The additional invalid model file name does not seem to cause any complaints when viewing the board in the 3D viewer (just tested).

I decided to re-suggest this feature only now because I noticed that recently it has been added a ‘bump’ in pcbnew version for an internal field of the footprint …
So I thought that it could be easy done an other small change for a nice improvement…

It could be something to be added only when opacity value less than 100% would be present …
this would break back compatibility but ONLY if transparency is applied (opacity less than 100%).
No need to change all the footprint libraries
something like:

(model ${KISYS3DMOD}/mylib/mymodel.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
(opacity 0.25)
)

opacity field added to footprint ONLY if its value is less than 100%

That small addition in the footprint parser will be an useful feature addition for the 3d-viewer.

2 Likes

Upvoted (and extra text to make it 120 char)

1 Like

I +1 this.
Good to see Anool here

Oops, just discovered I spoke too early, it complains the first time the 3D view is loaded, but then keeps quiet.

@otoien
as a workaround ATM with the Nightly you can tricky the pcbnew (thanks to Mario @kammutierspule)

  1. Assign to the footprint associated to the Enclosure 3D model a Virtual attribute
  2. Give to the Enclosure VRML model a transparency value (i.e. 0.25)
  3. Press ‘V’ to Toggle Virtual models visibility to Show/Hide the Enclosure
  4. Press ‘A’ to display all material properties in 3D viewer
  5. Press ‘D’ to display only diffuse properties in 3D viewer

and here the result:

Unfortunately with this trick you can only hide ALL Virtual 3D models and not only selected;
the transparency will be also toggled for all 3D models with a transparency attribute and not for selection…

As I said it is a workaround instead of the desired feature :wink:

Maurice

1 Like

Thanks so much, this is a great idea. By some reason, only the V hotkey works directly (tried both lower case and shifted keys), but the menu choices under material properties instead of D and A (which are not listed as hotkeys) still works. Perhaps the D and A hotkeys are recent changes that has not gotten into the latest unsigned windows nightly (2017-12-11 revision b395b55a2) yet?

Nice to be able to display the SignalGenerator project with the enclosure non-transparent (also turned off silkscreen on this one to remove the parts extending from the case):

The real life version cannot do the trick with the transparent case :slight_smile: (a 1000uF electrolytic capacitor was added post design to slope down power slow enough to save settings on power down):

2 Likes

Oops I forgot that I added ‘A’ and ‘D’ shortcut to my personal build …
also the Virtual option for 3D models came from a previous my build that Mario gently added to the 3D code…

You can toggle the transparency only through the 3d-viewer menu ‘Render option’, ‘Material properties’, ‘Use all properties’ or ‘Use diffuse only’

1 Like

Thanks for the clarification. Perhaps we could convince the developers to add those shortcuts in the nightly as the ‘V’ shortcut is already there and the D and A letters have not been used up?