mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 10:49:23 +00:00
Added interface for importing models in the Model Editor + fixed bugs
This commit is contained in:
@@ -39,7 +39,7 @@ void CMaterialLoader::ReadPrimeMatSet()
|
||||
{
|
||||
mpSet->mMaterials[iMat] = ReadPrimeMaterial();
|
||||
mpSet->mMaterials[iMat]->mVersion = mVersion;
|
||||
mpSet->mMaterials[iMat]->mName = std::string("Material #") + std::to_string(iMat);
|
||||
mpSet->mMaterials[iMat]->mName = std::string("Material #") + std::to_string(iMat + 1);
|
||||
mpFile->Seek(matsStart + offsets[iMat], SEEK_SET);
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void CMaterialLoader::ReadCorruptionMatSet()
|
||||
u32 Next = mpFile->Tell() + Size;
|
||||
mpSet->mMaterials[iMat] = ReadCorruptionMaterial();
|
||||
mpSet->mMaterials[iMat]->mVersion = mVersion;
|
||||
mpSet->mMaterials[iMat]->mName = std::string("Material #") + std::to_string(iMat);
|
||||
mpSet->mMaterials[iMat]->mName = std::string("Material #") + std::to_string(iMat + 1);
|
||||
mpFile->Seek(Next, SEEK_SET);
|
||||
}
|
||||
}
|
||||
@@ -581,6 +581,10 @@ CMaterial* CMaterialLoader::LoadAssimpMaterial(const aiMaterial *pAiMat)
|
||||
// todo: generate new material using import values.
|
||||
CMaterial *pMat = new CMaterial(mVersion, eNoAttributes);
|
||||
|
||||
aiString name;
|
||||
pAiMat->Get(AI_MATKEY_NAME, name);
|
||||
pMat->SetName(name.C_Str());
|
||||
|
||||
// Create generic custom pass that uses Konst color
|
||||
CMaterialPass *pPass = new CMaterialPass(pMat);
|
||||
pPass->SetColorInputs(eZeroRGB, eRasRGB, eKonstRGB, eZeroRGB);
|
||||
|
||||
Reference in New Issue
Block a user