Page MenuHome

Convenience renaming popup (T61480)
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Mar 20 2019, 3:23 AM.

Details

Summary

This adds a popup for renaming.

  • The popup opens with the text in an editable state.
  • Pressing enter renames the data and closes the popup.
  • Renames active: Object/Bone/Node/Sequence Strip.
  • Currently mapped to F2 (using F-Keys so this can be kept a global shortcut for renaming the active item).

    This replaces the context sensitive file-menu (while I liked this, it's a convenience that duplicates the file-menu which is almost always visible - so the tradeoff may be worth it).

Details

  • Adds support for popovers to open with a button in an edited state (can easily extend to other kinds of popup types).
  • Uses last remaining bit of uiBut.flag :(

Diff Detail

Repository
rB Blender
Branch
TEMP-RENAME-POPUP-T61480 (branched from master)
Build Status
Buildable 3194
Build 3194: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Add menu item to "Edit Menu"
Harbormaster completed remote builds in B3193: Diff 14313.
  • Correct active init flagging
Harbormaster completed remote builds in B3194: Diff 14314.
  • Use context access for bones
  • Remove node label (doesn't work with keep_open=False)
Harbormaster completed remote builds in B3196: Diff 14316.

Code wise this looks fine to me (besides eating our last bit in uiBut.flag :'( We can start thinking about splitting that guy I guess…).

Also think F2 is a reasonable default shortcut for that, people can always change it as they like.

This revision is now accepted and ready to land.Mar 20 2019, 10:40 AM
William Reynish (billreynish) accepted this revision.EditedMar 20 2019, 11:27 AM

This seems fine to me.

It would be nice to add icons to make it clearer what data you are editing:

(It's not just visual flair - the extra communication prevent accidents)

Also, I'm somewhat biased towards a different hotkey, because on Mac, F-keys are used by the system for screen brightness, volume etc.

I remapped it to Return here, which seems to work great.

However, this is not a showstopper - hotkey can easily be re-mapped.

Pablo Vazquez (pablovazquez) requested changes to this revision.Mar 20 2019, 3:27 PM

Please do not remove the File IO menu.

  • Link/Append/Import/Export is done constantly during production. (ideally it'd be done via an asset manager but we don't have one yet).
  • File IO is not something you can just add to Quick Favorites because it would end up somewhere on the list depending on the context and there's no way to sort them yet.
  • Going to the File menu every time you need to do IO is not ideal because that menu is packed with too many unrelated items like Install Templates, Previews, or Factory Startup stuff.

Proposal: Use F4 key for File IO menu, use F5 for Window Context menu.

On the Rename function itself:

  • Nodes' header display their label, not their name. So I'd make it change the Label not the Name. (offtopic issue, but we could just show the name in the node header, ditch labels).
  • Make it more context sensitive. If a collection is selected in the Outliner, rename that active Collection when the mouse is over that editor.
  • Ability to rename Object Data as well.
This revision now requires changes to proceed.Mar 20 2019, 3:27 PM

@Pablo Vazquez (pablovazquez) Could we continue shortcut discussion on T61480#645051 - replied there.

  • Node tree label/names state is annoying but rather not handle it here (label could be exposed as second option eventually).
  • Why not press Ctrl-Click on the name to rename in the outliner.

    If there is a handy way to detect a collection - this can be added, just not sure how you'd expect it to work.
  • Object data could be a second option.

There are some details about popup closing when pressing enter that complicates having multiple fields at the moment, needs investigation to make it work nice.

Closing since changes will be applied as separate patches.