diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-14 06:52:06 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-14 06:52:06 +0300 |
commit | 83d0810a9ff00c22208a4d94bfb9ba5c448c8861 (patch) | |
tree | fce2d9e669f22039b5655660892f55cad7e917ee /source | |
parent | 2abbcaa02170b791364ccb4b1fc355a4932af8c8 (diff) | |
parent | 9b54c81414801446940fdc32d8fa1ab267d55c90 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_collection.c | 31 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 4 |
7 files changed, 36 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index fbe61a23d11..68d837ba4b4 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -2265,7 +2265,7 @@ int UI_icon_from_idcode(const int idcode) case ID_GD: return ICON_GREASEPENCIL; case ID_GR: - return ICON_GROUP; + return ICON_OUTLINER_COLLECTION; case ID_IM: return ICON_IMAGE_DATA; case ID_LA: diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 70c3552e8da..ee08f29017a 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -451,7 +451,7 @@ static int object_hide_collection_invoke(bContext *C, wmOperator *op, const wmEv /* Open popup menu. */ const char *title = CTX_IFACE_(op->type->translation_context, op->type->name); - uiPopupMenu *pup = UI_popup_menu_begin(C, title, ICON_GROUP); + uiPopupMenu *pup = UI_popup_menu_begin(C, title, ICON_OUTLINER_COLLECTION); uiLayout *layout = UI_popup_menu_layout(pup); ED_collection_hide_menu_draw(C, layout); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 22bb99530dc..7242d7e0002 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2534,7 +2534,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) data.icon = ICON_SCRIPT; break; case ID_GR: - data.icon = ICON_GROUP; + data.icon = ICON_OUTLINER_COLLECTION; break; case ID_HA: data.icon = ICON_OUTLINER_DATA_HAIR; diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 0fd35a25b41..452c6754d10 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -52,7 +52,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_CU, "CURVE", ICON_CURVE_DATA, "Curve", ""}, {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""}, {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""}, - {ID_GR, "COLLECTION", ICON_GROUP, "Collection", ""}, + {ID_GR, "COLLECTION", ICON_OUTLINER_COLLECTION, "Collection", ""}, {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, {ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""}, diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 90414613fdd..20a455f5312 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -344,6 +344,31 @@ static void rna_Collection_flag_update(Main *bmain, Scene *scene, PointerRNA *pt WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene); } +static int rna_Collection_color_tag_get(struct PointerRNA *ptr) +{ + Collection *collection = (Collection *)ptr->data; + + return collection->color_tag; +} + +static void rna_Collection_color_tag_set(struct PointerRNA *ptr, int value) +{ + Collection *collection = (Collection *)ptr->data; + + if (collection->flag & COLLECTION_IS_MASTER) { + return; + } + + collection->color_tag = value; +} + +static void rna_Collection_color_tag_update(Main *UNUSED(bmain), + Scene *scene, + PointerRNA *UNUSED(ptr)) +{ + WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, scene); +} + #else /* collection.objects */ @@ -407,7 +432,7 @@ void RNA_def_collections(BlenderRNA *brna) srna = RNA_def_struct(brna, "Collection", "ID"); RNA_def_struct_ui_text(srna, "Collection", "Collection of Object data-blocks"); - RNA_def_struct_ui_icon(srna, ICON_GROUP); + RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION); /* This is done on save/load in readfile.c, * removed if no objects are in the collection and not in a scene. */ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); @@ -494,9 +519,11 @@ void RNA_def_collections(BlenderRNA *brna) prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "color_tag"); + RNA_def_property_enum_funcs( + prop, "rna_Collection_color_tag_get", "rna_Collection_color_tag_set", NULL); RNA_def_property_enum_items(prop, rna_enum_collection_color_items); RNA_def_property_ui_text(prop, "Collection Color", "Color tag for a collection"); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_color_tag_update"); RNA_define_lib_overridable(false); } diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index d3e2445366e..54ee49be65e 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -347,7 +347,7 @@ static void rna_def_layer_collection(BlenderRNA *brna) srna = RNA_def_struct(brna, "LayerCollection", NULL); RNA_def_struct_ui_text(srna, "Layer Collection", "Layer collection"); - RNA_def_struct_ui_icon(srna, ICON_GROUP); + RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION); prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f63a4ce041f..13dcdf62db2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -5605,7 +5605,7 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna) ICON_GREASEPENCIL, "Grease Pencil", "Show Grease pencil data-blocks"}, - {FILTER_ID_GR, "filter_group", ICON_GROUP, "Collections", "Show Collection data-blocks"}, + {FILTER_ID_GR, "filter_group", ICON_OUTLINER_COLLECTION, "Collections", "Show Collection data-blocks"}, {FILTER_ID_HA, "filter_hair", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"}, {FILTER_ID_IM, "filter_image", ICON_IMAGE_DATA, "Images", "Show Image data-blocks"}, {FILTER_ID_LA, "filter_light", ICON_LIGHT_DATA, "Lights", "Show Light data-blocks"}, @@ -5679,7 +5679,7 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna) {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"}, {FILTER_ID_OB | FILTER_ID_GR, "category_object", - ICON_GROUP, + ICON_OUTLINER_COLLECTION, "Objects & Collections", "Show objects and collections"}, {FILTER_ID_AR | FILTER_ID_CU | FILTER_ID_LT | FILTER_ID_MB | FILTER_ID_ME | FILTER_ID_HA | |