Page MenuHome

Fix: UI: broken texpaintslot/color attributes/attributes name filtering
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 2 2022, 12:55 PM.

Details

Summary

rB8b7cd1ed2a17 broke this for the paint slots
rB4669178fc378 broke this for regular attributes

Name filtering in UI Lists works when:

  • [one] the items to be filtered have a name property
    • see how uilist_filter_items_default gets the namebuf
  • [two] custom python filter functions (filter_items) implement it themselves
    • if you use filter_items and dont do name filtering there, the default name filtering wont be used

So, two problems with rB8b7cd1ed2a17:

  • [1] items to be listed changed from texture_paint_images to texture_paint_slots
    • the former has name_property defined, the later lacks this
  • [2] the new ColorAttributesListBase defined a filter_items function, but did not implement name filtering

And the problem with rB4669178fc378:

  • it added filter_items functions, but did not implement name filtering.

These are all corrected now.

Fixes T102878

Diff Detail

Repository
rB Blender
Branch
T102878 (branched from master)
Build Status
Buildable 24931
Build 24931: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 2 2022, 12:55 PM
Philipp Oeser (lichtwerk) created this revision.

I didn't realize I would have to implement the name filter too. Seems a bit weird honestly, spreads lots of boilerplate code around. Thanks for fixing this.

This revision is now accepted and ready to land.Dec 2 2022, 3:42 PM

I didn't realize I would have to implement the name filter too. Seems a bit weird honestly, spreads lots of boilerplate code around. Thanks for fixing this.

Note you can call bpy.types.UI_UL_list.filter_items_by_name() to get the flags prepared and then alter the flags afterwards with he other filtering stuff. Maybe we should do that

Oh, that sounds nicer! I've committed the fix to the is_internal property: rB99dc90accc2e

  • adapt to rB99dc90accc2e
  • use UI_UL_list.filter_items_by_name for name filtering
Philipp Oeser (lichtwerk) requested review of this revision.Dec 3 2022, 5:50 PM
This revision is now accepted and ready to land.Dec 3 2022, 10:02 PM

spotted last minute mistakes (wrong variable name and wrong skip condition)

Philipp Oeser (lichtwerk) requested review of this revision.Dec 4 2022, 2:07 PM

Sorry I spotted last minute mistakes, and since I changed something and to keep review procedure intact (esp. bcon4) would kindly ask for one more green light here.

This revision is now accepted and ready to land.Dec 5 2022, 2:50 PM