This is a simple script to to toggle visibility between multiple parts. I use this when I use tools like Wrap or Reduce, and I want to quickly compare the result to the original. To use it, select all the objects you want to toggle through, then activate the script. It will cycle through your selection, keeping only one visible at a time. I think it’s worth noting that 3-matic will set the zoom of the viewport to the extents of the now-visible objects when starting with no visible objects, hence the undesirable functionality of the built-in Show Only menu item. This script should not do that unless you’re starting out with no visible objects.
import trimatic as tm
sel = tm.get_selection()
visible_idxs = [i for i, p in enumerate(sel) if p.visible]
nxt = ((visible_idxs[-1] + 1) % len(sel)) if visible_idxs else 0
sel[nxt].visible = True
for i in visible_idxs:
if i != nxt:
sel[i].visible = False
I can see this certainly being useful. We are considering changing the behavior of Show Only to exclude the ‘unzoom all’ by default in next year’s release. We might make it an option in the Preferences as some people may still prefer it as it currently is.
Something noteworthy is that in the upcoming release (20.0) you can add your own button (with your own icon) via the scripting API. That might make running this particular script a little easier. Though already now, as you might know, you can add scripts to the UI as well, through UI customization, with a limited set of icons to choose from.
Thank you, that sounds great. I currently use your comment in this thread to put buttons on the UI, and I have to admit that making little pixel art icons for them is more fun than it should be. I’m looking forward to the improvements you’ve got in store (and I’m hopeful that similar functionality makes it over to Mimics!).