Geometry Nodes: Rename "Grid" to "Density"
For other "Attribute Name" fields we usually give a more specific name that relates to what the attribute is actually used for, like "Mask" in the point separate node. This is a similar situation, and would also be consistent with the naming planned in D10506.
This commit is contained in:
		@@ -1950,6 +1950,13 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    /* Keep this block, even when empty. */
 | 
					    /* Keep this block, even when empty. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
 | 
				
			||||||
 | 
					      if (ntree->type == NTREE_GEOMETRY) {
 | 
				
			||||||
 | 
					        version_node_socket_name(ntree, GEO_NODE_VOLUME_TO_MESH, "Grid", "Density");
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    FOREACH_NODETREE_END;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "axes_position")) {
 | 
					    if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "axes_position")) {
 | 
				
			||||||
      /* Convert the axes draw position to its old default (tip of bone). */
 | 
					      /* Convert the axes draw position to its old default (tip of bone). */
 | 
				
			||||||
      LISTBASE_FOREACH (struct bArmature *, arm, &bmain->armatures) {
 | 
					      LISTBASE_FOREACH (struct bArmature *, arm, &bmain->armatures) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static bNodeSocketTemplate geo_node_volume_to_mesh_in[] = {
 | 
					static bNodeSocketTemplate geo_node_volume_to_mesh_in[] = {
 | 
				
			||||||
    {SOCK_GEOMETRY, N_("Geometry")},
 | 
					    {SOCK_GEOMETRY, N_("Geometry")},
 | 
				
			||||||
    {SOCK_STRING, N_("Grid")},
 | 
					    {SOCK_STRING, N_("Density")},
 | 
				
			||||||
    {SOCK_FLOAT, N_("Voxel Size"), 0.3f, 0.0f, 0.0f, 0.0f, 0.01f, FLT_MAX},
 | 
					    {SOCK_FLOAT, N_("Voxel Size"), 0.3f, 0.0f, 0.0f, 0.0f, 0.01f, FLT_MAX},
 | 
				
			||||||
    {SOCK_FLOAT, N_("Voxel Amount"), 64.0f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX},
 | 
					    {SOCK_FLOAT, N_("Voxel Amount"), 64.0f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX},
 | 
				
			||||||
    {SOCK_FLOAT, N_("Threshold"), 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX},
 | 
					    {SOCK_FLOAT, N_("Threshold"), 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX},
 | 
				
			||||||
@@ -64,7 +64,7 @@ static void geo_node_volume_to_mesh_init(bNodeTree *UNUSED(ntree), bNode *node)
 | 
				
			|||||||
      sizeof(NodeGeometryVolumeToMesh), __func__);
 | 
					      sizeof(NodeGeometryVolumeToMesh), __func__);
 | 
				
			||||||
  data->resolution_mode = VOLUME_TO_MESH_RESOLUTION_MODE_GRID;
 | 
					  data->resolution_mode = VOLUME_TO_MESH_RESOLUTION_MODE_GRID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bNodeSocket *grid_socket = nodeFindSocket(node, SOCK_IN, "Grid");
 | 
					  bNodeSocket *grid_socket = nodeFindSocket(node, SOCK_IN, "Density");
 | 
				
			||||||
  bNodeSocketValueString *grid_socket_value = (bNodeSocketValueString *)grid_socket->default_value;
 | 
					  bNodeSocketValueString *grid_socket_value = (bNodeSocketValueString *)grid_socket->default_value;
 | 
				
			||||||
  STRNCPY(grid_socket_value->value, "density");
 | 
					  STRNCPY(grid_socket_value->value, "density");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -120,7 +120,7 @@ static void create_mesh_from_volume(GeometrySet &geometry_set_in,
 | 
				
			|||||||
  Main *bmain = DEG_get_bmain(params.depsgraph());
 | 
					  Main *bmain = DEG_get_bmain(params.depsgraph());
 | 
				
			||||||
  BKE_volume_load(const_cast<Volume *>(volume), bmain);
 | 
					  BKE_volume_load(const_cast<Volume *>(volume), bmain);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const std::string grid_name = params.get_input<std::string>("Grid");
 | 
					  const std::string grid_name = params.get_input<std::string>("Density");
 | 
				
			||||||
  VolumeGrid *volume_grid = BKE_volume_grid_find(volume, grid_name.c_str());
 | 
					  VolumeGrid *volume_grid = BKE_volume_grid_find(volume, grid_name.c_str());
 | 
				
			||||||
  if (volume_grid == nullptr) {
 | 
					  if (volume_grid == nullptr) {
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user