Page MenuHome

Fix T91054: Editing group custom property gives error
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Aug 31 2021, 9:19 PM.

Details

Summary

I'm not sure how well supported this situation is supposed to be,
but the following example from @Demeter Dzadik (Mets) would fail when using the
custom property edit operator, because it would try to retrieve
UI data for a group property:
C.object['abuse'] = {'parent' : ['child1', 'child2', 'why', 'would', 'you', 'do', 'this']}


I'm not really thrilled with this approach, but it does seem to fix
the issue. I would much rather see this operator changed to that
it has a type drop-down at the top of the popup, and then properly
exposed properties depending on the type. Then if the custom
property was one of these weird types it could avoid dealing with
the UI data completely. I think I'm confident enough in this area
to work on that now, but this case should probably be fixed first.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Aug 31 2021, 9:19 PM
Hans Goudey (HooglyBoogly) created this revision.
Campbell Barton (campbellbarton) accepted this revision.EditedSep 1 2021, 1:28 AM

Generally seems fine (agree, guessing the type is becoming over complicated, a type selector is worth looking into), one request for comment.

release/scripts/startup/bl_operators/wm.py
1420–1422

Not sure why clearing the UI property is no longer done, it seems that deleting the property should be paired with removing the UI property.

Since it's not obvious why the UI property is kept, this deserves a comment explaining why the property can be deleted and not the ui-property-data.

This revision is now accepted and ready to land.Sep 1 2021, 1:28 AM

FWIW, +1 for a type selector, it will be better UX too :)

(I actually tried making a patch like this myself but failed miserably and it never saw the light of day!)