Page MenuHome

Support for filtering the ID search popup (fix for T53632)
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jan 2 2018, 8:37 AM.

Details

Summary

This patch adds a filter argument to uiTemplateID functions, which can be used show it only a subset of the ID's.

Currently the only filter is AVAILABLE - used for selecting objects in the current scene (but could be used elsewhere).
Others could be added (LOCAL/LIBRARY...) as needed.

Submitting as a diff since this is a bit more intrusive than I'd have liked, so Bastien might want to check.


Note that I did consider adding a poll function to scene.objects.active which is correct but this will be too slow in practice (every item in the search popup having to check it's scene membership).

Diff Detail

Repository
rB Blender
Branch
TEMP-T53632-FIX
Build Status
Buildable 1059
Build 1059: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) retitled this revision from Fix T53632 to Support for filtering the ID search popup.Jan 2 2018, 8:46 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) retitled this revision from Support for filtering the ID search popup to Support for filtering the ID search popup (fix for T53632).Jan 2 2018, 9:24 AM
source/blender/editors/interface/interface_templates.c
213–217

Note that the order here won't be alphabetical,
best use this loop to tag, then loop over all id's to fill the list.

If there are no other issues I'll do this before committing.

Patch LGTM, a bit verbose but that’s to be expected when you touch to UI…

Have nothing to add besides your own remark about ordering in scene's objects listing. :)

source/blender/editors/space_nla/nla_buttons.c
288

Should use UI_TEMPLATE_ID_FILTER_NONE here too.

This revision is now accepted and ready to land.Jan 2 2018, 3:40 PM