From 56756ddb8ec24b3c270e236a780934b801aedfef Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:27:05 +0100 Subject: [PATCH] feat(model): .ng3d and .ng3p in what this branch adds, as below it The model files are .ng3d and the family store .ng3p, selected with modelformat ng3d (8637101d9 on feat/e4d-compact). --- application/editoruimodel.cpp | 10 +++++----- application/editoruimodel.h | 2 +- docs/eu07m-format.md | 6 +++--- lang/editor_pl.po | 8 ++++---- model/eu07m/eu07m_convert.cpp | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/editoruimodel.cpp b/application/editoruimodel.cpp index a9e2e7d05..bd0ea593f 100644 --- a/application/editoruimodel.cpp +++ b/application/editoruimodel.cpp @@ -953,7 +953,7 @@ bool eu07m_model_panel::load(TModel3d &Model) m_problem = STR("The models of the EU07M format are turned off (modelformat in eu07.ini)"); return false; } - auto const path{FileCased(Model.NameGet() + ".r3a")}; + auto const path{FileCased(Model.NameGet() + ".ng3d")}; if (path.empty()) { // one is made of the model as the game loaded it: for a vehicle, its body or its cab, that is what the game writes to the @@ -1298,12 +1298,12 @@ void eu07m_model_panel::render_header() } if (m_importable && ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", STR_C("Writes an .r3a file beside the model, made of the model as the game has it. From then on the game loads the model from it, in every scenery")); + ImGui::SetTooltip("%s", STR_C("Writes an .ng3d file beside the model, made of the model as the game has it. From then on the game loads the model from it, in every scenery")); } - // the game doesn't compare the .r3a with the file it was made of: an update of that one is shadowed by it + // the game doesn't compare the .ng3d with the file it was made of: an update of that one is shadowed by it if (m_importable) { - ImGui::TextDisabled("%s", STR_C("While the .r3a is there, a later update of the .e3d or .t3d doesn't reach the game: import it again, or delete the .r3a")); + ImGui::TextDisabled("%s", STR_C("While the .ng3d is there, a later update of the .e3d or .t3d doesn't reach the game: import it again, or delete the .ng3d")); } if (false == m_message.empty()) { @@ -1800,7 +1800,7 @@ bool eu07m_model_panel::has_animations() const bool eu07m_model_panel::editable(scene::basic_node const *Node) const { auto const *instance{dynamic_cast(Node)}; - return Global.modelformat_eu07m && (instance != nullptr) && (instance->pModel != nullptr) && (false == FileCased(instance->pModel->NameGet() + ".r3a").empty()); + return Global.modelformat_eu07m && (instance != nullptr) && (instance->pModel != nullptr) && (false == FileCased(instance->pModel->NameGet() + ".ng3d").empty()); } bool eu07m_model_panel::pick_vehicle(std::string_view const Name, int const Part) diff --git a/application/editoruimodel.h b/application/editoruimodel.h index 3c83133a3..dfa220ee7 100644 --- a/application/editoruimodel.h +++ b/application/editoruimodel.h @@ -220,7 +220,7 @@ class eu07m_model_panel int m_part{0}; // of a vehicle, the one wanted: 0 the body, 1 the cab scene::basic_node *m_lastselected{nullptr}; TModel3d *m_source{nullptr}; // the model shown, as the game has it - std::string m_path; // of the .r3a file, empty when the model has none + std::string m_path; // of the .ng3d file, empty when the model has none std::string m_problem; // why the model shown can't be edited eu07m::model m_model; std::vector m_submodels; // of the nodes of the file, in the model the game has; empty when they don't match diff --git a/docs/eu07m-format.md b/docs/eu07m-format.md index 5d1199585..e281e46bb 100644 --- a/docs/eu07m-format.md +++ b/docs/eu07m-format.md @@ -305,8 +305,8 @@ terrain and the catenary (`application/editoruimodel.cpp`). It is made for someo called by what they are (a part of a vehicle by its name, such as "Left headlamp, front"), and the fields of the format are kept under "Advanced". The model edited is the scenery model selected, a vehicle picked in the list of the vehicles, or with neither, the vehicle driven (its body or its cab), so a vehicle can be driven, the editor opened with F11, a light changed and looked at -from the cab again after F11. "Edit this model (F7)" in the inspector of a scenery model loaded from an `.r3a` file opens it -there. A model without an `.r3a` file, or one which can't be read, says so and isn't edited. +from the cab again after F11. "Edit this model (F7)" in the inspector of a scenery model loaded from an `.ng3d` file opens it +there. A model without an `.ng3d` file, or one which can't be read, says so and isn't edited. The cab of a vehicle is loaded only by getting in. When it isn't loaded yet, "Get in the cab" does what the simulation does then: it makes the train of the vehicle (`TTrain::Init`, which loads the cab, its controls and its sounds) and makes it the vehicle driven, @@ -314,7 +314,7 @@ and puts the camera in the seat of the driver. While the cab is edited the edito (`FreeFlyModeFlag` off, the vehicle the owner of the camera, which moves in the cab with the vehicle); with the body picked, or in another field of work, the view is free again. -- **A model without a file of the format.** "Import to EU07M" writes `.r3a` beside its `.e3d` (or its `.t3d`), made of +- **A model without a file of the format.** "Import to EU07M" writes `.ng3d` beside its `.e3d` (or its `.t3d`), made of the model as the game loaded it, as `eu07 -eu07m convert` makes it (`eu07m::import_model`); for a vehicle, its body or its cab, that is what the game writes to the `.e3d` it makes of a `.t3d`. From then on the game loads the model from it, in every scenery. So a model of the data whose lights aren't set, such as a lamp post or a cab with its one default light, gets its light diff --git a/lang/editor_pl.po b/lang/editor_pl.po index cdd409259..4fa78b916 100644 --- a/lang/editor_pl.po +++ b/lang/editor_pl.po @@ -17045,8 +17045,8 @@ msgstr "Zaimportowano do {}. Teraz można zmieniać jego światła i części" msgid "Import to EU07M" msgstr "Importuj do EU07M" -msgid "Writes an .r3a file beside the model, made of the model as the game has it. From then on the game loads the model from it, in every scenery" -msgstr "Zapisuje plik .r3a obok modelu, zrobiony z modelu wczytanego w grze. Od tej chwili gra wczytuje model z tego pliku, w każdej scenerii" +msgid "Writes an .ng3d file beside the model, made of the model as the game has it. From then on the game loads the model from it, in every scenery" +msgstr "Zapisuje plik .ng3d obok modelu, zrobiony z modelu wczytanego w grze. Od tej chwili gra wczytuje model z tego pliku, w każdej scenerii" msgid "Click a track, pick the vehicle and Place it; F7 goes back to the models" msgstr "Kliknij tor, wybierz pojazd i postaw go; F7 wraca do modeli" @@ -17090,8 +17090,8 @@ msgstr "Tej części nie da się usunąć: ma pod sobą inne części albo coś msgid "Removed {}. Ctrl+Z brings it back" msgstr "Usunięto {}. Ctrl+Z ją przywróci" -msgid "While the .r3a is there, a later update of the .e3d or .t3d doesn't reach the game: import it again, or delete the .r3a" -msgstr "Dopóki jest plik .r3a, późniejsza aktualizacja pliku .e3d lub .t3d nie dociera do gry: zaimportuj model ponownie albo usuń plik .r3a" +msgid "While the .ng3d is there, a later update of the .e3d or .t3d doesn't reach the game: import it again, or delete the .ng3d" +msgstr "Dopóki jest plik .ng3d, późniejsza aktualizacja pliku .e3d lub .t3d nie dociera do gry: zaimportuj model ponownie albo usuń plik .ng3d" msgid "The model %s can't be put in: a scenery doesn't take a space in the name of a file" msgstr "Nie można wstawić modelu %s: sceneria nie przyjmuje spacji w nazwie pliku" diff --git a/model/eu07m/eu07m_convert.cpp b/model/eu07m/eu07m_convert.cpp index 5d5b1e25f..40500e0cd 100644 --- a/model/eu07m/eu07m_convert.cpp +++ b/model/eu07m/eu07m_convert.cpp @@ -599,7 +599,7 @@ std::string import_model(TModel3d &Source, std::string &Error) { Error = problems.front(); return {}; } - auto const output{stem + ".r3a"}; + auto const output{stem + ".ng3d"}; auto const temporary{output + ".tmp"}; auto const bytes{write(converted)}; std::ofstream stream{temporary, std::ios::binary | std::ios::trunc};