2
0

AssImpMeshImporterUtilities.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 <SceneAPI/SceneCore/Events/ProcessingResult.h>
  10. struct aiNode;
  11. struct aiScene;
  12. namespace AZ
  13. {
  14. namespace SceneData
  15. {
  16. namespace GraphData
  17. {
  18. class MeshData;
  19. class BlendShapeData;
  20. }
  21. }
  22. namespace SceneAPI
  23. {
  24. namespace DataTypes
  25. {
  26. class IGraphObject;
  27. }
  28. struct AssImpSceneNodeAppendedContext;
  29. class SceneSystem;
  30. namespace SceneBuilder
  31. {
  32. bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const SceneSystem& sceneSystem, AZStd::vector<AZStd::shared_ptr<DataTypes::IGraphObject>>& meshes,
  33. const AZStd::function<AZStd::shared_ptr<AZ::SceneData::GraphData::MeshData>()>& makeMeshFunc);
  34. typedef AZ::Outcome<const AZ::SceneData::GraphData::MeshData*, Events::ProcessingResult> GetMeshDataFromParentResult;
  35. GetMeshDataFromParentResult GetMeshDataFromParent(AssImpSceneNodeAppendedContext& context);
  36. // If a node in the original scene file has a mesh with multiple materials on it, the associated AssImp
  37. // node will have multiple meshes on it, broken apart per material. This returns the total number
  38. // of vertices on all meshes on the given node.
  39. uint64_t GetVertexCountForAllMeshesOnNode(const aiNode& node, const aiScene& scene);
  40. }
  41. }
  42. }