Page MenuHome

Fix T91461: Pose Library name filter not working
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 17 2021, 3:50 PM.

Details

Summary

since AssetHandle does not have a name_property
(RNA_def_struct_name_property), and the UIList is just using the
default uilist_filter_items_default it simply cannot filter on names
(RNA_struct_name_get_alloc wont succeed).

Adding a name_property also wont work since AssetHandle inherits
PropertyGroup (which already sets name_property).

So this adds a (temporary) hack exception for RNA_AssetHandle in
uilist_filter_items_default until the design of AssetHandle progresses
further.

thx @Julian Eisel (Severin) for additional feedback

Diff Detail

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

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Sep 17 2021, 3:50 PM
Philipp Oeser (lichtwerk) created this revision.
Julian Eisel (Severin) requested changes to this revision.Sep 17 2021, 4:22 PM
Julian Eisel (Severin) added inline comments.
source/blender/editors/interface/interface_template_list.cc
223

Suggest:

/* XXX The AssetHandle design is hacky and meant to be temporary. It can't have a proper name property, so for now this hardcoded exception is needed. */
226

If you just use BLI_strdup() there's no need for the free_namebuf, it'll just always be an allocated string.

Besides that, and this is an actual bug, sizeof(asset_name) will always return the size of a pointer, so this will break for strings longer than 8 bytes (on 64bit machines that is).

This revision now requires changes to proceed.Sep 17 2021, 4:22 PM

better comment and string hadling

This revision is now accepted and ready to land.Sep 17 2021, 11:12 PM