Added configurable physics materials per asset in PhysX group in FBX Settings. (#1186)

- Added back the' Physics Materials from Asset' tick in the collider components.
- Made physics materials names case insensitive.
- Refactored how to gather material information from fbx and used the same code for exporter and physx groups.
This commit is contained in:
Aaron Ruiz Mora
2021-06-10 12:22:16 +01:00
committed by GitHub
parent adf6d93a06
commit 9d41954d0e
20 changed files with 374 additions and 231 deletions
@@ -97,6 +97,10 @@ namespace PhysX
nodeSelectionList.AddSelectedNode(graph.GetNodeName(nodeIndex).GetPath());
}
}
// Update list of materials slots after the group's node selection list has been gathered
group->SetSceneGraph(&graph);
group->UpdateMaterialSlots();
}
AZ::SceneAPI::Events::ProcessingResult MeshBehavior::UpdateManifest(AZ::SceneAPI::Containers::Scene& scene, ManifestAction action,
@@ -129,6 +133,8 @@ namespace PhysX
// in the same way again. To guarantee the same uuid, generate a stable one instead.
group->OverrideId(AZ::SceneAPI::DataTypes::Utilities::CreateStableUuid(scene, MeshGroup::TYPEINFO_Uuid()));
group->SetSceneGraph(&scene.GetGraph());
EBUS_EVENT(AZ::SceneAPI::Events::ManifestMetaInfoBus, InitializeObject, scene, *group);
scene.GetManifest().AddEntry(AZStd::move(group));
@@ -149,10 +155,15 @@ namespace PhysX
}
AZ::SceneAPI::Utilities::SceneGraphSelector::UpdateNodeSelection(scene.GetGraph(), group.GetSceneNodeSelectionList());
// Update list of materials slots after the group's node selection list has been updated
group.SetSceneGraph(&scene.GetGraph());
group.UpdateMaterialSlots();
updated = true;
}
return updated ? AZ::SceneAPI::Events::ProcessingResult::Success : AZ::SceneAPI::Events::ProcessingResult::Ignored;
}
} // namespace SceneAPI
} // namespace AZ
} // namespace Pipeline
} // namespace PhysX