ModelMaterialSlot.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0 OR MIT
  5. *
  6. */
  7. #include <Atom/RPI.Reflect/Model/ModelMaterialSlot.h>
  8. #include <AzCore/Asset/AssetSerializer.h>
  9. #include <AzCore/RTTI/ReflectContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. namespace AZ
  12. {
  13. namespace RPI
  14. {
  15. // Normally this would be defined in the header file and substituted by the compiler, but for
  16. // some reason clang doesn't accept it.
  17. const ModelMaterialSlot::StableId ModelMaterialSlot::InvalidStableId = std::numeric_limits<ModelMaterialSlot::StableId>::max();
  18. void ModelMaterialSlot::Reflect(AZ::ReflectContext* context)
  19. {
  20. if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  21. {
  22. serializeContext->Class<ModelMaterialSlot>()
  23. ->Version(0)
  24. ->Field("StableId", &ModelMaterialSlot::m_stableId)
  25. ->Field("DisplayName", &ModelMaterialSlot::m_displayName)
  26. ->Field("DefaultMaterialAsset", &ModelMaterialSlot::m_defaultMaterialAsset)
  27. ;
  28. }
  29. }
  30. } // namespace RPI
  31. } // namespace AZ