Page MenuHome

Rigify: Make operators searchable by adding a Rigify header drop-down
ClosedPublic

Authored by Demeter Dzadik (Mets) on Oct 2 2020, 4:52 PM.

Details

Summary

This or something like this is necessary because the new search menu doesn't search the sidebar nor the properties panel for UI buttons. I think the ability to run Add Sample and Generate from the search menu is useful, so being able to do it without having Developer Extras enabled is important.

I would also like to propose some new operators in the future, and this patch sets up a nice spot for them to go into.

I didn't remove any buttons in this patch, but would like to do in future, so these things will once again only exist in one place (which would be the header).

Diff Detail

Repository
rBA Blender Add-ons
Branch
arcpatch-D9094
Build Status
Buildable 14838
Build 14838: arc lint + arc unit

Event Timeline

Demeter Dzadik (Mets) requested review of this revision.Oct 2 2020, 4:52 PM
Demeter Dzadik (Mets) created this revision.

Adding Sybren as a reviewer, I'm just looking for a green checkmark :)

Alexander Gavrilov (angavrilov) requested changes to this revision.Nov 7 2020, 3:31 PM
Alexander Gavrilov (angavrilov) added inline comments.
rigify/ui.py
951

I don't think showing the menu for every armature, and especially showing Generate for an already generated rig is a good idea. Running Generate on the output rig actually crashes.

This revision now requires changes to proceed.Nov 7 2020, 3:31 PM
  • Don't show Rigify menu for rigs that aren't Metarigs
Alexander Gavrilov (angavrilov) requested changes to this revision.May 27 2021, 4:37 PM

The patch needs a rebase on master.

rigify/ui.py
850

The rigify_types list is dynamically generated via build_type_list based on the feature set filter, so this lookup list is sort of stale (could even be empty), and depends on another global option.

864–875

Spaces around == would look better.

This revision now requires changes to proceed.May 27 2021, 4:37 PM
Demeter Dzadik (Mets) marked 3 inline comments as done.May 27 2021, 6:07 PM
rigify/ui.py
765

Spaces around the operator; and there are other similar places too.

850

build_type_list depends on context.object.data.active_feature_set, so it should also be in the UI, like in the properties panel itself.

Addressed feedback.

I would appreciate a suggestion for an auto-formatting configuration, since I tried both autopep8 and Black default configs in VSCode but both of them left almost no line untouched. Not very fun hunting down missing spacebars manually.

Would happily run an autopep8 on the entire codebase if you want, or whatever auto-formatter you prefer.

Demeter Dzadik (Mets) marked 2 inline comments as done.May 28 2021, 11:47 PM

Seems to work now, so I guess it's ok.

This revision is now accepted and ready to land.May 29 2021, 1:22 PM

I would appreciate a suggestion for an auto-formatting configuration, since I tried both autopep8 and Black default configs in VSCode but both of them left almost no line untouched. Not very fun hunting down missing spacebars manually.

+1 for auto-formatting to adhere to PEP-8.

This is by no means official Blender policy, but my personal suggestion would be to use Black and put this in pyproject.toml at the root of the Blender source directory:

[tool.black]
line-length = 120
target-version = ['py38']
skip-string-normalization = true

The target version is because last time I checked, Black didn't support Python 3.9 yet, maybe it does now and then that should be targeted instead