Commit Graph

98 Commits (0217f45f3fbff8a21659b05c31f7e1ebfcdaa188)

Author SHA1 Message Date
Guthrie Adams afdf35a925 updated material editor skybox and changed property icons
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 8487373b0c Updated thumbnail notification bus to use const QPixmap&
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Terry Michaels 00b938b6a7
Merge pull request #4212 from ppinfel/component-doc-links
Fixes various component's help URL links to correct o3de.org page
4 years ago
lumberyard-employee-dm f648cb1fd8
Update the FileIO Aliases (#4186)
* Update the FileIOAlias naming to make the cache, project root and engine
root paths more clear

The alias of `@root@`, `@assets@`, and `@projectplatformcache@` has been
collapsed to `@projectproductassets@`

The alias of `@devroot@` and `@engroot@` has been collapsed to
`@engroot@`

The alias of `@devassets@` and `@projectroot@` has been collapsed to
`@projectroot@`

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

* Updated use of devassets and devroot properties in python

Those properties now use projectroot and engroot

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

* Updating the alias @engroot@ alias path comment in each platform specific LocalFileIO_*.cpp file

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

* Removed hardcoded size of 9 for the product asset alias.

The ResolvePath function now just appends the @projectproductassets@
alias with the input path

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

* Remove duplicate @projectproductassets@ check in ProcessFileTreeRequest

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

* Fix for typos in Hydra python test

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

* Updated LocalFileIO::Copy call on Windows to use the Unicode aware CopyFileW API

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

* Updated the AWSMetreicsGemAllocatorFixture to properly suppress asset
cache write errors for Test file creation.

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

* Removed unneeded call to set the @projectproductasstes@ alias at the bottom of the AssetSeedManagerTest SetUp

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

* Added a deprecated alias map to the FileIO System

When a deprecated alias is accessed, the FileIO System logs an AZ_Error and indicates the alias that should be used

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

* Updated python test scripts to use the projectroot binding

Retrieving the AutomatedTesting project path based on "<devroot>/AutomatedTesting" has been removed.

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

* Updated references to devroot and devgame within the codebase

The GetAbsoluteDevGameFolderPath functions has been replaced with direct call to AZ::Utils::GetProjectPath
The GetAbsoluteDevRootFolderPath functions has been replaced with direct calls to AZ::Utils::GetEnginePath

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

* Updated <engroot>/AutomatedTesting references to projectroot


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

* Replaced references that assumes the project path is <engroot>/AutomatedTesting with <projectroot> in the AutomatedTesting python test

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

* Correct casing in emfxworkspace file


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

* Removed newly added AppendPathParts function
Removed the Path constructors which accepts a PathIterable instance

The PathIterable isn't safe to return to a user of the Path class as it might be referencing temporary paths supplied via PathView arguments

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

* Fixed unused parameter warning

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

* Undid change to the LexicallyProximate function to set the path result to the base path.

It needs to return the *this path if the pathResult is empty

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

* Moved the LocalFileIO ConvertToAbsolutePath implementations to AZ::Utils

Fixed the ConvertToAbsolutePath implementation for Unix platforms to use a buffer that is size PATH_MAX(4096 on all our supported Unix platforms).
Because the buffer before was AZ::IO::MaxPathLength which as a size of 1024, this was resulting in the Unix `realpath` function smashing the stack when it converts a path to an absolute path that is longer than 1024 characters

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

* Updated the EditorCore.Tests to attach the AZ Environment to the EditorCore shared library that is statically loaded on launch.

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

* Fixed for DeprecatedAlaisesKeyVisitor Visit function causing the non string_view overloads being hidden causing a hidden base class function warning

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

* Changed the AWSMetricsGemMock to use a temporary for writing test assets

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

* Updated the LocalFileIO::ResolvePath function to use HasRootPath to determine if a path starts with a root path such as "D:", "D:/" or "/"

IsAbsolute was not the corect check as the path of "D:" is a relative
path.
To be absolute according to the Windows the path must have a root
directory. i.e "D:/" or "D:\"

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

* Removed absolute path comment from LocalFile_UnixLike.cpp and LocalFile_Android.cpp FindFiles implementations
Updated the ConvertToAlias to supply an AZ::IO::FixedMaxPath

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

* Replaced usage of the @projectproductassets@ alias with @engroot@ when referring to the LmbrCentral source folder in the CopyDependencyBuilderTest and the SeedBuilderTests

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

* Updated the ScriptCanvas Upgrade Tool to output backed up files to the
Project User Path instead of the engine root

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

* Fixed whitespacing issues in Application.cpp

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

* Remove unnecessary creation of a FixedMaxPath in the UpgradeTool.cpp

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

* Modified testSeedFolder variable in the SeedBuilderTests to use the
@engroot@ alias instead of @projectproductassets@/.. alias when
referring to the LmbrCentral Gem source path

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

* Updated references to the Project Asset Cache in the PythonTests.

Those tests no longer use the logic `azlmbr.paths.projectroot / "Cache" / "pc"` to retrieve a path to the cache root but instead the `azlmbr.paths.projectproductassets` constant

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

* Fixed the FileIO Deprecated Alias test on Windows

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

* Removing @projectsourceassets@ alias, as it is only used once.

Updated the PhysX EditorSystemComponent.cpp to query the ProjectPath
form the SettingsRegistry.

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

* Replaced @projectproductassets@ alias with @products@

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

* Rollback changes to the PhysX EditorSystemComponent.cpp

The changes to use the ProjectPath from the SettingsRegistry has been implemented in PR #4497

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
Guthrie Adams 050de68f7d Merge branch 'development' into Atom/guthadam/material_editor_replace_modified_color_with_indicator
Signed-off-by: Guthrie Adams <guthadam@amazon.com>

# Conflicts:
#	Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp
#	Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h
#	Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp
#	Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.h
4 years ago
Steve Pham 799ab8585b
Update MaterialEditor launcher to use platform traits for executable extensions (#4429)
Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
santorac c0d8020786 Merge branch 'development' into Atom/santorac/RemixableMaterialTypes 4 years ago
santorac 62e268bec7 Merge branch 'development' into Atom/santorac/RemixableMaterialTypes 4 years ago
Guthrie Adams 4c9f456ea5 Merge branch 'development' into Atom/guthadam/material_component_supports_property_overrides_without_material_overrides
Signed-off-by: Guthrie Adams <guthadam@amazon.com>

# Conflicts:
#	Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp
4 years ago
Artur K f44169f7fa
Cleanup SerializeContext.h pt.1 (#4264)
* Remove AssetSerializer inclusion from SerializeContext header

Moved a few Reflect methods to new cpp files.

In addition, some preparations for further header dependency reductions.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix smoke test lua failures.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Windows build fixes.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Missing license headers

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix white-space issues.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Code review fix for AzToolsFramework/AssetEditor/AssetEditorBus.h

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

* Fix inheritance list wrapping broken by older clang-format

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
santorac 3753ee6f1c Merge remote-tracking branch 'upstream/development' into Atom/santorac/RemixableMaterialTypes 4 years ago
Guthrie Adams f8374b76b7 Added modified property indicator icon to material property inspector in material component
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Pinfel bf58638505
Merge remote-tracking branch 'origin/development' into component-doc-links 4 years ago
Guthrie Adams b0ea4ac389 moved code for applying properties to MaterialAssignment
added lambdas for queuing and updating assets

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams ebcf3723f9 Material Component: Can set material property overrides on default materials
No longer need to assign material overrides to set/edit properties in UI or script
Material component will load and use the default material for a slot if no override is assigned

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 376a6040d8 Addressing PR feedback
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 0c9dbb8658 Adding new commands to the material component for managing, removing, repairing material slots
• Adding commands to material component to clear or repair material slots
• Moved all clear and repair functions from the editor component to the material component controller, bound to its buses so they can be accessed from script
• Added new functions to clear model and LOD material groups
• Added function to remove material assignments with bad asset references
• Added function to reassign materials with bad asset references to the default asset
• Added function to remove material assignments that don’t match slots available on the active model. This case arises when switching between different models, changing the materials on a given model, or copying and pasting the material component to a different entity with a different model. The user might end up with hidden material slots that load assets but have no effect.
• Converted remaining code that iterated over editor material slots to instead use the material component request bus
• Removed functions from the editor material component that enumerated editor material slots

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Pinfel 00b5b7ba2d
Fixed in-editor "Atom" category components reference links to o3de.org docs
Signed-off-by: Pinfel <ppinfel@gmail.com>
4 years ago
santorac c2abd2d74f Updated the naming convention for material property "names" vs "IDs".
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>
4 years ago
Guthrie Adams 9f65277906 restoring changes lost in merge
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 825e523483 Merge branch 'development' into Atom/guthadam/multiple_dockable_pinned_material_component_property_editor
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams d07b115569 Rebuilding UI and instance data hierarchy on any external property change
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams f7d4b8e70f Changing material component property inspector to dockable view pane
• Inspector is locked to a specific entity and material assignment ID
• All modifications are made via the material component request bus
• Removed complicated configuration management in editor material component
• Multiple material property inspectors can be opened
• Multiple materials across different entities can be edited simultaneously
• No longer blocks the viewport or other interactions
• Added functions to material component request bus for retrieving material slot labels, default materials, getting and setting property and UV overrides
• Added more asset related types to material property value conversion from any
• Added support for static heading widget on top of atom tools inspector, currently used for menus and messages

WIP: Still investigating intermittent crash because of corrupt asset property
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 51f101748d These changes make material system report warnings when gameplay scripts attempt to change PSO-impacting material properties at runtime. So far the material system has always allowed any properties to be changed at runtime, including those that affect Pipeline State Objects (PSOs), as this is supported on several platforms. But some platforms require that Pipeline State Objects be pre-compiled and shipped with the game. At some point we will need to add new restrictions that limit what material properties can be changed at runtime. In the meantime, these warnings should alert users to avoid this, as the functionality likely won't be supported in the future.
- Made the Material and LuaMaterialFunctor classes configurable to report errors or warnings when material properties modify Pipeline State Objects. This is controlled by a new "MaterialPropertyPsoHandling" enum.
- Made the EditorMaterialComponent override PSO handling as Enabled, to prevent warnings when the user is editing material instance property overrides. This requried a new MaterialComponentNotificationBus bus message "OnMaterialInstanceCreated".
- Removed unnecessary GetMaterialPropertyDependencies member from material functor context classes, as this is already available as part of the functor itself.
- Made Material::SetPropertyValue return early when the property value hadn't actually changed. Besides being more efficientn, this prevents unnecessary spamming of the new warning.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Galvan d590a91fe7 Implemented helper method of QFileDialog::getSaveFileName to prevent user from saving files with invalid names.
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Esteban Papp 9c7b55a31d Merge branch 'development' into cmake/linux_fix_warn_unused
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Bits.h
#	Gems/Atom/RHI/Code/Include/Atom/RHI/IndexBufferView.h
#	Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp
#	Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp
4 years ago
santorac 60d137c5b6
Merge pull request #2746 from aws-lumberyard-dev/Atom/santorac/OptionalSceneApiMaterialConversion3
Made Model Material Conversion Optional

Added a new registry setting that disables automatic conversion of materials from model files like FBX.

By default, processing of model files (like FBX) automatically convert the included materials to Atom materials, using StandardPBR. This adds a job dependency on StandardPBR.materialtype, which propagates to any related azsl files as well. Thus any change to azsl code will cause all model files in the project to rebuild.

Some game teams have no interest in using the auto-converted materials; they always use a Material Component to apply material overrides for every mesh. This new setting allows teams to disable material auto-conversion for the entire project, thus removing the job dependency on StandardPBR.materialtype. Instead, every mesh will be assigned the same default material. Any change to azsl code will cause that one default material to rebuild, but this will not trigger any models to rebuild.

Details:
- Added /O3DE/SceneAPI/MaterialConverter registry settings for configuring the scene material converter. It includes an enable flag, and a default material to use when conversion is disabled.
- Added SceneBuilderDependencyRequests::AddFingerprintInfo which allows SceneAPI components to modify the scene builder analysis fingerprint. We use this to reprocess scene files when the material converter settings change.
- Updated SceneAPI's material asset builder to skip the StandardPBR dependency when material conversion is disabled.
- Added some code to MaterialComponentController to handle an edge case that may when disabling material conversion on an existing project, and assigned materials disappear.

Testing:
- Changing the registry setting does trigger a rebuild of the fbx files.
- When material conversion is disabled, changing an azsl file does not cause fbx files to rebuild, but the shader still reloads as expected.
- Made a test level using multiple models with multiple meshes, made various adjustments to the material slots for each mesh, and tried switching the material conversion registry setting from true to false. (Details below)
- Merged this change to a customer's fork and tested on their existing content.

Details about my test level:
- Made a new test level AtomTest project
- Added two entities, both using multi-mat_mesh-groups_1m_cubes.fbx
- Added a material component to both entities
  - Entity 1 material assignments
    - Blue_Zaxis: left as-is
    - Green_Yaxis: exported the material
    - Red_Xaxis: exported the material, and changed the material instance color to pink
    - StingrayPBS1: exported the material, scaled the UVs in the exported material source, and changed the material instance color to green.
    - With_Texture: selected an existing brick material, changed the material instance color to red.
  - Entity 2 material assignments
    - Default Material: set to an existing brick material
    - Blue_Zaxis: manually assigned built-in material that was converted from fbx
    - Green_Yaxis: manually assigned built-in material that was converted from fbx, and changed the material instance color to orange
4 years ago
santorac b6dfb86007 Removed unnecessary #include
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac de932c62b3 Reverted changes in MaterialComponentController for an obsucre edge case. We'll handle the case of missing material assets more generally as a separate task.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Esteban Papp c19c4af1e1 Gems/Atom
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Guthrie Adams aa642bd566
Merge pull request #3156 from aws-lumberyard-dev/Atom/guthadam/material_component_api_script_canvas_support
AtomTools: better script canvas support for material component
4 years ago
pappeste d5ed0cc385 AtomLyIntegration
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Guthrie Adams c67a9f3d12 Updated material component request bus to better support script canvas
Change all name parameters to use standard string so that they could be headed in in script canvas nodes and RPE

Added explicitly type functions for getting and saving property overrides

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Chris Santora 36abde95a9 Added a new registry setting that disables automatic conversion of materials from model files like FBX.
By default, processing of model files (like FBX) automatically convert the included materials to Atom materials, using StandardPBR. This adds a job dependency on StandardPBR.materialtype, which propagates to any related azsl files as well. Thus any change to azsl code will cause all model files in the project to rebuild.

Some game teams have no interest in using the auto-converted materials; they always use a Material Component to apply material overrides for every mesh. This new setting allows teams to disable material auto-conversion for the entire project, thus removing the job dependency on StandardPBR.materialtype. Instead, every mesh will be assigned the same default material. Any change to azsl code will cause that one default material to rebuild, but this will not trigger any models to rebuild.

Details:
- Added /O3DE/SceneAPI/MaterialConverter registry settings for configuring the scene material converter. It includes an enable flag, and a default material to use when conversion is disabled.
- Added SceneBuilderDependencyRequests::AddFingerprintInfo which allows ScenePI components to modify the scene builder analysis fingerprint. We use this to reprocess scene files when the material converter settings change.
- Updated SceneAPI's material asset builder to skip the StandardPBR dependency when material conversion is disabled.
- Added some code to MaterialComponentController to handle an edge case that may when disabling material conversion on an existing project, and assigned materials disappear.

Testing:
- Changing the registery setting does trigger a rebuild of the fbx files.
- When material conversion is disabled, changing an azsl file does not cause fbx files to rebuild, but the shader still reloads as expected.
- Made a test level using multiple models with multiple meshes, made various adjustments to the material slots for each mesh, and tried switcihng the material conversion registry setting from true to false. (Details below)
- TODO: Will merge this change to a customer's fork and test on their existing content.

Details about my test level:
- Made a new test level AtomTest project
- Added two entities, both using multi-mat_mesh-groups_1m_cubes.fbx
- Added a material component to both entities
  - Entity 1 material assignments
    - Blue_Zaxis: left as-is
    - Green_Yaxis: exported the material
    - Red_Xaxis: exported the material, and changed the material instance color to pink
    - StingrayPBS1: exported the material, scaled the UVs in the exported material source, and changed the material instance color to green.
    - With_Texture: selected an existing brick material, changed the material instance color to red.
  - Entity 2 material assignments
    - Default Material: set to an existing brick material
    - Blue_Zaxis: manually assigned built-in material that was converted from fbx
    - Green_Yaxis: manually assigned built-in material that was converted from fbx, and changed the material instance color to orange

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac b407e501e3 Merge branch 'development' into Atom/santorac/OptionalSceneApiMaterialConversion 4 years ago
Chris Santora 13679a7cc3 Reverted partial support for property overrides on default material assignments. This needs more UI design discussion first.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 1a478608a7 Restored the previous behavior of preventing material property overrides when there is no explicit material override assignment.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora b19a895889 Reverted accidentally commented out code.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 6fa891848d Factored out redundant call to GetMaterialSlots().
Removed code that was intended to handle duplicate default material assignments, but duplicacate default material assignments aren't possible yet.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 21d5baa184 Fixed an issue where I had changed prior functionality by mistake, preventing exported materials from replacing material assignments.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora abec7a4f5b Fixed an issue where a default material should show up as a filled-in value in the UI even though it should appear as empty, indicating the default is being used.
Also, I'm going back on what I said in my last commit, and removing the converter for version 3 in EditorMaterialComponent::ConvertVersion. The code that I had put in before wouldn't work because it was relying on the new m_defaultMaterialAsset which will be empty for old data. The only way we could support version conversion is if we preserve legacy versions of multiple types like EditorMaterialComponentSlot and MaterialAssignmentId. Since this serialization version is old and pre-dates the public release of O3DE, it's unlikely that we need to continue supporting this version so isn't worth maintaining.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 75b4d62dcb Restored the version converter EditorMaterialComponent::ConvertVersion for version 3, which wasn't possible with an earlier version of my changes.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 28671c8546 Addressed suggestions from gadams3 to make EditorMaterialComponent get the default material assets from its own data rather than fetching them from the asset. Presumably this should give more reliable behavior.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora e145ce1d01 Updated EditorMaterialComponentSlot to support editing property overrides and UV overrides for the material, regardless of whether there is a material override or not.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 670dd6c5bc Removed the GetLabelByAssetId function since now we can use the display name that comes with the ModelMaterialSlot.
Updated OpenMaterialExporter() to account for the fact that multiple material slots can have the same default material asset.
Updated the material inspector to sort material slots by name to match the order in the Material Component.
Updated ExportItem to protect its data members, which makes it more clear that assetId and materialSlotName are readonly inputs.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora e3ceaa477e Added a version converter for MaterialAssignmentId. This allowed me to successfully load the Sponza level in AtomTest.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
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
Guthrie Adams ffbeb903c1 Material Component: Add functions to lookup material ids by name
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
sphrose 9639003a7d
LYN-4774 Fix missing box icons inside the main Viewport (#2297)
* LYN-4774 Fix missing box icons inside the main Viewport

Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>

* V2 icons

Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>

* Bug fixes

Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago