You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/Feature/Common/Code/Source
Chris Santora 14d2e38b90 Refactored how model material slots work in preparation to support more flexible material conversion options for the scene asset pipeline. The material slot IDs are based on the MaterialUid that come from SceneAPI. Since these IDs are also used as the AssetId sub-ID for the converted material assets, the system was just checking the material asset sub-ID to determine the material slot ID. But in order to support certain FBX material conversion options, we needed to break this tie, so the slot ID is separate from the AssetId of the material in that slot. This will allow some other material to be used in the slot, instead of being forced to use one that was generated from the FBX.
Here we inttroduce a new struct ModelMaterialSlot which formalizes the concept of material slot, with an ID, display name, and default material assignment. The ID still comes from the MaterialUid like before. The display name is built-in, rather than being parsed out from the asset file name. And the default material assignment can be any material asset, it doesn't have to come from the FBX (or other scene file).

This commit is just the preliminary set of changes. Cursory testing shows that it works pretty well but more testing is needed (and likely some fixes) before merging.

Here is what's left to do...
Add serialization version converters to preserve prior prefab data.
See if we can get rid of GetLabelByAssetId function only rely on the display name inside ModelMaterialSlot.
I'm not sure if the condition for enabling the "Edit Material Instance..." context menu item is correct.
Test actors
Lots more testing in general

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
..
ACES Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
AuxGeom Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Builders Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Checkerboard Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CoreLights Expose shadow bias to component & feature processors. (#2406) 4 years ago
Decals Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
DiffuseGlobalIllumination Moved render checks to a ShouldRender() helper function. 4 years ago
DisplayMapper Add missing display mapper operation type bindings 4 years ago
ImGui Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ImageBasedLights Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
LookupTable Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
LuxCore Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Material Refactored how model material slots work in preparation to support more flexible material conversion options for the scene asset pipeline. The material slot IDs are based on the MaterialUid that come from SceneAPI. Since these IDs are also used as the AssetId sub-ID for the converted material assets, the system was just checking the material asset sub-ID to determine the material slot ID. But in order to support certain FBX material conversion options, we needed to break this tie, so the slot ID is separate from the AssetId of the material in that slot. This will allow some other material to be used in the slot, instead of being forced to use one that was generated from the FBX. 4 years ago
Math Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Mesh Refactored how model material slots work in preparation to support more flexible material conversion options for the scene asset pipeline. The material slot IDs are based on the MaterialUid that come from SceneAPI. Since these IDs are also used as the AssetId sub-ID for the converted material assets, the system was just checking the material asset sub-ID to determine the material slot ID. But in order to support certain FBX material conversion options, we needed to break this tie, so the slot ID is separate from the AssetId of the material in that slot. This will allow some other material to be used in the slot, instead of being forced to use one that was generated from the FBX. 4 years ago
MorphTargets Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
OcclusionCullingPlane Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Platform Merge branch 'development' into cmake/SPEC-7179 4 years ago
PostProcess Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
PostProcessing Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
RayTracing Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ReflectionProbe Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ReflectionScreenSpace Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ScreenSpace Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Shadows Expose shadow bias to component & feature processors. (#2406) 4 years ago
SkinnedMesh Refactored how model material slots work in preparation to support more flexible material conversion options for the scene asset pipeline. The material slot IDs are based on the MaterialUid that come from SceneAPI. Since these IDs are also used as the AssetId sub-ID for the converted material assets, the system was just checking the material asset sub-ID to determine the material slot ID. But in order to support certain FBX material conversion options, we needed to break this tie, so the slot ID is separate from the AssetId of the material in that slot. This will allow some other material to be used in the slot, instead of being forced to use one that was generated from the FBX. 4 years ago
SkyBox Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
TransformService Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Utils Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CommonModule.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CommonSystemComponent.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CommonSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
EditorCommonSystemComponent.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
EditorCommonSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
FrameCaptureSystemComponent.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
FrameCaptureSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ProfilingCaptureSystemComponent.cpp Move benchmark data aggregation from ASV into ly_test_tools module. (#2335) 4 years ago
ProfilingCaptureSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
RenderCommon.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago