Geometry Nodes: new Bake node #115466

Merged
Jacques Lucke merged 93 commits from JacquesLucke/blender:bake-geometry-nodes into main 2023-12-18 13:01:16 +01:00
1 changed files with 4 additions and 7 deletions
Showing only changes of commit 5adc6824cc - Show all commits

View File

@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include <fmt/format.h>
#include "NOD_node_extra_info.hh"
#include "NOD_rna_define.hh"
#include "NOD_zone_socket_items.hh"
@ -448,15 +450,10 @@ struct BakeDrawContext {
static std::string get_baked_string(const BakeDrawContext &ctx)
{
char str[64];
if (ctx.bake_still && ctx.baked_range->size() == 1) {
STRNCPY(str, N_("Baked Still"));
return TIP_("Baked Still");
}
else {
SNPRINTF(
str, N_("Baked %d - %d"), int(ctx.baked_range->first()), int(ctx.baked_range->last()));
}
return str;
return fmt::format(TIP_("Baked {} - {}"), ctx.baked_range->first(), ctx.baked_range->last());
}
JacquesLucke marked this conversation as resolved Outdated

N_ doesn't really make sense here. If it's translated later, that will include the numbers which will make the lookup fail.

How about including <fmt/format.h> and using return fmt::format(TIP_("Baked {} - {}"), ctx.baked_range->first(), ctx.baked_range->last());

`N_` doesn't really make sense here. If it's translated later, that will include the numbers which will make the lookup fail. How about including `<fmt/format.h>` and using `return fmt::format(TIP_("Baked {} - {}"), ctx.baked_range->first(), ctx.baked_range->last());`

Just replacing it with TIP_ seems fine as well. Don't really want to start using <fmt/format.h> here now, I haven't looked into it much yet.

Just replacing it with `TIP_` seems fine as well. Don't really want to start using `<fmt/format.h>` here now, I haven't looked into it much yet.

It's used in other similar places. It's a required dependency, and it's just a much nicer way to do that sort of formatting that's faster and doesn't require the temporary buffer.

It's used in other similar places. It's a required dependency, and it's just a much nicer way to do that sort of formatting that's faster and doesn't require the temporary buffer.
static void draw_bake_button(uiLayout *layout, const BakeDrawContext &ctx)