diff options
author | YimingWu <xp8110@outlook.com> | 2021-07-19 17:58:15 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2021-07-20 08:06:45 +0300 |
commit | d218ba80095bbf36db458fe2636e06c6dda14465 (patch) | |
tree | 14b88dacbacfea069f21f24af054582851a94fd9 /source/blender/makesrna/intern | |
parent | 77e927b58fca272d1d336a9def63678fb28c0632 (diff) |
LineArt: UI cleanups.
Wording on the UI, slider consistency and material mask switches layout.
Reviewed By: Sebastian Parborg (zeddb)
Differential Revision: http://developer.blender.org/D11839
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil_modifier.c | 20 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 8 |
2 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index f1c05079d9c..b5dea7b019f 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -656,6 +656,24 @@ static void rna_TextureGpencilModifier_material_set(PointerRNA *ptr, rna_GpencilModifier_material_set(ptr, value, ma_target, reports); } +static void rna_Lineart_start_level_set(PointerRNA *ptr, int value) +{ + LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)ptr->data; + + CLAMP(value, 0, 128); + lmd->level_start = value; + lmd->level_end = MAX2(value, lmd->level_end); +} + +static void rna_Lineart_end_level_set(PointerRNA *ptr, int value) +{ + LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)ptr->data; + + CLAMP(value, 0, 128); + lmd->level_end = value; + lmd->level_start = MIN2(value, lmd->level_start); +} + #else static void rna_def_modifier_gpencilnoise(BlenderRNA *brna) @@ -3068,12 +3086,14 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Level Start", "Minimum number of occlusions for the generated strokes"); RNA_def_property_range(prop, 0, 128); + RNA_def_property_int_funcs(prop, NULL, "rna_Lineart_start_level_set", NULL); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "level_end", PROP_INT, PROP_NONE); RNA_def_property_ui_text( prop, "Level End", "Maximum number of occlusions for the generated strokes"); RNA_def_property_range(prop, 0, 128); + RNA_def_property_int_funcs(prop, NULL, "rna_Lineart_end_level_set", NULL); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "target_material", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index b662f54ed4c..d91c0bfaf29 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -702,14 +702,6 @@ static void rna_def_material_lineart(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mask", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialLineArt_update"); - prop = RNA_def_property(srna, "use_mat_occlusion", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_default(prop, 0); - RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_MATERIAL_CUSTOM_OCCLUSION_EFFECTIVENESS); - RNA_def_property_ui_text(prop, - "Custom Occlusion Effectiveness", - "Use custom occlusion effectiveness for this material"); - RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialLineArt_update"); - prop = RNA_def_property(srna, "mat_occlusion", PROP_INT, PROP_NONE); RNA_def_property_int_default(prop, 1); RNA_def_property_ui_range(prop, 0.0f, 5.0f, 1.0f, 1); |