Changed material editor inspector into generic, configurable, document inspector and moved to atom tools framework
Renamed atom tools framework settings registry utility functions
Added more settings registry utility functions to get, set, and save values and objects
Added saving tool settings to atom tools application
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Simplified the call back for MaterialTypeSourceData::EnumeratePropertyGroups while also providing more data.
Made the Material Inspector join nested property group display names to be like "Layer 1 | Base Color", since the leaf property groups are shown as a flat list in the inspector.
Fixed CreateMaterialAssetFromSourceData to include the imported json files in the list of sourceDependencies. This triggers the Material Editor to hot-reload when one of these json files changes.
Updated a few places that were still assuming only one level of property group.
Updated EditorMaterialComponentInspector to apply the per-property-group material functors, before it was still only applying the top-level onces.
Moved some accessor function implementations to the cpp files, per feedback on another already-merged PR.
Testing:
Made changes to MinimalMultilayerPbr (in AtomSampleViewer) to use nested property groups, and saw the correct behavior in the Material Editor's property inspector.
Used MaterialComponent's property inspector to edit a StandardPbr material instance. Confrimed that functors were correctly controlling property visibility by enabling and disabling things like emissive and clear coat.
Used MaterialComponent's property inspector to edit a MinimalMultilayerPbr material instance. Saw all the expected groups and properties show up. Confirmed that per-group functors were correctly controlling property visibility.
Used MaterialComponent's property inspector to export a material instance and confirmed the .material file included the expected properties.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This is needed to support deeply nested material property groups, it just makes the serialization code a lot simpler than trying to support nested groups in the .material file. It also makes the file more readable and easier to search all files for particular properties.
I also updated MaterialSourceData to hide the property values behind a clean API.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This wrapper used to be needed in order to bind the custom JsonMaterialPropertyValueSerializer back when property values were represented by AZStd::any. Now that property values have a custom MaterialPropertyValue type, the wrapper class is no longer needed.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Fixed the MaterialBuilder to report source dependencies on imported JSON files, so the material type will rebuild when you edit an imported file that contains shared property data.
Fixed a spot in LuaMaterialFunctorSourceData where it was only applying the old "prefix" feature and not the new name context.
Updated a couple built-in material functors to take advantage of the name context (they were using RuntimeContext::GetShaderResourceGroupLayout instead of the RuntimeContext::FindShaderInputConstantIndex wrapper utility function).
Fixed an issue with EnumeratePropertyGroups where it wasn't passing the right name context, so Material Editor wasn't able to load some material types.
Reordered the parameters in the MaterialTypeSourceData enumerate callback functions, I felt this order was more natural.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
The main addition here is the MaterialNameContext class which represents the concept of a namespace for properties, shader options, and SRG fields. This concept was already somewhat supported in LuaMaterialFunctor through bespoke "prefix" fields, but I have generalized it be available for all material functors. Note that I have not yet updated the other material functor types to ensure they take advantage of this feature, that will be in another commit.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
There were lots of material system conflicts that had to be resolved. I expect the build is broken at this commit, and I'll fix it in followup commits.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string.
Testing:
New unit test.
Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test.
Atom Sample Viewer material screenshot test script.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
I actually tried this approach before and it didn't seem to work the way we needed, but I realized that's because PropertyAssetCtrl wasn't handling missing assets properly. I fixed a few issues there including showing the error button when the asset can't be found, and fixing a broken reference to the error icon file.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Here we formalize the concept of a Property Set, which replaces property "groups", containing the group name and description, properties, and functors all in one place.
The Property Set structure will allow arbitrarily deep nesting, whereas before you only had one level of grouping. This nesting is not fully supported yet throughout the system, particularly in the Material Editor. It was easier to go ahead and put in some of the nesting mechanims, parituclar in the implementation of MaterialTypeSourceData.
This change is backward compatible, which is proved with unit tests, and by the fact that only MinimalPBR.materialtype has been updated to the new format. StandardPBR, EnhancedPBR, and others are still using the old format. (In a subsequent commit I'll update these as well, to prove that the new format works correctly).
Other changes and improvements...
- A new constructor for MaterialPropertyId
- Improved API for MaterialTypeSourceData that hides a good deal more of it's data as private, with clear and convenient APIs. Especially AddProperty, AddPropertySet, FindProperty, FindPropertySet, EnumerateProperties, EnumeratePropertySets.
- Added lots of new unit tests
- Updated MinimalPBR.materialtype to the new format.
Testing:
- Updated unit tests.
- Reprocessed Atom material assets.
- Ran AtomSampleViewer material screenshot test.
- Opened, edited, saved material in the Material Editor.
- Opened a level, edited material property overrides, saved and reloaded.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Here the class has been generalized for a list of group names and a final property name, rather than assuming a single group containing the property. This included removing the unused GetPropertyName and GetGroupName functions. All that's really need from this class is conversion to a full property ID string.
Testing:
New unit test.
Reprocessed all core material types and StandardPBR test materials used in Atom Sample Viewer's material screenshot test.
Atom Sample Viewer material screenshot test script.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
A "property name" is the name of the just the property without regard to the group that it's in. A "group name" is the name of the group. And a "property ID" is the full unique name of a property in the form "groupName.propertyName". This is important preparation for upcoming changes where property sets can contain other property sets, and property IDs can be arbitrarily long like "layer1.baseColor.factor" for example.
The naming changes include variables, some code comments, and the .materialtype file format. I was able to make these changes in a backward compatible way so a property or group "id" field has been replaced with a "name" field, but "id" is still supported for compatibility. StandardPBR, EnhancedPBR, StandardMultilayerPBR, and Skin have all been updated. Note that MinimalPBR has not been updated, proving that backward compatibility works. (We can update this one too at some point though).
Testing:
Opened up materials in the material editor.
Ran AtomSampleViewer in dx12 and vulkan with no new failures.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* Final update copyright headers to reference license files at the repo root
Signed-off-by: spham <spham@amazon.com>
* Fix copyright validator unit tests to support the stale O3DE header scenario
Signed-off-by: spham <spham@amazon.com>