[Bf-blender-cvs] [0a4249561cf] master: Fix compile error from merge.
Joseph Eagar
noreply at git.blender.org
Wed Aug 31 18:08:39 CEST 2022
Commit: 0a4249561cf0545ce0d46e547ee2760f57948db6
Author: Joseph Eagar
Date: Wed Aug 31 09:08:17 2022 -0700
Branches: master
https://developer.blender.org/rB0a4249561cf0545ce0d46e547ee2760f57948db6
Fix compile error from merge.
===================================================================
M source/blender/modifiers/intern/MOD_ocean.c
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index fb28c08d60b..ea8e534f585 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -441,46 +441,47 @@ static Mesh *doOcean(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mes
}
}
}
+ }
- /* displace the geometry */
+ /* displace the geometry */
- /* NOTE: tried to parallelized that one and previous foam loop,
- * but gives 20% slower results... odd. */
- {
- const int verts_num = result->totvert;
+ /* NOTE: tried to parallelized that one and previous foam loop,
+ * but gives 20% slower results... odd. */
+ {
+ const int verts_num = result->totvert;
- for (i = 0; i < verts_num; i++) {
- float *vco = mverts[i].co;
- const float u = OCEAN_CO(size_co_inv, vco[0]);
- const float v = OCEAN_CO(size_co_inv, vco[1]);
+ for (i = 0; i < verts_num; i++) {
+ float *vco = mverts[i].co;
+ const float u = OCEAN_CO(size_co_inv, vco[0]);
+ const float v = OCEAN_CO(size_co_inv, vco[1]);
- if (omd->oceancache && omd->cached == true) {
- BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra_for_cache, u, v);
- }
- else {
- BKE_ocean_eval_uv(omd->ocean, &ocr, u, v);
- }
+ if (omd->oceancache && omd->cached == true) {
+ BKE_ocean_cache_eval_uv(omd->oceancache, &ocr, cfra_for_cache, u, v);
+ }
+ else {
+ BKE_ocean_eval_uv(omd->ocean, &ocr, u, v);
+ }
- vco[2] += ocr.disp[1];
+ vco[2] += ocr.disp[1];
- if (omd->chop_amount > 0.0f) {
- vco[0] += ocr.disp[0];
- vco[1] += ocr.disp[2];
- }
+ if (omd->chop_amount > 0.0f) {
+ vco[0] += ocr.disp[0];
+ vco[1] += ocr.disp[2];
}
}
+ }
- BKE_mesh_tag_coords_changed(mesh);
+ BKE_mesh_tag_coords_changed(mesh);
- if (allocated_ocean) {
- BKE_ocean_free(omd->ocean);
- omd->ocean = NULL;
- }
+ if (allocated_ocean) {
+ BKE_ocean_free(omd->ocean);
+ omd->ocean = NULL;
+ }
# undef OCEAN_CO
- return result;
- }
+ return result;
+}
#else /* WITH_OCEANSIM */
static Mesh *doOcean(ModifierData *UNUSED(md), const ModifierEvalContext *UNUSED(ctx), Mesh *mesh)
{
@@ -488,249 +489,249 @@ static Mesh *doOcean(ModifierData *UNUSED(md), const ModifierEvalContext *UNUSED
}
#endif /* WITH_OCEANSIM */
- static Mesh *modifyMesh(ModifierData * md, const ModifierEvalContext *ctx, Mesh *mesh)
- {
- return doOcean(md, ctx, mesh);
- }
- // #define WITH_OCEANSIM
- static void panel_draw(const bContext *UNUSED(C), Panel *panel)
- {
- uiLayout *layout = panel->layout;
+static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
+{
+ return doOcean(md, ctx, mesh);
+}
+// #define WITH_OCEANSIM
+static void panel_draw(const bContext *UNUSED(C), Panel *panel)
+{
+ uiLayout *layout = panel->layout;
#ifdef WITH_OCEANSIM
- uiLayout *col, *sub;
+ uiLayout *col, *sub;
- PointerRNA ob_ptr;
- PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
+ PointerRNA ob_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) {
- 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);
- }
+ 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) {
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, "repeat_x", 0, IFACE_("Repeat X"), ICON_NONE);
+ uiItemR(sub, ptr, "repeat_y", 0, IFACE_("Y"), ICON_NONE);
+ }
- uiItemR(col, ptr, "time", 0, NULL, 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(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, "time", 0, NULL, ICON_NONE);
- uiItemR(col, ptr, "random_seed", 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, "use_normals", 0, NULL, ICON_NONE);
+ uiItemR(col, ptr, "random_seed", 0, NULL, ICON_NONE);
- modifier_panel_end(layout, ptr);
+ uiItemR(col, ptr, "use_normals", 0, NULL, ICON_NONE);
+
+ modifier_panel_end(layout, ptr);
#else /* WITH_OCEANSIM */
uiItemL(layout, TIP_("Built without Ocean modifier"), ICON_NONE);
#endif /* WITH_OCEANSIM */
- }
+}
#ifdef WITH_OCEANSIM
- static void waves_panel_draw(const bContext *UNUSED(C), Panel *panel)
- {
- uiLayout *col, *sub;
- uiLayout *layout = panel->layout;
+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(panel, NULL);
+ PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
- uiLayoutSetPropSep(layout, true);
+ 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);
+ 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);
- uiItemS(layout);
+ uiItemS(layout);
- col = uiLayoutColumn(layout, false);
- 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);
- }
+ col = uiLayoutColumn(layout, false);
+ 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);
+}
- static void foam_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
- {
- uiLayout *layout = panel->layout;
+static void foam_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
+{
+ uiLayout *layout = panel->layout;
- PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
+ 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 *UNUSED(C), Panel *panel)
- {
- uiLayout *col;
- uiLayout *layout = panel->layout;
+static void foam_panel_draw(const bContext *UNUSED(C), Panel *panel)
+{
+ uiLayout *col;
+ uiLayout *layout = panel->layout;
- PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
+ 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);
+ 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);
- }
+ 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);
+}
- static void spray_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
- {
- uiLayout *row;
- uiLayout *layout = panel->layout;
+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(panel, NULL);
+ 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);
- }
+ row = uiLayoutRow(layout, false);
+ uiLayoutSetActive(row, use_foam);
+ uiItemR(row, ptr, "use_spray", 0, IFACE_("Spray"), ICON_NONE);
+}
- static void spray_panel_draw(const bContext *UNUSED(C), Panel *panel)
- {
- uiLayout *col;
- uiLayout *layout = panel->layout;
+static void spray_panel_draw(const bContext *UNUSED(C), Panel *panel)
+{
+ uiLayout *col;
+ uiLayout *layout = panel->layout;
- PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
+ 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_b
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list