18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 05:57:08 +01:00

feat(editor): a window to see and edit the components of an EU07M model

Selecting a scenery model loaded from an .eu07m file opens the "EU07M
model" window: the tree of the nodes with their transforms and the
components aimed at each of them, then the components of the model.

- The fields of SOCK, JOIN, CHNL (with its bindings), LGHT, LSLT, EMIT,
  COLL and MREF are edited; the other components are shown by size.
- The clip flags are edited, and a time slider holds the instance at a
  pose (time stands still in the editor); TAnimModel::play_clip takes
  the second to start from.
- Channel sliders try the channels on the instance without changing
  the file.
- "Save the model" validates the model and writes the file through a
  temporary one; the family store is kept. "Read it again" drops the
  changes.

The geometry, the mapping and the materials aren't edited. The Polish
texts of the window are added to lang/editor_pl.po.
This commit is contained in:
maj00r
2026-11-29 15:18:35 +01:00
parent d930b6519d
commit 07b902d034
9 changed files with 808 additions and 5 deletions
+4 -2
View File
@@ -802,7 +802,7 @@ void TAnimModel::light_parts_shown( int const Light, bool &Lit, bool &Dark ) con
}
}
bool TAnimModel::play_clip( std::string_view const Name, float const Speed ) {
bool TAnimModel::play_clip( std::string_view const Name, float const Speed, float const From ) {
if( pModel == nullptr ) { return false; }
auto const &clips { pModel->clips() };
@@ -810,7 +810,9 @@ bool TAnimModel::play_clip( std::string_view const Name, float const Speed ) {
if( found == clips.end() ) { return false; }
auto const index { static_cast<std::size_t>( std::distance( clips.begin(), found ) ) };
std::erase_if( m_clips, [ index ]( clip_playing const &Playing ) { return Playing.clip == index; } );
m_clips.push_back( { index, Timer::GetTime(), Speed } );
// started as long before now as From takes at the pace
auto const pace { std::max( Speed, 1e-3f ) };
m_clips.push_back( { index, Timer::GetTime() - static_cast<double>( From / pace ), pace } );
m_autoplaystarted = true;
return true;
}