It’s a good suggestion, and similar to the idea I had originally, but it’s rather more complicated to implement. First, you can’t hide your parent/grandparent (or any ancestor for that matter), since hidden status is inherited down the tree. But you can certainly hide all the unimportant aunts/uncles, great aunts/uncles, etc.
I ended up with the attached plugin. It’s a substantial enough change that I renamed it to HideMoreLess
.
Changes:
- Instead of a single command, there are now 2, under
Edit
—Hide Less
andHide More
. I bind them toCtrl -
andCtrl +
, but of course you could pick anything. - One invocation of
Hide More
functions just like the original plugin: it hides all non-ancestor top level groups/components (only, bare geometry is left alone). An additional invocation ofHide More
then goes one level deeper (with feedback in the status window), and so on, until you hit the maximum depth, which is reported. - To unhide, you can
Hide Less
, or simply close the component. Closing all the way out to the top level disables and unhides everything whichHideMoreLess
hid. - Jumping directly from one deeply nested component to another on a completely distinct path (e.g. in the Outliner), will reapply the existing depth setting (up to the maximum).
- Anything which is already hidden will be left alone, so that unwanted hidden components don’t reappear.
- Models are independent, so you can have different hide depths on different models at the same time (on Mac).
My complete bindings:
-
Shift-h
Hide Rest of Model -
Ctrl-Shift-h
Hide Similar Components -
Ctrl -
Hide Less -
Ctrl +
Hide More
I find this set really convenient. Sometimes you want to work only on the group or component at hand. But sometimes you need more context. If you toggle “rest of model” back on (Shift-h
) and find it’s TMI, a quick Ctrl +
or two will clear the unrelated stuff away and drill down to just the surrounding context. It can even be useful to invoke during drawing/measurement actions: alternate between a bit more and then less context to reveal the geometry of interest. It really shines when you nest down fairly deeply: 5 levels or more. It will probably be most useful when components that are nearby in the hierarchy are physically close together.
One remaining issue that I haven’t worked out is that saving the model seems to close, and then reopen, all open entities. I’m not sure if this is a known behavior (though I guess I had noticed any time you open a file in Sketchup, you sit at the top level: no groups/components are open, independent of how it was when you saved). This component closing of course triggers the onClose
observer events, which has the result of disabling the hidden state.
In some ways this is a good thing: saving a model with many things hidden that have to be manually unhidden is a pain (the hide depth can’t be saved with the file). But it means that after each save, you have to Hide More
however many times to get back to where you were. I’ve tried to work around this with ModelObserver
’s onPreSaveModel
, but that seems to arrive too late, after all entities are closed and then reopened. Probably it’s not that problematic unless you have really deep nesting, but if anyone has any ideas on how to catch Sketchup before it closes/reopens all the open components during a Save
, I’d appreciate hearing.
hide_moreless.rb (5.7 KB)