diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_ocean.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 123 |
1 files changed, 57 insertions, 66 deletions
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 7b31886a220..ccd105f8f69 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -546,169 +546,160 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return result; } // #define WITH_OCEANSIM -static void panel_draw(const bContext *C, Panel *panel) +static void panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; #ifdef WITH_OCEANSIM uiLayout *col, *sub; - PointerRNA ptr; PointerRNA ob_ptr; - modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "geometry_mode", 0, NULL, ICON_NONE); - if (RNA_enum_get(&ptr, "geometry_mode") == MOD_OCEAN_GEOM_GENERATE) { + uiItemR(col, ptr, "geometry_mode", 0, NULL, ICON_NONE); + if (RNA_enum_get(ptr, "geometry_mode") == MOD_OCEAN_GEOM_GENERATE) { sub = uiLayoutColumn(col, true); - uiItemR(sub, &ptr, "repeat_x", 0, IFACE_("Repeat X"), ICON_NONE); - uiItemR(sub, &ptr, "repeat_y", 0, IFACE_("Y"), ICON_NONE); + uiItemR(sub, ptr, "repeat_x", 0, IFACE_("Repeat X"), ICON_NONE); + uiItemR(sub, ptr, "repeat_y", 0, IFACE_("Y"), ICON_NONE); } sub = uiLayoutColumn(col, true); - uiItemR(sub, &ptr, "viewport_resolution", 0, IFACE_("Resolution Viewport"), ICON_NONE); - uiItemR(sub, &ptr, "resolution", 0, IFACE_("Render"), ICON_NONE); + uiItemR(sub, ptr, "viewport_resolution", 0, IFACE_("Resolution Viewport"), ICON_NONE); + uiItemR(sub, ptr, "resolution", 0, IFACE_("Render"), ICON_NONE); - uiItemR(col, &ptr, "time", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "time", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "depth", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "size", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "spatial_size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "depth", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "size", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "spatial_size", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "random_seed", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "random_seed", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "use_normals", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "use_normals", 0, NULL, ICON_NONE); - modifier_panel_end(layout, &ptr); + modifier_panel_end(layout, ptr); #else /* WITH_OCEANSIM */ uiItemL(layout, IFACE_("Built without Ocean modifier"), ICON_NONE); - UNUSED_VARS(C); #endif /* WITH_OCEANSIM */ } #ifdef WITH_OCEANSIM -static void waves_panel_draw(const bContext *C, Panel *panel) +static void waves_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col, *sub; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "wave_scale", 0, IFACE_("Scale"), ICON_NONE); - uiItemR(col, &ptr, "wave_scale_min", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "choppiness", 0, NULL, ICON_NONE); - uiItemR(col, &ptr, "wind_velocity", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "wave_scale", 0, IFACE_("Scale"), ICON_NONE); + uiItemR(col, ptr, "wave_scale_min", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "choppiness", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "wind_velocity", 0, NULL, ICON_NONE); uiItemS(layout); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "wave_alignment", UI_ITEM_R_SLIDER, IFACE_("Alignment"), ICON_NONE); + uiItemR(col, ptr, "wave_alignment", UI_ITEM_R_SLIDER, IFACE_("Alignment"), ICON_NONE); sub = uiLayoutColumn(col, false); - uiLayoutSetActive(sub, RNA_float_get(&ptr, "wave_alignment") > 0.0f); - uiItemR(sub, &ptr, "wave_direction", 0, IFACE_("Direction"), ICON_NONE); - uiItemR(sub, &ptr, "damping", 0, NULL, ICON_NONE); + uiLayoutSetActive(sub, RNA_float_get(ptr, "wave_alignment") > 0.0f); + uiItemR(sub, ptr, "wave_direction", 0, IFACE_("Direction"), ICON_NONE); + uiItemR(sub, ptr, "damping", 0, NULL, ICON_NONE); } -static void foam_panel_draw_header(const bContext *C, Panel *panel) +static void foam_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - uiItemR(layout, &ptr, "use_foam", 0, IFACE_("Foam"), ICON_NONE); + uiItemR(layout, ptr, "use_foam", 0, IFACE_("Foam"), ICON_NONE); } -static void foam_panel_draw(const bContext *C, Panel *panel) +static void foam_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam); - uiItemR(col, &ptr, "foam_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); - uiItemR(col, &ptr, "foam_coverage", 0, IFACE_("Coverage"), ICON_NONE); + uiItemR(col, ptr, "foam_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); + uiItemR(col, ptr, "foam_coverage", 0, IFACE_("Coverage"), ICON_NONE); } -static void spray_panel_draw_header(const bContext *C, Panel *panel) +static void spray_panel_draw_header(const bContext *UNUSED(C), Panel *panel) { uiLayout *row; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); row = uiLayoutRow(layout, false); uiLayoutSetActive(row, use_foam); - uiItemR(row, &ptr, "use_spray", 0, IFACE_("Spray"), ICON_NONE); + uiItemR(row, ptr, "use_spray", 0, IFACE_("Spray"), ICON_NONE); } -static void spray_panel_draw(const bContext *C, Panel *panel) +static void spray_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); - bool use_spray = RNA_boolean_get(&ptr, "use_spray"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); + bool use_spray = RNA_boolean_get(ptr, "use_spray"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam && use_spray); - uiItemR(col, &ptr, "spray_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); - uiItemR(col, &ptr, "invert_spray", 0, IFACE_("Invert"), ICON_NONE); + uiItemR(col, ptr, "spray_layer_name", 0, IFACE_("Data Layer"), ICON_NONE); + uiItemR(col, ptr, "invert_spray", 0, IFACE_("Invert"), ICON_NONE); } -static void spectrum_panel_draw(const bContext *C, Panel *panel) +static void spectrum_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); - int spectrum = RNA_enum_get(&ptr, "spectrum"); + int spectrum = RNA_enum_get(ptr, "spectrum"); uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, &ptr, "spectrum", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "spectrum", 0, NULL, ICON_NONE); if (ELEM(spectrum, MOD_OCEAN_SPECTRUM_TEXEL_MARSEN_ARSLOE, MOD_OCEAN_SPECTRUM_JONSWAP)) { - uiItemR(col, &ptr, "sharpen_peak_jonswap", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemR(col, &ptr, "fetch_jonswap", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "sharpen_peak_jonswap", UI_ITEM_R_SLIDER, NULL, ICON_NONE); + uiItemR(col, ptr, "fetch_jonswap", 0, NULL, ICON_NONE); } } -static void bake_panel_draw(const bContext *C, Panel *panel) +static void bake_panel_draw(const bContext *UNUSED(C), Panel *panel) { uiLayout *col; uiLayout *layout = panel->layout; - PointerRNA ptr; - modifier_panel_get_property_pointers(C, panel, NULL, &ptr); + PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); uiLayoutSetPropSep(layout, true); - bool is_cached = RNA_boolean_get(&ptr, "is_cached"); - bool use_foam = RNA_boolean_get(&ptr, "use_foam"); + bool is_cached = RNA_boolean_get(ptr, "is_cached"); + bool use_foam = RNA_boolean_get(ptr, "use_foam"); if (is_cached) { PointerRNA op_ptr; @@ -726,16 +717,16 @@ static void bake_panel_draw(const bContext *C, Panel *panel) uiItemO(layout, NULL, ICON_NONE, "OBJECT_OT_ocean_bake"); } - uiItemR(layout, &ptr, "filepath", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "filepath", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, true); uiLayoutSetEnabled(col, !is_cached); - uiItemR(col, &ptr, "frame_start", 0, IFACE_("Frame Start"), ICON_NONE); - uiItemR(col, &ptr, "frame_end", 0, IFACE_("End"), ICON_NONE); + uiItemR(col, ptr, "frame_start", 0, IFACE_("Frame Start"), ICON_NONE); + uiItemR(col, ptr, "frame_end", 0, IFACE_("End"), ICON_NONE); col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, use_foam); - uiItemR(col, &ptr, "bake_foam_fade", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "bake_foam_fade", 0, NULL, ICON_NONE); } #endif /* WITH_OCEANSIM */ |