EditorMeshStatsSerializer.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. // Custom JSON serializer for Mesh Stats
  16. // Mesh stats should not be serialized with EditorMeshComponent, because they are calculated based on active model,
  17. // so the serializer simply provides empty load/store functions
  18. class JsonEditorMeshStatsSerializer : public BaseJsonSerializer
  19. {
  20. public:
  21. AZ_RTTI(JsonEditorMeshStatsSerializer, "{571290F5-98C9-45AE-BC8C-E40968B5BA6F}", BaseJsonSerializer);
  22. AZ_CLASS_ALLOCATOR_DECL;
  23. JsonSerializationResult::Result Load(
  24. void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
  25. JsonDeserializerContext& context) override;
  26. JsonSerializationResult::Result Store(
  27. rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, const Uuid& valueTypeId,
  28. JsonSerializerContext& context) override;
  29. };
  30. } // namespace Render
  31. } // namespace AZ