forked from blender/blender
Add rating to object. #4
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user