Anim: i18n-ize default Action layer names
Internationalize the default Action layer name. Instead of `"Layer"`,
use `DATA_("Layer")`. This is the same for other defaults in Blender.
When upgrading a legacy Action to a slotted Action, it also gets a layer
and a keyframe strip on that layer. Those are not shown in the user
interface yet, but will in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/133009
This commit is contained in:
@@ -251,7 +251,7 @@ Layer &Action::layer_add(const std::optional<StringRefNull> name)
|
||||
STRNCPY_UTF8(new_layer.name, name.value().c_str());
|
||||
}
|
||||
else {
|
||||
STRNCPY_UTF8(new_layer.name, layer_default_name);
|
||||
STRNCPY_UTF8(new_layer.name, DATA_(layer_default_name));
|
||||
}
|
||||
|
||||
grow_array_and_append<::ActionLayer *>(&this->layer_array, &this->layer_array_num, &new_layer);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
namespace blender::animrig::versioning {
|
||||
|
||||
constexpr const char *DEFAULT_VERSIONED_SLOT_NAME = "Legacy Slot";
|
||||
constexpr const char *DEFAULT_VERSIONED_LAYER_NAME = "Layer";
|
||||
|
||||
bool action_is_layered(const bAction &dna_action)
|
||||
{
|
||||
@@ -99,7 +100,7 @@ void convert_legacy_animato_action(bAction &dna_action)
|
||||
DATA_(DEFAULT_VERSIONED_SLOT_NAME)};
|
||||
action.slot_identifier_define(slot, slot_identifier);
|
||||
|
||||
Layer &layer = action.layer_add("Layer");
|
||||
Layer &layer = action.layer_add(DATA_(DEFAULT_VERSIONED_LAYER_NAME));
|
||||
blender::animrig::Strip &strip = layer.strip_add(action,
|
||||
blender::animrig::Strip::Type::Keyframe);
|
||||
Channelbag &bag = strip.data<StripKeyframeData>(action).channelbag_for_slot_ensure(slot);
|
||||
|
||||
Reference in New Issue
Block a user