Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_palette.c
| Show All 33 Lines | |||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| #include "DNA_brush_types.h" | #include "DNA_brush_types.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| static PaletteColor *rna_Palette_color_new(Palette *palette) | static PaletteColor *rna_Palette_color_new(Palette *palette) | ||||
| { | { | ||||
| PaletteColor *color = BKE_palette_color_add(palette); | PaletteColor *color = BKE_palette_color_add(palette); | ||||
| return color; | return color; | ||||
| } | } | ||||
| static void rna_Palette_color_remove(Palette *palette, ReportList *reports, PointerRNA *color_ptr) | static void rna_Palette_color_remove(Palette *palette, ReportList *reports, PointerRNA *color_ptr) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static void rna_def_palettecolor(BlenderRNA *brna) | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "PaletteColor", NULL); | srna = RNA_def_struct(brna, "PaletteColor", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Palette Color", ""); | RNA_def_struct_ui_text(srna, "Palette Color", ""); | ||||
| prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); | prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_float_sdna(prop, NULL, "rgb"); | RNA_def_property_float_sdna(prop, NULL, "rgb"); | ||||
| RNA_def_property_array(prop, 3); | |||||
| RNA_def_property_ui_text(prop, "Color", ""); | RNA_def_property_ui_text(prop, "Color", ""); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_float_sdna(prop, NULL, "value"); | RNA_def_property_float_sdna(prop, NULL, "value"); | ||||
| RNA_def_property_ui_text(prop, "Value", ""); | RNA_def_property_ui_text(prop, "Value", ""); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_float_sdna(prop, NULL, "value"); | RNA_def_property_float_sdna(prop, NULL, "value"); | ||||
| RNA_def_property_ui_text(prop, "Weight", ""); | RNA_def_property_ui_text(prop, "Weight", ""); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| } | } | ||||
| static void rna_def_palette(BlenderRNA *brna) | static void rna_def_palette(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "Palette", "ID"); | srna = RNA_def_struct(brna, "Palette", "ID"); | ||||
| RNA_def_struct_ui_text(srna, "Palette", ""); | RNA_def_struct_ui_text(srna, "Palette", ""); | ||||
| RNA_def_struct_ui_icon(srna, ICON_COLOR); | RNA_def_struct_ui_icon(srna, ICON_COLOR); | ||||
| prop = RNA_def_property(srna, "colors", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "colors", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "PaletteColor"); | RNA_def_property_struct_type(prop, "PaletteColor"); | ||||
| rna_def_palettecolors(brna, prop); | rna_def_palettecolors(brna, prop); | ||||
| } | } | ||||
| void RNA_def_palette(BlenderRNA *brna) | void RNA_def_palette(BlenderRNA *brna) | ||||
| { | { | ||||
| /* *** Non-Animated *** */ | /* *** Non-Animated *** */ | ||||
| RNA_define_animate_sdna(false); | RNA_define_animate_sdna(false); | ||||
| rna_def_palettecolor(brna); | rna_def_palettecolor(brna); | ||||
| rna_def_palette(brna); | rna_def_palette(brna); | ||||
| RNA_define_animate_sdna(true); | RNA_define_animate_sdna(true); | ||||
| } | } | ||||
| #endif | #endif | ||||
campbellbarton: Think this should be `texture_offset` - `rna_smoke.c:1031` names it this way. | |||||
Not Done Inline ActionsDead code. sergey: Dead code. | |||||
Think this should be texture_offset - rna_smoke.c:1031 names it this way.