/* * 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. * */ #pragma once #include #include #include namespace AZ { namespace SceneAPI { namespace DataTypes { class ISceneNodeGroup; } namespace Containers { class Scene; class SceneGraph; } } } namespace NvCloth { namespace Pipeline { class ClothRule; //! This class defines the behavior of how to treat the cloth rule data //! through the SceneAPI. //! It specifies the valid Scene Groups that are allowed to have //! cloth rules (aka cloth modifiers), these are Mesh and Actor groups. //! It also validates the cloth rules data for the manifest (asset containing //! all the Scene information from the FBX Editor Settings). class ClothRuleBehavior : public AZ::SceneAPI::SceneCore::BehaviorComponent , public AZ::SceneAPI::Events::ManifestMetaInfoBus::Handler , public AZ::SceneAPI::Events::AssetImportRequestBus::Handler { public: AZ_COMPONENT(ClothRuleBehavior, "{00FA6C8A-27D2-4C0E-B601-6917950432E5}", AZ::SceneAPI::SceneCore::BehaviorComponent); static void Reflect(AZ::ReflectContext* context); // BehaviorComponent overrides ... void Activate() override; void Deactivate() override; // ManifestMetaInfoBus::Handler overrides ... void GetAvailableModifiers( AZ::SceneAPI::Events::ManifestMetaInfo::ModifiersList& modifiers, const AZ::SceneAPI::Containers::Scene& scene, const AZ::SceneAPI::DataTypes::IManifestObject& target) override; void InitializeObject(const AZ::SceneAPI::Containers::Scene& scene, AZ::SceneAPI::DataTypes::IManifestObject& target) override; // AssetImportRequestBus::Handler overrides .... AZ::SceneAPI::Events::ProcessingResult UpdateManifest(AZ::SceneAPI::Containers::Scene& scene, ManifestAction action, RequestingApplication requester) override; protected: bool IsValidGroupType(const AZ::SceneAPI::DataTypes::ISceneNodeGroup& group) const; bool UpdateClothRules(AZ::SceneAPI::Containers::Scene& scene); bool UpdateClothRule(const AZ::SceneAPI::Containers::SceneGraph& graph, const AZ::SceneAPI::DataTypes::ISceneNodeGroup& group, ClothRule& clothRule); bool ContainsVertexColorStream(const AZ::SceneAPI::Containers::SceneGraph& graph, const AZStd::string& streamName) const; }; } // namespace Pipeline } // namespace NvCloth