From 3a9f3d1e78534c75f93469c708f9f4d75af6e304 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Fri, 14 Jun 2024 18:35:15 +0100 Subject: [PATCH] Print warnings when editing out of editable area instead of verbose prints --- edition/voxel_tool.cpp | 12 ++++++------ edition/voxel_tool_lod_terrain.cpp | 14 +++++++------- edition/voxel_tool_terrain.cpp | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/edition/voxel_tool.cpp b/edition/voxel_tool.cpp index 003da5648..5228377fd 100644 --- a/edition/voxel_tool.cpp +++ b/edition/voxel_tool.cpp @@ -102,7 +102,7 @@ float VoxelTool::get_voxel_f(Vector3i pos) const { void VoxelTool::set_voxel(Vector3i pos, uint64_t v) { Box3i box(pos, Vector3i(1, 1, 1)); if (!is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } _set_voxel(pos, v); @@ -112,7 +112,7 @@ void VoxelTool::set_voxel(Vector3i pos, uint64_t v) { void VoxelTool::set_voxel_f(Vector3i pos, float v) { Box3i box(pos, Vector3i(1, 1, 1)); if (!is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } _set_voxel_f(pos, v); @@ -165,7 +165,7 @@ void VoxelTool::do_sphere(Vector3 center, float radius) { ); if (_allow_out_of_bounds == false && !is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -201,7 +201,7 @@ void VoxelTool::sdf_stamp_erase(const VoxelBuffer &stamp, Vector3i pos) { const Box3i box(pos, stamp.get_size()); if (!is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -226,7 +226,7 @@ void VoxelTool::do_box(Vector3i begin, Vector3i end) { const Box3i box = Box3i::from_min_max(begin, end + Vector3i(1, 1, 1)); if (_allow_out_of_bounds == false && !is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -351,7 +351,7 @@ void VoxelTool::grow_sphere(Vector3 sphere_center, float sphere_radius, float st ); if (_allow_out_of_bounds == false && !is_area_editable(voxel_box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } diff --git a/edition/voxel_tool_lod_terrain.cpp b/edition/voxel_tool_lod_terrain.cpp index 7e9a4503b..e3b1e13b9 100644 --- a/edition/voxel_tool_lod_terrain.cpp +++ b/edition/voxel_tool_lod_terrain.cpp @@ -190,7 +190,7 @@ void VoxelToolLodTerrain::do_box(Vector3i begin, Vector3i end) { op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -226,7 +226,7 @@ void VoxelToolLodTerrain::do_sphere(Vector3 center, float radius) { op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -258,7 +258,7 @@ void VoxelToolLodTerrain::do_hemisphere(Vector3 center, float radius, Vector3 fl op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -325,7 +325,7 @@ void VoxelToolLodTerrain::do_sphere_async(Vector3 center, float radius) { op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -350,7 +350,7 @@ void VoxelToolLodTerrain::paste(Vector3i pos, const VoxelBuffer &src, uint8_t ch } const Box3i box(pos, src.get_size()); if (!is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -959,7 +959,7 @@ void VoxelToolLodTerrain::stamp_sdf( // This could be avoided with a box/transformed-box intersection algorithm. Might investigate if the use case // occurs. It won't happen with full load mode. This also affects other shapes. if (!is_area_editable(voxel_box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -1011,7 +1011,7 @@ void VoxelToolLodTerrain::do_graph(Ref graph, Transform3D t .clipped(_terrain->get_voxel_bounds()); if (!is_area_editable(box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } diff --git a/edition/voxel_tool_terrain.cpp b/edition/voxel_tool_terrain.cpp index 8d4908ba5..061396c91 100644 --- a/edition/voxel_tool_terrain.cpp +++ b/edition/voxel_tool_terrain.cpp @@ -243,7 +243,7 @@ void VoxelToolTerrain::do_box(Vector3i begin, Vector3i end) { op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -277,7 +277,7 @@ void VoxelToolTerrain::do_sphere(Vector3 center, float radius) { op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; } @@ -308,7 +308,7 @@ void VoxelToolTerrain::do_hemisphere(Vector3 center, float radius, Vector3 flat_ op.strength = get_sdf_strength(); if (!is_area_editable(op.box)) { - ZN_PRINT_VERBOSE("Area not editable"); + ZN_PRINT_WARNING("Area not editable"); return; }