[Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
vocx
Posts: 661
Joined: Thu Oct 18, 2018 9:18 pm

[Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby vocx » Sat Oct 27, 2018 7:35 pm

When working with solids and assemblies, many bodies obstruct the view of other bodies. For example, in Arch Workbench, the Arch Walls may obstruct objects behind those walls.

The transparency option in the Property view is useful to set a transparency for a single object. However, the usage is a bit slow, because you have to pick the object, go into the property view, change the value, and hit «Enter». What if you want to do that for several objects? And what if you want to restore the solid view of the object immediately? It's a bit clunky to go into the property view every time.

The improvement consists of having a button that increments the transparency value by a certain amount. Say, click once, it gets Transparency = 50, a second time, it gets Transparency = 95 (almost invisible); a third time, it restores the original transparency (it could be zero, but it could be the original transparency if it's non zero). Clicking a button in this way allows the user to quickly check the model for objects that may be obstructed by others, without changing the appearance of the entire model.
FreeCad_View_toggle_transparency.png
FreeCad_View_toggle_transparency.png (207.03 KiB) Viewed 506 times
A second proposal is similar but with Wireframe mode (Std View Menu). The Draw style button can set an "As is mode" or "Wireframe mode" for the entire model. However, it would be desirable to do this for a single body (or collection of bodies). So you can set the wireframe view of individual bodies, and then restore their appearance back to "as is" quickly. Doing it with a single button click is faster than going into the property view.

The difference between a body with transparency = 100 and a Display mode = wireframe, is that with the wireframe you can only pick the edges, and not the faces. A body with full transparency will be invisible, but the faces are still be able to be selected.
FreeCad_View_toggle_wireframe.png
FreeCad_View_toggle_wireframe.png (265.44 KiB) Viewed 506 times
I believe this is not too difficult to implement, as the individual object transparency and wireframe mode seem to be controlled with a couple of simple instructions. So, two new buttons with this code could be added to the Std View Menu toolbar.

Code: Select all

FreeCADGui.getDocument("current").getObject("object").Transparency = 50
FreeCADGui.getDocument("current").getObject("object").DisplayMode = u"Wireframe"
Jee-Bee
Posts: 1851
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby Jee-Bee » Sat Oct 27, 2018 9:00 pm

I prefer better selection methods for hidden surfaces.
left click for selection and right click for switching trough surfaces(edges etc)
And for the menu make that a long click...
User avatar
yorik
Site Admin
Posts: 11249
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby yorik » Sun Oct 28, 2018 2:19 am

That's typically what macros are excellent for. I would say, make some macros, then tight them to two new buttons!
What we would actually need is a bit more work on the addon manager so we can install a macro and add a toolbar button for it in one shot..
TheMarkster
Posts: 785
Joined: Thu Apr 05, 2018 1:53 am

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby TheMarkster » Sun Oct 28, 2018 3:34 am

yorik wrote:
Sun Oct 28, 2018 2:19 am
What we would actually need is a bit more work on the addon manager so we can install a macro and add a toolbar button for it in one shot..
+1
freedman
Posts: 767
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby freedman » Sun Oct 28, 2018 5:13 am

+1

I have never created in Icon. Is that something we can do in program and attach. The standard Icon list goes on forever and I typically want something new.
vocx
Posts: 661
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby vocx » Sun Oct 28, 2018 9:19 am

yorik wrote:
Sun Oct 28, 2018 2:19 am
That's typically what macros are excellent for. I would say, make some macros, then tight them to two new buttons!
What we would actually need is a bit more work on the addon manager so we can install a macro and add a toolbar button for it in one shot..
Sure, but for this simple task, I think it'd make sense to integrate it into the main code, and make this available to everybody. Otherwise users will end up creating very simple macros and reinventing the wheel every time.
User avatar
DeepSOIC
Posts: 6574
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby DeepSOIC » Sun Oct 28, 2018 11:00 am

Part-o-magic x-ray might be just what you need.
https://forum.freecadweb.org/viewtopic. ... 20#p234462
paullee
Posts: 1531
Joined: Wed May 04, 2016 3:58 pm

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby paullee » Sun Oct 28, 2018 7:15 pm

I haven't tried Part-o-magix X-ray yet.

Can current short-cut be 're-used' / 'tweaked' for ease of existing users:-

1. Space bar
2. (v,2); (v,3) etc.



1a. For selected object, Space Bar Not only cycle between Visible and Invisible
1a. Space Bar (or Ctrl-Space Bar ?) cycle, for the Selected Objects, between different Display Mode (FlatLine, Shaded...) EDIT

2a. With selected objects, (v,2 or 3 etc) Control only selected objects, Display Mode (instead of globally)
2b. Or with 2nd (v,2 or 3 etc) ketstroke, it then Control ALL objects Display Mode (i.e. globally)- 'original' behaviour EDIT
vocx
Posts: 661
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Button to quickly toggle the transparency or wireframe setting of a body

Postby vocx » Mon Oct 29, 2018 5:15 pm

DeepSOIC wrote:
Sun Oct 28, 2018 11:00 am
Part-o-magic x-ray might be just what you need.
https://forum.freecadweb.org/viewtopic. ... 20#p234462
That does seem very useful. I wonder if it can be integrated into the main View Toolbar of FreeCAD. Make useful features part of the core, instead of having them in Workbenches.