/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include #include #include #include #include #include namespace AZ { namespace SceneAPI { namespace FbxSceneImporter { const char* FbxImportRequestHandler::s_extension = ".fbx"; void FbxImportRequestHandler::Activate() { BusConnect(); } void FbxImportRequestHandler::Deactivate() { BusDisconnect(); } void FbxImportRequestHandler::Reflect(ReflectContext* context) { SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { serializeContext->Class()->Version(1); } } void FbxImportRequestHandler::GetSupportedFileExtensions(AZStd::unordered_set& extensions) { extensions.insert(s_extension); } Events::LoadingResult FbxImportRequestHandler::LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, RequestingApplication requester) { if (!AzFramework::StringFunc::Path::IsExtension(path.c_str(), s_extension)) { return Events::LoadingResult::Ignored; } scene.SetSource(path, guid); // Push contexts Events::ProcessingResultCombiner contextResult; contextResult += Events::Process(path); contextResult += Events::Process(path, scene); contextResult += Events::Process(scene); if (contextResult.GetResult() == Events::ProcessingResult::Success) { return Events::LoadingResult::AssetLoaded; } else { return Events::LoadingResult::AssetFailure; } } } // namespace Import } // namespace SceneAPI } // namespace AZ