/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include #include // for the context #include #include #include #include #include namespace AZ::SceneGenerationComponents { //! This is the component responsible for actually hooking into the scene API's processing flow //! during the generation step. class UVsPreExportComponent : public AZ::SceneAPI::SceneCore::GenerationComponent { public: AZ_COMPONENT(UVsPreExportComponent, s_UVsPreExportComponentTypeId, AZ::SceneAPI::SceneCore::GenerationComponent); UVsPreExportComponent(); static void Reflect(AZ::ReflectContext* context); AZ::SceneAPI::Events::ProcessingResult Register(AZ::SceneAPI::Events::GenerateAdditionEventContext& context); }; AZ::ComponentDescriptor* CreateUVsPreExportComponentDescriptor() { return UVsPreExportComponent::CreateDescriptor(); } namespace SceneEvents = AZ::SceneAPI::Events; UVsPreExportComponent::UVsPreExportComponent() { BindToCall(&UVsPreExportComponent::Register); } void UVsPreExportComponent::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { serializeContext->Class()->Version(1); } } AZ::SceneAPI::Events::ProcessingResult UVsPreExportComponent::Register(AZ::SceneAPI::Events::GenerateAdditionEventContext& context) { SceneEvents::ProcessingResultCombiner result; UVsGenerateContext uvsGenerateContext(context.GetScene()); result += SceneEvents::Process(uvsGenerateContext); return result.GetResult(); } } // namespace AZ::SceneGenerationComponents