LayerViewSet (main thread) - a python script for manipulating visible layers

Agreed on all points. I want the ability to “save” sets to the side and rename them. As to the ease of use of the buttons. I agree that it’s difficult to determine what they do. Perhaps a downward arrow on each of the thee push buttons and an up arrow on the pop button (I tried to do that with ASCII ^ (pop) and v (push – and the dashes in “-v-” indicates coming from both Layers and Renders and pushing onto the stack)?

Also the tool tips (which you don’t get from the picture, but you do get when you hover over each button) are:

“Pop stack and assign visible layers and/or renders”
“Push visible Layers onto stack”
“Push visible Layers and Renders onto stack”
“Push visible Renders onto stack”

Hovering over the button shows every visible layer in that set.

Another release around the corner, possibly by this weekend.

Integrating saved / named view sets. You’ll be able save any viewset on the stack and name it. It will appear as a selectable viewset on the right, and it will persist between kicad runs in ~/kicad/viewsets

This seems to be reaching and end in development. There are no other features that I plan to add after this. Any ideas or thoughts on what would make this more useful?

1 Like

Here’s where development is at the moment.

I put the stack on the right, and the saved view sets on the left. The stack automatically gets the name [layers]/[renders], without extra labels. This way the label in the stack is small, and any extra room can go to the named set on the left.

Here is a little guide on the stack label format:
3/5 - 3 layers are visible and 5 renders are visible
2/ - 2 layers are visible and renders will be unchanged
/4 - layers will be unchanged and 4 renders are visible
0/3 - 0 layers are visible and 3 renders are visible

Note the subtle distinction between “/4” and “0/3”.

The “tooltip” for the stack buttons list all the visible layers in the set:

2 Likes

Well, I couldn’t wait. I’ve updated the files on github with the latest update. Includes naming and saving ViewSets. An updated README.md explains in detail how to use the control.

Please let me know how it works and if you find any bugs. It’s been lightly tested in Windows KiCad nightly.

LayerViewSet github master branch has been updated.

In combination with a fix to KiCad, this LayerViewSet update removes the need to switch canvas and back to update the layout view after pop or load.

This fix works with KiCad nightly a557838c615c9b268830138348c6a8d6a4cc9ba9 or later, referenced by this bug report.

It should still function with older nightlies, but will still require switching views.

LayerViewSet has been updated. There was a bug that prevented loading different viewsets from different buttons. It should work much smoother now.

Because LayerViewSet can load Layers and Renders separately or together, you can do cool things like set buttons for quickly changing the Renders. This, for example, has buttons named “Show All Renders” and “Hide All Renders”. You can set any combination of layer visibility, render visibility, or both, that you want; name them; and they will persist between KiCad sessions:

3 Likes

Really gotta find some time to play with this. :thumbsup:

2 Likes

I’m always in development, so I don’t notice some things.

If anyone can confirm the following, I’d appreciate letting me know.

LayerViewSet doesn’t seem to work as an ActionPlugin without doing the following in the Scripting Console:

import layerviewset
reload layerviewset

If this is not done is that the dialog that comes up is blank and has the title “who are you”.

I can’t figure out if this is legacy code on my computer only or if this is the case for everyone.

For those watching this thread, please note that I just updated LayerViewSet to work with the current (5.1.5)-3 release build.