Page MenuHome

Property Search: Use an operator to set the property editor's pinned data-block
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jul 23 2020, 7:20 PM.

Details

Summary

This is another change pulled from the property-search-ui branch. This is useful
because it means the pin button doesn't have to be a custom button defined in C.

Replacing the use of button callbacks with operators is always nice too.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Jul 23 2020, 7:20 PM
Hans Goudey (HooglyBoogly) created this revision.

Any reason not to make this an RNA property of the space?

Any reason not to make this an RNA property of the space?

There already are the pin_id and use_pin_id properties. I figured an operator would be better than
using a special "set" function for these properties though, since I thought it was generally bad practice
to make setting one property affect another.

source/blender/editors/space_buttons/buttons_ops.c
63

rna_SpaceProperties_pin_id_update() does additional things to ensure correct material preview updates and to unpin the context if sbuts->pinid is NULL.
Maybe it's better to set the values through RNA, and let that deal with updates and invariants?

  • Merge branch 'master' into properties-pin-operator
  • Use RNA to set the pin ID
This revision is now accepted and ready to land.Sep 9 2020, 6:01 PM
Hans Goudey (HooglyBoogly) retitled this revision from UI: Use an operator to set the property editor's pinned data-block to Property Search: Use an operator to set the property editor's pinned data-block.Sep 9 2020, 6:58 PM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Sep 10 2020, 2:18 PM