Geometry Nodes: Add names to String to Curves instance geometries
All checks were successful
buildbot/vdev-code-daily-lint Build done.
buildbot/vdev-code-daily-linux-x86_64 Build done.
buildbot/vdev-code-daily-windows-amd64 Build done.
buildbot/vdev-code-daily-darwin-x86_64 Build done.
buildbot/vdev-code-daily-darwin-arm64 Build done.
buildbot/vdev-code-daily-coordinator Build done.

The name of each instance geometry is the character. This makes debugging
in the spreadsheet much easier, and the objects from "Visual Geometry to Objects"
are actually usable too.

Pull Request: #135599
This commit is contained in:
Hans Goudey 2025-03-07 17:01:18 +01:00 committed by Hans Goudey
parent 39ceab03be
commit 3f596a651c

View File

@ -294,6 +294,14 @@ static Map<int, int> create_curve_instances(GeoNodeExecParams &params,
}
GeometrySet geometry_set = GeometrySet::from_curves(curves_id);
{
const char32_t char_code[2] = {layout.char_codes[i], 0};
char inserted_utf8[8] = {0};
const size_t len = BLI_str_utf32_as_utf8(inserted_utf8, char_code, sizeof(inserted_utf8));
geometry_set.name = std::string(inserted_utf8, len);
}
handles.add_new(layout.char_codes[i], instances.add_reference(std::move(geometry_set)));
}
return handles;