ScriptCanvasAssetHelpers.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 <AzToolsFramework/API/EditorAssetSystemAPI.h>
  10. #include <AzCore/Component/EntityUtils.h>
  11. #include <cinttypes>
  12. #include <ScriptCanvas/Core/Core.h>
  13. namespace ScriptCanvasEditor
  14. {
  15. namespace AssetHelpers
  16. {
  17. // Simplifies the conversion of an AssetId to a string to avoid overly verbose trace calls
  18. inline AZStd::string AssetIdToString(AZ::Data::AssetId assetId) { return assetId.ToString<AZStd::string>(); }
  19. // Given the full path to the source file, attempt to get the AssetInfo
  20. bool GetSourceInfo(AZStd::string_view fullPath, AZ::Data::AssetInfo& outAssetInfo);
  21. // Given the full path to the source file, attempt to get the AssetInfo and watch folder
  22. AZ::Data::AssetInfo GetSourceInfo(const AZStd::string& sourceFilePath, AZStd::string& watchFolder);
  23. // Given the full path to the source file, attempt to get the AssetInfo and assetType
  24. AZ::Data::AssetInfo GetSourceInfoByProductId(AZ::Data::AssetId assetId, AZ::Data::AssetType assetType);
  25. void DumpAssetInfo(AZ::Data::AssetId assetId, const char* extra);
  26. bool IsValidSourceFile(const AZStd::string& filePath, ScriptCanvas::ScriptCanvasId scriptCanvasId);
  27. }
  28. }