How to bind Frame Selected and Frame All outside View mode?

   1099   8   1
User Avatar
Member
31 posts
Joined: 8月 2013
Offline
Hi,

I can not figure out how to use Frame Selected and Frame All operations outside of the Volatile View Mode. The Frame Selected and Frame All operators seem to only work when Volatile View Mode is active, for example Space+A and Space+F.

I am unable to figure out what defines that they can be only triggered in this context, and how do I switch them so that they can be executed outside of the Volatile View Mode without a need to hold down Space key first.

I don't see anything in the Hotkey editor which would imply I can manually restrict certain commands to certain tool contexts only, but I struggle to believe something like this would be hardcoded.

To be very clear: I am not looking for a workaround, such as creating a new shelf tool and with frame command and hotkeying it. My question is more general about how do I control if certain hotkeys can be triggered in/out of certain tool contexts, the Frame Selected operator being inaccessible outside of the View mode being an example.

Thanks in advance.
Edited by Ludvík Koutný - 2023年8月10日 03:53:08
https://www.artstation.com/artist/rawalanche [artstation.com]
User Avatar
Member
4550 posts
Joined: 2月 2012
Offline
Hi,

Have you tried using the actions in the hotkey editor? I use these without using the volatile keys. I also have them as custom shelf to allow executing them inside the network editor to manipulate the current viewport.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
31 posts
Joined: 8月 2013
Offline
animatrix_
Hi,

Have you tried using the actions in the hotkey editor? I use these without using the volatile keys. I also have them as custom shelf to allow executing them inside the network editor to manipulate the current viewport.

I do not understand what you mean by actions. I have the F key bound to the exact same operator you do:

Yet on my side, F key doesn't work outside of the volatile view operator. If I press it without space held, nothing happens.
Edited by Ludvík Koutný - 2023年8月10日 04:15:11

Attachments:
Screenshot 2023-08-10 101359.png (179.0 KB)

https://www.artstation.com/artist/rawalanche [artstation.com]
User Avatar
Member
4550 posts
Joined: 2月 2012
Offline
It's possible you might have conflicting hotkeys. You can click the warning sign next to the hotkey to see what actions conflict with your current hotkey.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
31 posts
Joined: 8月 2013
Offline
animatrix_
It's possible you might have conflicting hotkeys. You can click the warning sign next to the hotkey to see what actions conflict with your current hotkey.
Well, so do you, according to the yellow warning triangle next to your binding on your screenshot, yet you claim it works, so I am not sure it's the problem. If there was some conflicting hotkey, I would see the name of the action at the bottom of the viewport when the key is pressed, wouldn't I?

Can you double check it actually works outside of the view context for you?
1. Create a box and enter primitive selection mode.
2. Make sure you are not in the view mode (that the camera tool icon on the left sidebar of the Scene View is not active, but instead, for example, the Select Tool (mouse pointer icon) is active).
3. Select a single face and press F key without any other key held down.

The F key alone does work, but only inside the View Tool (when it's active), which is also restricted by the context. Absolutely essential viewport navigation actions such as framing selection should never ever require first entering some mode before they work.

Does the view frame on the selected face?
Edited by Ludvík Koutný - 2023年8月10日 04:25:58
https://www.artstation.com/artist/rawalanche [artstation.com]
User Avatar
Member
4550 posts
Joined: 2月 2012
Offline
Yes but it depends on the conflicting action I think. But the issue here is yes you have to be in the view mode. These actions are hard coded to work in the view mode. If you want them to work outside the view mode, you have to write a custom shelf script to do so. It's trivial to do that. Then bind a hotkey to that script.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
31 posts
Joined: 8月 2013
Offline
animatrix_
Yes but it depends on the conflicting action I think. But the issue here is yes you have to be in the view mode. These actions are hard coded to work in the view mode. If you want them to work outside the view mode, you have to write a custom shelf script to do so. It's trivial to do that. Then bind a hotkey to that script.

I was afraid that would be the case. I know that workaround exist, but it's pretty ugly. I was just making sure it's the only way because I couldn't believe something so essential would be hardcoded.

I don't really think it's acceptable for basic viewport navigation actions to only work if you enter some mode first in a 3rd decade of 21st century, when certain UX standards have been in place for 10+ years.

It may be somehow possible to get used to if one is just a Houdini artist, but it's getting increasingly common to work with multiple piece of software in a pipeline (In my case Unreal, Blender and Houdini) and muscle memory has only limited space.
Edited by Ludvík Koutný - 2023年8月10日 04:35:12
https://www.artstation.com/artist/rawalanche [artstation.com]
User Avatar
Member
4550 posts
Joined: 2月 2012
Offline
That's a fair point. The best you can do is to file an RFE (request for enhancement) to SESI. They are generally good at implementing new ideas. I am used to implementing a ton of custom actions and tools so it becomes more crucial for newer users to raise their concerns.

Here is what I wrote in case you want to create a custom script:

def currentViewportFrameSelected():
    with hou.undos.disabler():
        desktop = hou.ui.curDesktop()
        viewport = desktop.paneTabOfType(hou.paneTabType.SceneViewer)
        if viewport.isCurrentTab():
            viewport.curViewport().frameSelected()

<tool name="currentViewportFrameSelected" label="Current Viewport Frame Selected" icon="SOP_polyextrude">
  <script scriptType="python"><![CDATA[
    from utility_hotkey_system import currentViewportFrameSelected
    currentViewportFrameSelected()
  ]]></script>
</tool>

The other script uses frameAll function:

viewport.curViewport().frameAll()
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
31 posts
Joined: 8月 2013
Offline
animatrix_
That's a fair point. The best you can do is to file an RFE (request for enhancement) to SESI. They are generally good at implementing new ideas. I am used to implementing a ton of custom actions and tools so it becomes more crucial for newer users to raise their concerns.

I had opposite experience. I remember being puzzled that there's no viewport FOV slider out of the box in Houdini. Someone posted a shelf script to add it (once again, essential functionality has to be scripted). The issue was that the FOV would be reset to hardcoded one every time you used the frame selected operation. I reported it as RFE. I got a reply couple of weeks later it was fixed, but it was a lie, they never fixed it. Since that experience, I never bothered again.

As for the script, I was aware the workaround exists. I used a similar, albeit a simpler one:
under_cursor = hou.ui.paneTabUnderCursor()
under_cursor.curViewport().frameAll()

But I created this thread because I got frustrated I am just using some random hotkey-mapped button I added to some UI shelf (which is an odd location for tools to be actually defined, not just displayed). So I decided I want to learn how context based hotkeys work. But what I learned is that they are simply hardcoded :/

I am curious - the script you posted has actual python function definition in it. Is it also meant to be just a shelf tool, or is it a full fledged script which goes somewhere else (in some folder?).
Edited by Ludvík Koutný - 2023年8月10日 04:46:56
https://www.artstation.com/artist/rawalanche [artstation.com]
  • Quick Links