RNA/UI: Allow displaying in tooltip why RNA property isn't editable
ClosedPublic

Authored by Julian Eisel (Severin) on Sep 19 2016, 12:38 AM.

Details

Summary

RNA/UI: Allow displaying in tooltip why RNA property isn't editable

This patch allows RNA properties to return additional info on their editable state which may then be displayed in tooltips. To use this, set the editable_info callback using RNA_def_property_editable_info_func. It fulfills the same purpose as the editabe callback, but it can return the additional info as string parameter. For generally un-editable properties or properties of a linked data-block, RNA returns default strings.

To test the editable_info callback, this patch uses it for rna_PoseChannel_proxy_editable.

Diff Detail

Repository
rB Blender
Julian Eisel (Severin) retitled this revision from to RNA/UI: Allow displaying in tooltip why RNA property isn't editable.Sep 19 2016, 12:38 AM
Julian Eisel (Severin) updated this object.

Looks good to me. I suggest to change the existing editable function rather than adding an editable_info, to avoid the number of functions growing too much, but that's more of a personal preference.

This revision is now accepted and ready to land.Sep 21 2016, 12:29 AM

Added editable_info to avoid having to do changes everywhere as long as basic patch wasn't approved but am fine with replacing editable. Will probably check and push tomorrow.

  • Add parameter to PropertyRNA.editable instead of adding new callback
  • Add comment describing purpose of r_info parameter of editabe callback
  • Merge branch 'master' into arcpatch-D2243
This revision was automatically updated to reflect the committed changes.