MaterialBuilder.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AssetBuilderSDK/AssetBuilderBusses.h>
  10. #include <Atom/RPI.Reflect/Material/MaterialAsset.h>
  11. #include <Atom/RPI.Reflect/Material/MaterialTypeAsset.h>
  12. #include <Atom/RPI.Edit/Material/MaterialSourceData.h>
  13. #include <AzCore/JSON/document.h>
  14. namespace AZ
  15. {
  16. namespace RPI
  17. {
  18. class MaterialBuilder final
  19. : public AssetBuilderSDK::AssetBuilderCommandBus::Handler
  20. {
  21. public:
  22. AZ_TYPE_INFO(MaterialBuilder, "{861C0937-7671-40DC-8E44-6D432ABB9932}");
  23. static const char* JobKey;
  24. MaterialBuilder() = default;
  25. ~MaterialBuilder();
  26. // Asset Builder Callback Functions
  27. void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const;
  28. void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const;
  29. // AssetBuilderSDK::AssetBuilderCommandBus interface
  30. void ShutDown() override;
  31. /// Register to builder and listen to builder command
  32. void RegisterBuilder();
  33. private:
  34. bool ShouldReportMaterialAssetWarningsAsErrors() const;
  35. AZStd::string GetBuilderSettingsFingerprint() const;
  36. bool m_isShuttingDown = false;
  37. };
  38. } // namespace RPI
  39. } // namespace AZ