diff --git a/scripts/startup/bl_ui/properties_object.py b/scripts/startup/bl_ui/properties_object.py index 3977782050f..c299d88f7eb 100644 --- a/scripts/startup/bl_ui/properties_object.py +++ b/scripts/startup/bl_ui/properties_object.py @@ -37,6 +37,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel): layout.use_property_split = True ob = context.object + layout.prop(ob, "rating") col = layout.column() row = col.row(align=True) diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index ad84ab716c0..e33a85d54d5 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -441,6 +441,10 @@ typedef struct Object { uint8_t modifier_flag; char _pad8[4]; + /* Rating. */ + int rating; + char _pad9[4]; + struct PreviewImage *preview; ObjectLineArt lineart; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f7a83915ed2..cc49b898686 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -3145,6 +3145,16 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Data", "Object data"); RNA_def_property_update(prop, 0, "rna_Object_data_update"); + static const EnumPropertyItem rating_items[] = { + {0, "BAD", 0, "Bad", "I don't like this"}, + {1, "GOOD", 0, "Good", "I like this one"}, + {0, NULL, 0, NULL, NULL}, + }; + + prop = RNA_def_property(srna, "rating", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rating_items); + RNA_def_property_ui_text(prop, "Rating", "Rating of the Object"); + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, rna_enum_object_type_items);