Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c3
-rw-r--r--source/blender/makesrna/intern/rna_palette.c13
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index f08771292a8..c6b519f711f 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -233,7 +233,8 @@ static bool palette_poll(bContext *C)
{
Paint *paint = BKE_paint_get_active_from_context(C);
- if (paint && paint->palette != NULL) {
+ if (paint && paint->palette != NULL && !ID_IS_LINKED(paint->palette) &&
+ !ID_IS_OVERRIDE_LIBRARY(paint->palette)) {
return true;
}
diff --git a/source/blender/makesrna/intern/rna_palette.c b/source/blender/makesrna/intern/rna_palette.c
index 67d6daf5a13..30604c7a3b8 100644
--- a/source/blender/makesrna/intern/rna_palette.c
+++ b/source/blender/makesrna/intern/rna_palette.c
@@ -37,12 +37,20 @@
# include "BKE_report.h"
static PaletteColor *rna_Palette_color_new(Palette *palette)
{
+ if (ID_IS_LINKED(palette) || ID_IS_OVERRIDE_LIBRARY(palette)) {
+ return NULL;
+ }
+
PaletteColor *color = BKE_palette_color_add(palette);
return color;
}
static void rna_Palette_color_remove(Palette *palette, ReportList *reports, PointerRNA *color_ptr)
{
+ if (ID_IS_LINKED(palette) || ID_IS_OVERRIDE_LIBRARY(palette)) {
+ return;
+ }
+
PaletteColor *color = color_ptr->data;
if (BLI_findindex(&palette->colors, color) == -1) {
@@ -58,6 +66,10 @@ static void rna_Palette_color_remove(Palette *palette, ReportList *reports, Poin
static void rna_Palette_color_clear(Palette *palette)
{
+ if (ID_IS_LINKED(palette) || ID_IS_OVERRIDE_LIBRARY(palette)) {
+ return;
+ }
+
BKE_palette_clear(palette);
}
@@ -141,6 +153,7 @@ static void rna_def_palettecolor(BlenderRNA *brna)
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "rgb");
+ RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);