EditorMaterialComponentSerializer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <AzCore/Memory/Memory.h>
  10. #include <AzCore/Serialization/Json/BaseJsonSerializer.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. // JsonEditorMaterialComponentSerializer skips serialization of EditorMaterialComponentSlot(s) which are only needed at runtime in
  16. // the editor
  17. class JsonEditorMaterialComponentSerializer : public AZ::BaseJsonSerializer
  18. {
  19. public:
  20. AZ_RTTI(JsonEditorMaterialComponentSerializer, "{D354FE3C-34D2-4E80-B3F9-49450D252336}", BaseJsonSerializer);
  21. AZ_CLASS_ALLOCATOR_DECL;
  22. AZ::JsonSerializationResult::Result Load(
  23. void* outputValue,
  24. const AZ::Uuid& outputValueTypeId,
  25. const rapidjson::Value& inputValue,
  26. AZ::JsonDeserializerContext& context) override;
  27. AZ::JsonSerializationResult::Result Store(
  28. rapidjson::Value& outputValue,
  29. const void* inputValue,
  30. const void* defaultValue,
  31. const AZ::Uuid& valueTypeId,
  32. AZ::JsonSerializerContext& context) override;
  33. };
  34. } // namespace Render
  35. } // namespace AZ