Quellcode durchsuchen

Add missing m_preferredOrder values for BehaviorComponents

Signed-off-by: Markus Prettner <[email protected]>
Markus Prettner vor 1 Jahr
Ursprung
Commit
51971af66c

+ 1 - 1
Code/Tools/SceneAPI/SceneData/Behaviors/AnimationGroup.h

@@ -49,7 +49,7 @@ namespace AZ
 
                 bool SceneHasAnimationGroup(const Containers::Scene& scene) const;
 
-                static const int s_animationsPreferredTabOrder;
+                static constexpr int s_animationsPreferredTabOrder{ 2 };
             };
         } // namespace Behaviors
     } // namespace SceneAPI

+ 0 - 2
Code/Tools/SceneAPI/SceneData/Behaviors/BehaviorsAnimationGroup.cpp

@@ -27,8 +27,6 @@ namespace AZ
     {
         namespace Behaviors
         {
-            const int AnimationGroup::s_animationsPreferredTabOrder = 2;
-
             void AnimationGroup::Activate()
             {       
             }

+ 0 - 2
Code/Tools/SceneAPI/SceneData/Behaviors/BehaviorsMeshGroup.cpp

@@ -30,8 +30,6 @@ namespace AZ
     {
         namespace Behaviors
         {
-            const int MeshGroup::s_meshGroupPreferredTabOrder = 0;
-
             void MeshGroup::Activate()
             {
                 Events::ManifestMetaInfoBus::Handler::BusConnect();

+ 0 - 2
Code/Tools/SceneAPI/SceneData/Behaviors/BehaviorsSkeletonGroup.cpp

@@ -28,8 +28,6 @@ namespace AZ
     {
         namespace Behaviors
         {
-            const int SkeletonGroup::s_rigsPreferredTabOrder = 1;
-
             void SkeletonGroup::Activate()
             {
             }

+ 0 - 1
Code/Tools/SceneAPI/SceneData/Behaviors/BehaviorsSkinGroup.cpp

@@ -30,7 +30,6 @@ namespace AZ
         {
             const char* SkinGroup::s_skinVirtualTypeName = "Skin";
             Crc32 SkinGroup::s_skinVirtualType = AZ_CRC(SkinGroup::s_skinVirtualTypeName, 0x0279681e);
-            const int SkinGroup::s_rigsPreferredTabOrder = 1;
 
             void SkinGroup::Activate()
             {

+ 1 - 1
Code/Tools/SceneAPI/SceneData/Behaviors/MeshGroup.h

@@ -47,7 +47,7 @@ namespace AZ
 
                 bool SceneHasMeshGroup(const Containers::Scene& scene) const;
 
-                static const int s_meshGroupPreferredTabOrder;
+                static constexpr int s_meshGroupPreferredTabOrder{ 0 };
             };
         } // Behaviors
     } // SceneAPI

+ 2 - 2
Code/Tools/SceneAPI/SceneData/Behaviors/SkeletonGroup.h

@@ -46,8 +46,8 @@ namespace AZ
                 Events::ProcessingResult UpdateSkeletonGroups(Containers::Scene& scene) const;
 
                 bool SceneHasSkeletonGroup(const Containers::Scene& scene) const;
-                
-                static const int s_rigsPreferredTabOrder;
+
+                static constexpr int s_rigsPreferredTabOrder{ 1 };
                 bool m_isDefaultConstructing{ false };
             };
         } // namespace Behaviors

+ 1 - 1
Code/Tools/SceneAPI/SceneData/Behaviors/SkinGroup.h

@@ -58,7 +58,7 @@ namespace AZ
 
                 bool SceneHasSkinGroup(const Containers::Scene& scene) const;
 
-                static const int s_rigsPreferredTabOrder;
+                static constexpr int s_rigsPreferredTabOrder{ 1 };
             };
         } // namespace Behaviors
     } // namespace SceneAPI

+ 1 - 3
Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp

@@ -43,8 +43,6 @@ namespace EMotionFX
     {
         namespace Behavior
         {
-            const int ActorGroupBehavior::s_animationsPreferredTabOrder = 3;
-
             void ActorGroupBehavior::Reflect(AZ::ReflectContext* context)
             {
                 Group::ActorGroup::Reflect(context);
@@ -81,7 +79,7 @@ namespace EMotionFX
                 const bool hasRequiredData = AZ::SceneAPI::Utilities::DoesSceneGraphContainDataLike<AZ::SceneAPI::DataTypes::IBoneData>(scene, false);
                 if (SceneHasActorGroup(scene) || hasRequiredData)
                 {
-                    categories.emplace_back("Actors", Group::ActorGroup::TYPEINFO_Uuid(), s_animationsPreferredTabOrder);
+                    categories.emplace_back("Actors", Group::ActorGroup::TYPEINFO_Uuid(), s_actorsPreferredTabOrder);
                 }
             }
 

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.h

@@ -58,7 +58,7 @@ namespace EMotionFX
 
                 bool SceneHasActorGroup(const AZ::SceneAPI::Containers::Scene& scene) const;
 
-                static const int s_animationsPreferredTabOrder;
+                static constexpr int s_actorsPreferredTabOrder{ 3 };
             };
         } // Behavior
     } // Pipeline

+ 1 - 3
Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MotionGroupBehavior.cpp

@@ -32,8 +32,6 @@ namespace EMotionFX
     {
         namespace Behavior
         {
-            const int MotionGroupBehavior::s_preferredTabOrder = 2;
-
             void MotionGroupBehavior::Reflect(AZ::ReflectContext* context)
             {
                 Group::MotionGroup::Reflect(context);
@@ -67,7 +65,7 @@ namespace EMotionFX
             {
                 if (SceneHasMotionGroup(scene) || AZ::SceneAPI::Utilities::DoesSceneGraphContainDataLike<AZ::SceneAPI::DataTypes::IAnimationData>(scene, false))
                 {
-                    categories.emplace_back("Motions", Group::MotionGroup::TYPEINFO_Uuid(), s_preferredTabOrder);
+                    categories.emplace_back("Motions", Group::MotionGroup::TYPEINFO_Uuid(), s_motionGroupPreferredTabOrder);
                 }
             }
 

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/MotionGroupBehavior.h

@@ -53,7 +53,7 @@ namespace EMotionFX
 
                 bool SceneHasMotionGroup(const AZ::SceneAPI::Containers::Scene& scene) const;
 
-                static const int s_preferredTabOrder;
+                static constexpr int s_motionGroupPreferredTabOrder{ 2 };
             };
         } // Behavior
     } // Pipeline

+ 1 - 1
Gems/PhysX/Code/Source/Pipeline/MeshBehavior.cpp

@@ -59,7 +59,7 @@ namespace PhysX
         {
             if (AZ::SceneAPI::Utilities::DoesSceneGraphContainDataLike<AZ::SceneAPI::DataTypes::IMeshData>(scene, false))
             {
-                categories.emplace_back("PhysX", MeshGroup::TYPEINFO_Uuid());
+                categories.emplace_back("PhysX", MeshGroup::TYPEINFO_Uuid(), s_meshBehaviorPreferredTabOrder);
             }
         }
 

+ 2 - 0
Gems/PhysX/Code/Source/Pipeline/MeshBehavior.h

@@ -50,6 +50,8 @@ namespace PhysX
         private:
             AZ::SceneAPI::Events::ProcessingResult BuildDefault(AZ::SceneAPI::Containers::Scene& scene) const;
             AZ::SceneAPI::Events::ProcessingResult UpdatePhysXMeshGroups(AZ::SceneAPI::Containers::Scene& scene) const;
+
+            static constexpr int s_meshBehaviorPreferredTabOrder{ 5 };
         };
     } // Pipeline
 } // PhysX

+ 1 - 1
Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.cpp

@@ -126,7 +126,7 @@ namespace AZ::SceneAPI::Behaviors
 
     void PrefabGroupBehavior::ExportEventHandler::GetCategoryAssignments(CategoryRegistrationList& categories, const Containers::Scene&)
     {
-        categories.emplace_back("Procedural Prefab", SceneData::PrefabGroup::TYPEINFO_Uuid());
+        categories.emplace_back("Procedural Prefab", SceneData::PrefabGroup::TYPEINFO_Uuid(), s_prefabGroupPreferredTabOrder);
     }
 
     Events::ProcessingResult PrefabGroupBehavior::ExportEventHandler::UpdateSceneForPrefabGroup(

+ 2 - 0
Gems/Prefab/PrefabBuilder/PrefabGroup/PrefabGroupBehavior.h

@@ -59,6 +59,8 @@ namespace AZ::SceneAPI::Behaviors
 
         struct ExportEventHandler;
         AZStd::shared_ptr<ExportEventHandler> m_exportEventHandler;
+
+        static constexpr int s_prefabGroupPreferredTabOrder{ 6 };
     };
 }
 

+ 1 - 1
Gems/SceneLoggingExample/Code/Behaviors/LoggingGroupBehavior.cpp

@@ -61,7 +61,7 @@ namespace SceneLoggingExample
     // users from adding groups that have no effect.
     void LoggingGroupBehavior::GetCategoryAssignments(CategoryRegistrationList& categories, [[maybe_unused]] const AZ::SceneAPI::Containers::Scene& scene)
     {
-        categories.emplace_back("Logging", LoggingGroup::TYPEINFO_Uuid());
+        categories.emplace_back("Logging", LoggingGroup::TYPEINFO_Uuid(), s_loggingPreferredTabOrder);
     }
 
     // When a scene is loaded for the first time (for example, from an .fbx file), there won't be a manifest (.assetinfo file).

+ 3 - 0
Gems/SceneLoggingExample/Code/Behaviors/LoggingGroupBehavior.h

@@ -40,5 +40,8 @@ namespace SceneLoggingExample
         {
             result = "LoggingGroupBehavior";
         }
+
+    private:
+        static constexpr int s_loggingPreferredTabOrder{ 10 };
     };
 } // namespace SceneLoggingExample