From a44299ccd11759363a18f623f7070c4e2febe33f Mon Sep 17 00:00:00 2001 From: Phil Stopford Date: Mon, 3 Aug 2020 10:08:31 -0400 Subject: Ocean Modifier: Add viewport resolution Following work done in 2.83, the resolution control is now a real level-of-detail parameter. It is now useful to be able to set the resolution for display independently from render. This is true for both mesh generation and mesh deformation modes. For compatibility with old scenes, resolution is retained and is the render resolution. Old modifiers loaded have the value of resolution also applied to viewport resolution. This allows newer modifiers to be used in older versions without trouble Differential Revision: https://developer.blender.org/D8336 --- source/blender/makesrna/intern/rna_modifier.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_modifier.c') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index ea33307060c..a891194550f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -113,7 +113,7 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = { {0, "", 0, N_("Generate"), ""}, {eModifierType_Array, "ARRAY", - ICON_MOD_ARRAY, + ICON_MOD_ARRAY, "Array", "Create copies of the shape with offsets"}, {eModifierType_Bevel, @@ -5712,7 +5712,17 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_range(prop, 1, 32, 1, -1); - RNA_def_property_ui_text(prop, "Resolution", "Resolution of the generated surface"); + RNA_def_property_ui_text( + prop, "Render Resolution", "Resolution of the generated surface for rendering and baking"); + RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); + + prop = RNA_def_property(srna, "viewport_resolution", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "viewport_resolution"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, 1, 1024); + RNA_def_property_ui_range(prop, 1, 32, 1, -1); + RNA_def_property_ui_text( + prop, "Viewport Resolution", "Viewport resolution of the generated surface"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); prop = RNA_def_property(srna, "spatial_size", PROP_INT, PROP_NONE); -- cgit v1.2.3