Page MenuHome

RNA properties subtypes: add missing and sync usages everywhere

Authored by Philipp Oeser (lichtwerk) on Oct 28 2020, 12:56 PM.



Some subtypes never made it to all neccessary places when they were
introduced. This was throwing warnings when accessing such a properties
subtype from python.

The sub_type enums were also defined in 4 different places:

  • RNA_types.h 'PropertySubType'
  • rna_rna.c 'rna_enum_property_subtype_items'
  • rna_rna.c 'subtype_items'
  • bpy_props.c as multiple enums

This patch syncs the definitions across all places so that they are the
same everywhere. It also looks redundant to define these twice in
rna_rna.c, now just use 'rna_enum_property_subtype_items' there (and get
rid off 'subtype_items').

Also moved 'POWER' & 'TEMPERATURE' to number enum in bpy_props (these
were defined in the array enum).

Fixes T82167.

Diff Detail

rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Oct 28 2020, 12:56 PM
Philipp Oeser (lichtwerk) created this revision.

Generally looks fine, but not sure about the removal of subtype_items, I thought this being a sub-set of rna_enum_property_subtype_items was on purpose? Not sure why it was like that though. @Brecht Van Lommel (brecht) might also have some insights here?

The code duplication was introduced in rB8e0fe8bff72e: Merged the particles-2010 branch with node improvements into trunk., and I can't see a good reason for it. As far as I can tell these should be the same.

This revision is now accepted and ready to land.Oct 28 2020, 2:03 PM