Page MenuHome

Let rna_idprop_ui_create take "step" as a keyword argument
AcceptedPublic

Authored by Demeter Dzadik (Mets) on Aug 30 2021, 12:27 PM.

Details

Summary

After D9697, when saving some info about a custom property using someobj.id_property_ui('prop').as_dict() and then trying to write that dict back with rna_idprop_ui_create, it would complain because of the new "step" keyword (which is nice to have btw). This patch fixes that.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 16685
Build 16685: arc lint + arc unit

Event Timeline

Demeter Dzadik (Mets) requested review of this revision.Aug 30 2021, 12:27 PM
Demeter Dzadik (Mets) created this revision.

Makes sense! This still works for integer and float properties, so I see no downside. Thanks.

This revision is now accepted and ready to land.Aug 30 2021, 6:28 PM

I've ran into a few other problems with this function:

  • Floats now have a 'precision' that would ideally also be possible to pass, so it plays nicely with the dict we get from as_dict().
  • Creating String properties will fail, complaining about too many keyword arguments for update().
  • Int properties without a specified min/max will fail because the default values are floats, and currently update() is very picky about types.

I think I could update the patch to address the first two points, but the 3rd point might need some assistance from the C side.