mirror of
https://github.com/leozide/leocad
synced 2025-01-17 18:11:42 +01:00
Load submodels inside mpd files before loading files from disk.
This commit is contained in:
parent
bf75ce012f
commit
9e12f52bcd
1 changed files with 7 additions and 3 deletions
|
@ -283,7 +283,10 @@ bool Project::Load(const QString& FileName)
|
|||
Model->SplitMPD(Buffer);
|
||||
|
||||
if (mModels.IsEmpty() || !Model->GetProperties().mName.isEmpty())
|
||||
{
|
||||
mModels.Add(Model);
|
||||
Model->CreatePieceInfo(this);
|
||||
}
|
||||
else
|
||||
delete Model;
|
||||
}
|
||||
|
@ -308,6 +311,7 @@ bool Project::Load(const QString& FileName)
|
|||
if (Model->LoadBinary(&MemFile))
|
||||
{
|
||||
mModels.Add(Model);
|
||||
Model->CreatePieceInfo(this);
|
||||
Model->SetSaved();
|
||||
}
|
||||
else
|
||||
|
@ -322,12 +326,12 @@ bool Project::Load(const QString& FileName)
|
|||
lcModel* Model = mModels[0];
|
||||
|
||||
if (Model->GetProperties().mName.isEmpty())
|
||||
{
|
||||
Model->SetName(FileInfo.fileName());
|
||||
lcGetPiecesLibrary()->RenamePiece(Model->GetPieceInfo(), FileInfo.fileName().toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
for (int ModelIdx = 0; ModelIdx < mModels.GetSize(); ModelIdx++)
|
||||
mModels[ModelIdx]->CreatePieceInfo(this);
|
||||
|
||||
lcArray<lcModel*> UpdatedModels;
|
||||
UpdatedModels.AllocGrow(mModels.GetSize());
|
||||
|
||||
|
|
Loading…
Reference in a new issue