Adds function to get material definition by mapTo usage

Re-enables logic for looking up existing material(generally just for in-place autoimport) and creates the material asset off of that. Also adds logic to look up the mapTo if it exists if the material name lookup fails.
Adds initial pass at re-enabling the sis file support for shape importing. In the event the UseManualShapeConfigRules setting is disabled(which it is by default) it will try and find the matching sis file and apply the rules from that to the config. Once the processing/import is done on the shape, the cached values of the main config are restored again.
Adds initial fbx.sis file. Needs to have the fields standardized to the config names.
This commit is contained in:
Areloch 2020-08-24 04:41:17 -05:00
parent 93ce5d0cfa
commit d06c99a088
5 changed files with 284 additions and 12 deletions

View file

@ -161,6 +161,26 @@ Material * MaterialManager::getMaterialDefinitionByName(const String &matName)
return foundMat;
}
Material* MaterialManager::getMaterialDefinitionByMapTo(const String& mapTo)
{
// Get the material
Material* foundMat = nullptr;
for (SimSet::iterator itr = mMaterialSet->begin(); itr != mMaterialSet->end(); ++itr)
{
// Fetch our listed materials.
Material* materialDef = dynamic_cast<Material*>(*itr);
if (materialDef && materialDef->mMapTo.compare(mapTo, 0U, String::NoCase) == 0)
{
//We have a match, so keep it and bail the loop
foundMat = materialDef;
break;
}
}
return foundMat;
}
BaseMatInstance* MaterialManager::createMatInstance(const String &matName)
{
BaseMaterialDefinition* mat = NULL;