[Bf-blender-cvs] [27e2b32a061] master: Cleanup: Remove redundant calls to init grids

Erik Abrahamsson noreply at git.blender.org
Fri Feb 3 00:16:30 CET 2023


Commit: 27e2b32a06197e02a000e8e51c9c4b4bf3d92406
Author: Erik Abrahamsson
Date:   Fri Feb 3 00:14:03 2023 +0100
Branches: master
https://developer.blender.org/rB27e2b32a06197e02a000e8e51c9c4b4bf3d92406

Cleanup: Remove redundant calls to init grids

`BKE_volume_init_grids` gets called in `volume_init_data` that is run
on creating new datablocks so it's unnecessary to run it separately.

===================================================================

M	source/blender/blenkernel/intern/volume.cc
M	source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc
M	source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
M	source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 7bf0c6f18a2..bad2e844cc0 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -1506,7 +1506,6 @@ Volume *BKE_volume_new_for_eval(const Volume *volume_src)
   volume_dst->totcol = volume_src->totcol;
   volume_dst->render = volume_src->render;
   volume_dst->display = volume_src->display;
-  BKE_volume_init_grids(volume_dst);
 
   return volume_dst;
 }
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc
index cf4d058cd31..6c0e7b4fa7e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc
@@ -125,7 +125,6 @@ static Volume *create_volume_from_mesh(const Mesh &mesh, GeoNodeExecParams &para
                                                                mesh_to_volume_space_transform);
 
   Volume *volume = reinterpret_cast<Volume *>(BKE_id_new_nomain(ID_VO, nullptr));
-  BKE_volume_init_grids(volume);
 
   /* Convert mesh to grid and add to volume. */
   geometry::volume_grid_add_from_mesh(volume,
diff --git a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
index 9d666f64d67..6fa4cff9e99 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
@@ -221,7 +221,6 @@ static void initialize_volume_component_from_points(GeoNodeExecParams &params,
   }
 
   Volume *volume = reinterpret_cast<Volume *>(BKE_id_new_nomain(ID_VO, nullptr));
-  BKE_volume_init_grids(volume);
 
   const float density = params.get_input<float>("Density");
   convert_to_grid_index_space(voxel_size, positions, radii);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc b/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc
index 7d439309380..d88940edefd 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc
@@ -169,8 +169,6 @@ static void node_geo_exec(GeoNodeExecParams params)
       openvdb::math::Vec3<float>(bounds_min.x, bounds_min.y, bounds_min.z));
 
   Volume *volume = reinterpret_cast<Volume *>(BKE_id_new_nomain(ID_VO, nullptr));
-  BKE_volume_init_grids(volume);
-
   BKE_volume_grid_add_vdb(*volume, "density", std::move(grid));
 
   GeometrySet r_geometry_set;



More information about the Bf-blender-cvs mailing list