Add material property names to material assets, disable FBX dependency on materialtype files. (#3408)

* Add material property names to material assets, disable FBX dependency on materialtype files.

Signed-off-by: Robin <rbarrand@amazon.com>

* Add reflection for MaterialAssets. Update member variable comment.

Signed-off-by: Robin <rbarrand@amazon.com>

* Switch cvar to using bus value. Refine comments.

Signed-off-by: Robin <rbarrand@amazon.com>

* Refactor functions and refine comments.

Signed-off-by: Robin <rbarrand@amazon.com>

* Realign property values when material property names are populated.

Signed-off-by: Robin <rbarrand@amazon.com>

* Switch PostLoadInit check to on asset status ready. Add realign property values code to PostLoadInit as well.

Signed-off-by: Robin <rbarrand@amazon.com>

* Stash@{1} code.

Signed-off-by: Robin <rbarrand@amazon.com>

* Refactor realignment code into the right places.

Signed-off-by: Robin <rbarrand@amazon.com>

* Remove pragma optmize off.

Signed-off-by: Robin <rbarrand@amazon.com>

* More refactoring.

Signed-off-by: Robin <rbarrand@amazon.com>

* Refactor comments and remove code no longer needed.

Signed-off-by: Robin <rbarrand@amazon.com>

* Refactor comments and remove unused include.

Signed-off-by: Robin <rbarrand@amazon.com>

* Comment refactor, corrected some code.

Signed-off-by: Robin <rbarrand@amazon.com>

Co-authored-by: Robin <rbarrand@amazon.com>
This commit is contained in:
hershey5045
2021-09-01 16:01:33 -07:00
committed by GitHub
parent 413e82428c
commit 4249ceeae7
10 changed files with 115 additions and 16 deletions
@@ -12,6 +12,7 @@
#include <Atom/RPI.Edit/Material/MaterialTypeSourceData.h>
#include <Atom/RPI.Edit/Material/MaterialPropertyId.h>
#include <Atom/RPI.Edit/Material/MaterialUtils.h>
#include <Atom/RPI.Edit/Material/MaterialConverterBus.h>
#include <Atom/RPI.Edit/Common/AssetUtils.h>
#include <Atom/RPI.Edit/Common/JsonFileLoadContext.h>
@@ -72,7 +73,7 @@ namespace AZ
}
}
Outcome<Data::Asset<MaterialAsset> > MaterialSourceData::CreateMaterialAsset(Data::AssetId assetId, AZStd::string_view materialSourceFilePath, bool elevateWarnings) const
Outcome<Data::Asset<MaterialAsset> > MaterialSourceData::CreateMaterialAsset(Data::AssetId assetId, AZStd::string_view materialSourceFilePath, bool elevateWarnings, bool includeMaterialPropertyNames) const
{
MaterialAssetCreator materialAssetCreator;
materialAssetCreator.SetElevateWarnings(elevateWarnings);
@@ -85,7 +86,7 @@ namespace AZ
return Failure();
}
materialAssetCreator.Begin(assetId, *materialTypeAsset.GetValue().Get());
materialAssetCreator.Begin(assetId, *materialTypeAsset.GetValue().Get(), includeMaterialPropertyNames);
}
else
{
@@ -115,7 +116,7 @@ namespace AZ
}
}
materialAssetCreator.Begin(assetId, *parentMaterialAsset.GetValue().Get());
materialAssetCreator.Begin(assetId, *parentMaterialAsset.GetValue().Get(), includeMaterialPropertyNames);
}
for (auto& group : m_properties)