/** * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include "FBX2glTF.h" class FbxMaterialInfo { public: FbxMaterialInfo(const FbxUInt64 id, const FbxString& name, const FbxString& shadingModel) : id(id), name(name), shadingModel(shadingModel) {} const FbxUInt64 id; const FbxString name; const FbxString shadingModel; }; template class FbxMaterialResolver { public: FbxMaterialResolver( FbxSurfaceMaterial* fbxMaterial, const std::map& textureLocations) : fbxMaterial(fbxMaterial), textureLocations(textureLocations) {} virtual std::unique_ptr resolve() const = 0; protected: const FbxSurfaceMaterial* fbxMaterial; const std::map textureLocations; }; class FbxMaterialsAccess { public: FbxMaterialsAccess( const FbxMesh* pMesh, const std::map& textureLocations); const std::shared_ptr GetMaterial(const int polygonIndex) const; const std::vector GetUserProperties(const int polygonIndex) const; std::unique_ptr GetMaterialInfo( FbxSurfaceMaterial* material, const std::map& textureLocations); private: FbxGeometryElement::EMappingMode mappingMode; std::vector> summaries{}; std::vector> userProperties; const FbxMesh* mesh; const FbxLayerElementArrayTemplate* indices; };