Home Website Youtube GitHub

QoL - Auto select guide when clicking "Settings"

(Apologies if this has been suggested already, didn’t find anything in a search.)

Very simple thing: If there is only 1 top guide node in the scene, and you don’t have any shifter control nodes selected, when you click the Shifter -> Settings button, could it automatically select the top guide node for you?

I almost never have more than 1 guide in the scene at a time. (Not sure if that’s true for most people?) I use the Pre and Post Custom scripts a lot, toggling things on and off, so I’m having to select that top guide node a lot.

Would be great to save those extra mouse clicks.

Thanks for reading!
Aaron

That is a nice idea.

In the meantime, I have an alternative answer to avoid even more mouse clicks. Do you know you can set mGear hotkeys?

mGear -> Utilities -> Create mGear Hotkeys.

This will create some entries in the hotkey preferences that you can assign hotkeys to.
I use F6 for “mGear Inspect Property” (which is settings for your selection.)
I use F7 for mGear Build From Selection


Then you can edit your hotkey command for “mGear Inspect Property” to something like this. Or make your own custom hotkey:

If you only have one guide, and nothing selected, it will automatically select the guide for you. If you do have a selection, it will act as normal. If you have more than one guide, it will act as normal.

import pymel.core as pm
from mgear.shifter import guide_manager

oldSelection = pm.selected() or None
# Maybe there is a better way to get the transform of an attribute.
# This finds all the nodes that have an attribute .ismodel, which means it is a guide root.
allGuides = pm.ls([x.name().split('.')[0] for x in pm.ls('*.ismodel')], type='transform')
if len(allGuides) == 1 and oldSelection == None:
    pm.select(allGuides[0])

guide_manager.inspect_settings()
pm.select(oldSelection)
1 Like

That’s a great alternative Chris, I’ll give that a try, thanks!

Aaron

1 Like