MorphTargetMetaAssetCreator.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include <AzCore/Asset/AssetManager.h>
  9. #include <Atom/RPI.Reflect/Model/MorphTargetMetaAssetCreator.h>
  10. namespace AZ::RPI
  11. {
  12. void MorphTargetMetaAssetCreator::Begin(const Data::AssetId& assetId)
  13. {
  14. BeginCommon(assetId);
  15. }
  16. void MorphTargetMetaAssetCreator::AddMorphTarget(const MorphTargetMetaAsset::MorphTarget& morphTarget)
  17. {
  18. if (ValidateIsReady())
  19. {
  20. m_asset->AddMorphTarget(morphTarget);
  21. }
  22. }
  23. bool MorphTargetMetaAssetCreator::End(Data::Asset<MorphTargetMetaAsset>& result)
  24. {
  25. if (!ValidateIsReady())
  26. {
  27. return false;
  28. }
  29. m_asset->SetReady();
  30. return EndCommon(result);
  31. }
  32. bool MorphTargetMetaAssetCreator::IsEmpty()
  33. {
  34. if (ValidateIsReady())
  35. {
  36. return m_asset->GetMorphTargets().empty();
  37. }
  38. return true;
  39. }
  40. } // namespace AZ::RPI