Merge branch 'development' into Atom/santorac/OrderOnceDependencyForPassBuilder
This commit is contained in:
@@ -63,11 +63,21 @@ namespace AZ
|
||||
{
|
||||
BusDisconnect();
|
||||
}
|
||||
|
||||
bool MaterialBuilder::ReportMaterialAssetWarningsAsErrors() const
|
||||
{
|
||||
bool warningsAsErrors = false;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(warningsAsErrors, "/O3DE/Atom/RPI/MaterialBuilder/WarningsAsErrors");
|
||||
}
|
||||
return warningsAsErrors;
|
||||
}
|
||||
|
||||
//! Adds all relevant dependencies for a referenced source file, considering that the path might be relative to the original file location or a full asset path.
|
||||
//! This will usually include multiple source dependencies and a single job dependency, but will include only source dependencies if the file is not found.
|
||||
//! Note the AssetBuilderSDK::JobDependency::m_platformIdentifier will not be set by this function. The calling code must set this value before passing back
|
||||
//! to the AssetBuilderSDK::CreateJobsResponse. If isOrderedOnceForMaterialTypes is true and the dependency is a materialtype file, the job dependency type
|
||||
//! to the AssetBuilderSDK::CreateJobsResponse. If isOrderedOnceForMaterialTypes is true and the dependency is a .materialtype file, the job dependency type
|
||||
//! will be set to JobDependencyType::OrderOnce.
|
||||
void AddPossibleDependencies(AZStd::string_view currentFilePath,
|
||||
AZStd::string_view referencedParentPath,
|
||||
@@ -277,8 +287,8 @@ namespace AZ
|
||||
|
||||
return materialTypeAssetOutcome.GetValue();
|
||||
}
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json)
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> MaterialBuilder::CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json) const
|
||||
{
|
||||
auto material = LoadSourceData<MaterialSourceData>(json, materialSourceFilePath);
|
||||
|
||||
@@ -292,7 +302,7 @@ namespace AZ
|
||||
return {};
|
||||
}
|
||||
|
||||
auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, true);
|
||||
auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, ReportMaterialAssetWarningsAsErrors());
|
||||
if (!materialAssetOutcome.IsSuccess())
|
||||
{
|
||||
return {};
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <AssetBuilderSDK/AssetBuilderBusses.h>
|
||||
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
|
||||
#include <AzCore/JSON/document.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -37,6 +39,9 @@ namespace AZ
|
||||
|
||||
private:
|
||||
|
||||
AZ::Data::Asset<MaterialAsset> CreateMaterialAsset(AZStd::string_view materialSourceFilePath, const rapidjson::Value& json) const;
|
||||
bool ReportMaterialAssetWarningsAsErrors() const;
|
||||
|
||||
bool m_isShuttingDown = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -948,19 +948,17 @@ namespace AZ
|
||||
{
|
||||
AZStd::vector<uint16_t>& skinJointIndices = productMesh.m_skinJointIndices;
|
||||
AZStd::vector<float>& skinWeights = productMesh.m_skinWeights;
|
||||
const auto& sourceMeshData = sourceMesh.m_meshData;
|
||||
|
||||
size_t numInfluencesAdded = 0;
|
||||
for (const auto& skinData : sourceMesh.m_skinData)
|
||||
{
|
||||
const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(static_cast<int>(vertexIndex));
|
||||
const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex);
|
||||
const size_t numSkinInfluences = skinData->GetLinkCount(vertexIndex);
|
||||
|
||||
size_t numInfluencesExcess = 0;
|
||||
|
||||
for (size_t influenceIndex = 0; influenceIndex < numSkinInfluences; ++influenceIndex)
|
||||
{
|
||||
const AZ::SceneAPI::DataTypes::ISkinWeightData::Link& link = skinData->GetLink(controlPointIndex, influenceIndex);
|
||||
const AZ::SceneAPI::DataTypes::ISkinWeightData::Link& link = skinData->GetLink(vertexIndex, influenceIndex);
|
||||
|
||||
const float weight = link.weight;
|
||||
const AZStd::string& boneName = skinData->GetBoneName(link.boneId);
|
||||
@@ -2088,7 +2086,7 @@ namespace AZ
|
||||
AZ::Vector3 vpos; //note: it seems to be fastest to reuse a local Vector3 rather than constructing new ones each loop iteration
|
||||
for (uint32_t i = 0; i < elementCount; ++i)
|
||||
{
|
||||
vpos.Set(const_cast<float*>(reinterpret_cast<const float*>(&buffer[i])));
|
||||
vpos.Set(reinterpret_cast<const float*>(&buffer[i]));
|
||||
aabb.AddPoint(vpos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace AZ
|
||||
namespace RPI
|
||||
{
|
||||
/**
|
||||
* This is the central component that drive the process of exporting a scene to Model
|
||||
* This is the central component that drive the process of exporting a scene to Model
|
||||
* and Material assets. It delegates asset-build duties to other components like
|
||||
* ModelAssetBuilderComponent and MaterialAssetBuilderComponent via export events.
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ namespace AZ
|
||||
|
||||
AZStd::string_view m_relativeFileName;
|
||||
AZStd::string_view m_extension;
|
||||
const Uuid m_sourceUuid;
|
||||
const Uuid m_sourceUuid = Uuid::CreateNull();
|
||||
const DataStream::StreamType m_dataStreamType = DataStream::ST_BINARY;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user