Page MenuHome

Python: add a utility function for creating custom properties.
ClosedPublic

Authored by Alexander Gavrilov (angavrilov) on Mar 30 2019, 10:54 AM.

Details

Summary

Creating a fully functional custom property requires also setting up
its limits, description, default value and static override status.
It is complex enough to warrant providing an official utility.

Diff Detail

Repository
rB Blender

Event Timeline

Think that makes sense, wouldn’t mind getting @Campbell Barton (campbellbarton)'s point of view on that one though.

Also think name should be more specific, that is *not* about ID properties, that is about UI-extension of ID properties. something like rna_idprop_ui_prop_create() e.g.?

Do you think the function should reveal the inside knowledge that booleans don't exist (they become ints on the C side), or instead pretend they do and just sanitize the limits?

This revision is now accepted and ready to land.Apr 16 2019, 1:31 PM
release/scripts/modules/rna_prop_ui.py
123

Could call this rna_idprop_ui_create, since it's creating the UI values.

This revision was automatically updated to reflect the committed changes.