mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
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:
parent
93ce5d0cfa
commit
d06c99a088
5 changed files with 284 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue