diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-12-07 15:53:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-12-07 15:53:03 +0300 |
commit | 1c7cfa025c87e8f31790b48cbb189949f7949ad1 (patch) | |
tree | 3869d475a9d10c005b0bb8006eb77bf55f1903d3 /source/blender/makesrna | |
parent | 46f518e92790a04885f4e047bb59b11019d73aa3 (diff) | |
parent | 2e2e6e3bdb694e56fcd161f06b6751e953cd2fa1 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_smoke.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 3 |
6 files changed, 27 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 3861f4d19b9..5336a63fb76 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -128,7 +128,7 @@ const EnumPropertyItem rna_enum_brush_image_tool_items[] = { #include "RNA_access.h" -#include "BKE_texture.h" +#include "BKE_colorband.h" #include "BKE_brush.h" #include "BKE_icons.h" #include "BKE_paint.h" @@ -474,7 +474,7 @@ static void rna_Brush_use_gradient_set(PointerRNA *ptr, int value) else br->flag &= ~BRUSH_USE_GRADIENT; if ((br->flag & BRUSH_USE_GRADIENT) && br->gradient == NULL) - br->gradient = add_colorband(true); + br->gradient = BKE_colorband_add(true); } static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index ad2586635c9..d9b7a58de04 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -52,12 +52,12 @@ #include "MEM_guardedalloc.h" +#include "BKE_colorband.h" #include "BKE_colortools.h" #include "BKE_image.h" #include "BKE_movieclip.h" #include "BKE_node.h" #include "BKE_sequencer.h" -#include "BKE_texture.h" #include "BKE_linestyle.h" #include "DEG_depsgraph.h" @@ -362,12 +362,12 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float color[4]) { - do_colorband(coba, position, color); + BKE_colorband_evaluate(coba, position, color); } static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *reports, float position) { - CBData *element = colorband_element_add(coba, position); + CBData *element = BKE_colorband_element_add(coba, position); if (element == NULL) BKE_reportf(reports, RPT_ERROR, "Unable to add element to colorband (limit %d)", MAXCOLORBAND); @@ -379,7 +379,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *repo { CBData *element = element_ptr->data; int index = (int)(element - coba->data); - if (colorband_element_remove(coba, index) == false) { + if (BKE_colorband_element_remove(coba, index) == false) { BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element"); return; } diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index a2845b3a2f8..440af0d0e8e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -85,6 +85,7 @@ const EnumPropertyItem rna_enum_ramp_blend_items[] = { #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "BKE_colorband.h" #include "BKE_context.h" #include "BKE_main.h" #include "BKE_material.h" @@ -323,7 +324,7 @@ static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value) else ma->mode &= ~MA_RAMP_COL; if ((ma->mode & MA_RAMP_COL) && ma->ramp_col == NULL) - ma->ramp_col = add_colorband(false); + ma->ramp_col = BKE_colorband_add(false); } static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) @@ -334,7 +335,7 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) else ma->mode &= ~MA_RAMP_SPEC; if ((ma->mode & MA_RAMP_SPEC) && ma->ramp_spec == NULL) - ma->ramp_spec = add_colorband(false); + ma->ramp_spec = BKE_colorband_add(false); } static void rna_Material_use_nodes_update(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index c443b68b209..1858b6db997 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2124,6 +2124,20 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop = RNA_def_property(srna, "offset_u", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "uv_offset[0]"); + RNA_def_property_range(prop, -1, 1); + RNA_def_property_ui_range(prop, -1, 1, 2, 4); + RNA_def_property_ui_text(prop, "U Offset", "Amount to offset array UVs on the U axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "offset_v", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "uv_offset[1]"); + RNA_def_property_range(prop, -1, 1); + RNA_def_property_ui_range(prop, -1, 1, 2, 4); + RNA_def_property_ui_text(prop, "V Offset", "Amount to offset array UVs on the V axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_edgesplit(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 8c2a09f1186..ac13f9d8294 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -52,9 +52,9 @@ #ifdef RNA_RUNTIME +#include "BKE_colorband.h" #include "BKE_context.h" #include "BKE_particle.h" -#include "BKE_texture.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" @@ -395,7 +395,7 @@ static void rna_Smoke_use_color_ramp_set(PointerRNA *ptr, int value) sds->use_coba = value; if (value && sds->coba == NULL) { - sds->coba = add_colorband(false); + sds->coba = BKE_colorband_add(false); } } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 43fe7bd3f76..42e3e2c83fb 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -112,6 +112,7 @@ static const EnumPropertyItem blend_type_items[] = { #include "RNA_access.h" +#include "BKE_colorband.h" #include "BKE_context.h" #include "BKE_image.h" #include "BKE_texture.h" @@ -407,7 +408,7 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) else tex->flag &= ~TEX_COLORBAND; if ((tex->flag & TEX_COLORBAND) && tex->coba == NULL) - tex->coba = add_colorband(false); + tex->coba = BKE_colorband_add(false); } static void rna_Texture_use_nodes_update(bContext *C, PointerRNA *ptr) |