Commit Graph

274 Commits (61c2f77287788b4c0f547185a2eaa2fd0773f7de)

Author SHA1 Message Date
Guthrie Adams c9c172794e Atom Tools: Document system exposes reflected object data
• This removes a direct dependency on dynamic property groups and data from the document system.
• Added support for names, descriptions, and nesting to dynamic property groups.
• Moved property related functions from base document classes into material editor document classes because dynamic property groups are an implementation detail of the material editor document to support material type flexible data format.
• Change material document to use a table of dynamic property groups instead of a map of properties.
• Added functions to traverse groups and properties.
• This keeps groups and properties organized consistently with the material type file as well as what’s expected in the UI.
• Document data can now be maps directly to the inspector reflective property editors instead of copying one property at a time out of the document and keeping those synchronized.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams ca0006f570 Minor changes and comments after PR feedback
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 66be8543cd fixing merge issues
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 9ded52b141 Wrapping redundant save logic into function in the material editor document class
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams e273f3ef6a Updating comments
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams dc598a8b3c Atom Tools: move boilerplate document management code to atom tools framework
• Moved all of the common save and load code to the document base class
• Moved undo and redo support to document base class but will probably extract to its own class or replace with one from AzTF
• Streamlined material editor, shader management console, and other tools with updated document code
• Cleaned up some of shader management console loading code, added support for saving, as well as getting and setting the shader variant list source data structure

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac c2e220ce49 Renamed property 'set' to property 'group' for consistency with the prior naming.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 906db920d0 Merge remote-tracking branch 'upstream/development' into Atom/santorac/RemixableMaterialTypes3
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac a4346de658 Code cleanup. New comments. Added some non-const find functions to MaterialTypeSourceData. Fixed places where I forgot to change m_name to GetName().
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Guthrie Adams 413ce5a6ab Atom Tools: move performance metrics status bar widgets to base window
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
lumberyard-employee-dm b9824ed172
Updated all array_view uses with the C++20 span. (#7157)
* Updated all array_view uses with the C++20 span.

The updates were done in the following order
1. `AZStd::array_view<([^>].+)\* ?>`  -> `AZStd::span<\1 const>`
2. `AZStd::array_view<(?:const )(.+)>` -> `AZStd::span<const \1>`
3. `AZStd::array_view` -> `AZStd::span`

Removed the implementation of array_view.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Added missing whitespace between `const` and the typename for spans.

Updated the ShaderTest comparison of the ShaderResourceGroupLayout span
to compare the sizes as well

Updated comments on some of the methods that stated that they return "an
array" to mention they return "a span".

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
santorac aeb43c4012 Fixed up a few small things to get Material Editor working again.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 76add4d0d9 Merge remote-tracking branch 'upstream/development' into Atom/santorac/RemixableMaterialTypes3
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac b5c7869f14 Merge branch 'development' into Atom/santorac/RemixableMaterialTypes3
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>
4 years ago
Guthrie Adams 191db77e4d Atom Tools: Moved performance monitor system component from ME to ATF
Moved the performance monitor system component and metrics gathering from the material editor into atom tools framework so it can be reused and extended by other applications.
Replaced the custom performance monitor docked window in the material editor with status bar widgets that are always visible and take up no screen real estate. This could possibly be moved to the base application class or rendered on top of the viewport.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac f89977abe3
Merge pull request #7054 from aws-lumberyard-dev/Atom/santorac/RemixableMaterialTypes2_FIX2
Made MaterialPropertyId Be More Generic
4 years ago
Guthrie Adams 160508d2d6
Merge pull request #7104 from aws-lumberyard-dev/Atom/guthadam/atom_tools_change_preset_browser_to_generic_asset_grid_dialog
Atom Tools: Changed ME preset browser dialog into generic asset grid dialog in ATF
4 years ago
Guthrie Adams b5ac9cb66b
Merge pull request #7107 from aws-lumberyard-dev/Atom/guthadam/atom_tools_combined_me_viewport_renderer_and_widget
Atom Tools: Combined ME viewport widget and renderer classes
4 years ago
santorac fec2b889a3 Merge remote-tracking branch 'upstream/development' into Atom/santorac/RemixableMaterialTypes2_FIX2
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Guthrie Adams aabde7916f Atom Tools: Combined ME viewport widget and renderer classes
Was looking into options for making any part of this more generic or reusable but 60% of the code is just setup and teardown of processors, handles, entities, and components for the material editor viewport content. The rest is about handling material editors specific setting changes. Most of the general-purpose code has already been moved into atom tools framework render viewport widget. The best reduction or generalization from this point would be using prefabs or some other mechanism to data drive setting up camera, viewport model, IBL, lighting, sky box.

Also discussing options for replacing the material editor viewport camera controller and states with a generic one used in the main editor and animation editor.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams d6cf8e24f3 Atom Tools: Replaced custom help dialog with generic message box
The help dialog just displayed some HTML text. The message box class provided by Qt can display the same information and styling without additional code. We don’t want to carry around the extra class to new applications based off of this one or port to ATF.
A simple about box was also added and can be fleshed out in the future.
Both dialogs will eventually need to be updated with additional information.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams f20bf38f88 Atom Tools: Changed ME preset browser dialog into generic asset grid dialog in ATF
Moving more potentially shared code out of the material editor into atom tools framework.
This change consolidates the lighting preset browser, model preset browser, and the base dialogue that they shared into a single, grid based, asset selection dialog.
AssetGridDialog should appear as a move and rename of PresetBrowserDialog but there are probably too many differences with new variable renames and SelectableAsset struct.
Along the way I found examples showing that event bus broadcast accepted generic functions and lambdas. Used this to do a minor cleanup of the viewport settings inspector where the preset dialogs were initialized and other places that did several back to back bus calls.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 3e5c1cee1e Fixed a place where GetFullName was still being used.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 02acf2f65e Updated MaterialPropertyId class in preparation for nested material property sets.
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>
4 years ago
Guthrie Adams dac77605d9 Atom Tools: removing unused traits for ME executable extension
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams c98d14ad92 Atom Tools: Removing unnecessary modules, components, and dead code from ME
• Working toward creating a standalone application template
Removing application level modules and system components that make it difficult to navigate the project and add a lot of boilerplate code
• Temporarily keeping viewport module and components because shutting down the application deactivates module entities before system entities without respecting component service dependency order. This caused several RPI assets and names to leak because they were not being destroyed in the correct order.
• Fixing include paths not referenced source folders
• Mostly cleanup and reorganization, no behavioral changes

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 843ca5a0ad
Merge pull request #6960 from aws-lumberyard-dev/Atom/guthadam/atom_tools_shared_asset_browser
Atom Tools: moving custom asset browser code to common location
4 years ago
Guthrie Adams c0cbc41ba6
Merge pull request #6917 from aws-lumberyard-dev/Atom/guthadam/atom_tools_document_application_added
Atom Tools: Created base class for document-based applications
4 years ago
Guthrie Adams eb51cd4c06 Atom Tools: moving custom asset browser code to common location
Consolidated duplicate asset browser code from multiple tools into single class in atom tools framework
Moved creation of asset browser and Python terminal windows into base main window class
Fixed docked window orientations
Added checks to asset browser to prevent crashes if tree state saver was null

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 4ade6bc88a Fixed compile errors in Material Editor.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac c5b128bec4 First pass at reworking and formalizing the way deferred material asset baking works. The feature basically works but needs more testing.
Before, the material builder was loading the MaterialTypeAsset and doing some processing with it, but was avoiding declaring job dependencies that would cause reprocessing lots of assets when a shader or .materialtype file changes. Reading the asset data isn't safe when not declaring a job dependency (or when declaring a weak job dependency like OrderOnce which is the case here). This caused to several known bugs.

The main change here is it no longer loads the MaterialTypeAsset at all; all other changes flow from there.

The biggest changes (when deferred material processing is enabled) are ...
1) MaterialSourceData no longer loads MaterialTypeAsset. All it really needs is to determine whether a string is an image file reference or an enum value, which is easy to do by just looking for the "." for the extension.
2) MaterialAssetCreator no longer produces a finalized material asset. It no longer uses MaterialAssetCreatorCommon because that only produces a non-finalized MaterialAsset, which has very different needs for the SetPropertyValue function. (We could consider merging MaterialAssetCreatorCommon into MaterialTypeAssetCreator since that's the only subclass at this point). And it doesn't do any validation against the properties layout since that can be done at runtime.
3) Moved processing of enum property values from MaterialSourceData to MaterialAsset::Finalize (this was the only thing being done in the builder that actually needed to read the material type asset data).

Also...
- Updated the MaterialAsset class mostly to clarify and formalize the two different modes it can be in: whether it is finalized or not.
- Merged the separate "IncludeMaterialPropertyNames" registry settings from MaterialConverterSystemComponent and MaterialBuilder into one "FinalizeMaterialAssets" setting used for both.
- Removed MaterialSourceData::ApplyVersionUpdates. Now the flow of data is the same regardless of whether the materials are finalized by the AP or at runtime. Version updates are always applied on the MaterialAsset.
- Added a validation check to MaterialTypeAssetCreator ensuring that once a property is renamed, the old name can never be used again for a new property. This assumption was already made previously, but not formalized, in that Material::FindPropertyIndex does not expect every caller to provide a version number for the material property name, also the material asset's list of raw property names was never versioned. The only way for this to be a safe assumption is to prevent reuse of old names.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Guthrie Adams a6feef3563 Atom Tools: Created base class for document-based applications
Moving some duplicated code to a common base class

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
lumberyard-employee-dm 18ea4ba6a8
Added a CriticalAssetsCompiled Lifecycle event (#6469)
The CriticalAssetsCompiled event can be handled to detect when the
AssetProcessor has finished processing Critical Assets

Also with the new event, an audit has been performed over all the
locations where the AssetCatalogEventBus OnCatalogLoaded event was being
handle to make sure it was the proper event to use.
If the handler was actually examing the enumerating over the full
catalog or querying all assets within the catalog, then it was a proper
use.
For handlers that were interested in a particular asset it was not

Moreover added implementations of `OnCatalogAssetChanged` and
`OnCatalogAssetAdded` to the FileTagComponent and the MaterialViewportComponent.

Any applications which uses the AtomToolsApplication
class(MaterialEditor, AtomSampleViewerStandalone,
ShaderMangementConsole) now signals a "CriticalAssetsCompiled" lifecycle
event as well as loads the "assetcatalog.xml" if it exists.

The Launcher application signals the "CrticalAssetsCompiled" event and
reloads the "assetcatalog.xml" for the ${project}.GameLauncher and
${project}.ServerLauncher in Launcher.cpp

Finally the Editor signals the "CriticalAssetsCompiled" and reloads the
"assetcatalog.xml" in CryEdit.cpp

resolves #6093

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
Guthrie Adams f8ca427954
Fixed several material editor bugs related to file paths and hot reload prompts (#6374)
* draft

Signed-off-by: Guthrie Adams <guthadam@amazon.com>

* Removes automatic generation of relative paths for external references for materials
Updated material editor functions for creating new materials, creating or saving model or lighting presets, to save to the project asset folder instead of the material folder which is not included in the new templates
Changed function for getting saved file names to handle case where Qt save file dialog adds double extensions if the extension contains a dot

Signed-off-by: Guthrie Adams <guthadam@amazon.com>

* Fixed problems with material editor hot reloading after documents or dependencies changed.
Triggering message boxes within the tick function, which is executed from the main application timer, caused the tick function to be called a second time recursively.
Switched from using the tick bus to a timer so that the documents re opening and dialogs are triggered outside of the main tick.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 1cef580cad Material editor asynchronously loads lighting and model presets
changed several sequential blocking loads into asynchronous loads to improve material editor startup time

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 74cc3ccc20 Removing warnings from material editor viewport
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 2774ac1811 Merge branch 'stabilization/2110' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
Guthrie Adams cb552256f8 Moved asynchronous image loading function to atom tools framework
Moved settings registry wrapper function to atom tools framework
Created registry settings with default values for preview configurations based on asset type
Changed lighting preset previews and thumbnails to use reflective material
Created registry settings for preset selection dialog borders, padding, sizes
Updated shared preview utility functions to compare against registered asset types instead of passing them in individually

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 88569948e3 Changed preset selection dialog widget headings to not overlap preview images
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 5311878e87 Replacing preset preview images with thumbnail widget to improve load times
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 9f7815fa04 Fixed up a couple incorrectly or incompletely resolved merge conflicts.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac db3d41ad9d Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
santorac 224e0bd20f Removed the 'data-warnings' concept for checking before saving a material document. It's no longer necessary since we no longer replace the original data with placeholders.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 7d849cc0d2 Changed the overall strategy for how to handle missing image references. Instead of replacing it with one of the placeholder assets, we replace it with an random UUID which will be interpreted as a missing asset (unless some discovers discovers a UUID collision). This eventually gets replaced by one of the placeholder textures at runtime. This approach gives more consistent results in how missing texture are handled between Material Editor and Material Component.
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>
4 years ago
Guthrie Adams 198f225bbe Updating parent path usage has part of cherry picked from stabilization combining source data changes with relative path changes
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 7d51912a6e updated comments
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams b3f3a4245b updated image paths to use new function
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams ed4f7965da Created function to get relative paths to referenced files that will fall back to asset folder relative paths under certain conditions
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams f18f838da6 material editor and exporter save source materials with relative paths
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac f27203a5fa Updated Material Editor to use the available default fallback images to visually indicate a missing texture.
Material Editor also warns the user when saving a material that is populated with fallback image references.
Factored out the path strings for the default images to ImateSystemInterface.h.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago