Expose OnModelReady to behavior context for hydra automation (#4331)

* Expose OnModelReady to behavior context for hydra automation

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Adding assets used by the hydra test to Atom/TestData

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Attempt to fix line ending

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Moving behavior context for mesh notification bus to the component controller

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Changed the AssetManager DispatchEvents function to continously pump the
AssetBus of queued functions until empty.

This replicates the old behavior of the EBusQueuePolicy::Execute
function that would continue to execute functions if new ones were added
during the execution of the current queue.

Split the TestFixture class from the AssetHandler and EBus handler for the DynamicSliceInstanceSpawnerTests and
PrefabInstanceSpawnerTest.
This avoids the AssetMananager destructor from deleting the test fixture
if the call to UnregisterHandler is ever removed. This also allows the
memory allocators to get online earlier.

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

* Removing an incorrect [[maybe_unused]]

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Moving incorrectly placed [[maybe_unused]]

Signed-off-by: amzn-tommy <waltont@amazon.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
Tommy Walton
2021-10-05 09:58:54 -07:00
committed by GitHub
parent 4a4c93f866
commit aef1f01de2
5 changed files with 51 additions and 1 deletions
@@ -0,0 +1,18 @@
{
"description": "",
"materialType": "Materials/Types/StandardMultilayerPBR.materialtype",
"parentMaterial": "",
"propertyLayoutVersion": 3,
"properties": {
"blend": {
"blendSource": "BlendMaskVertexColors",
"debugDrawMode": "FinalBlendWeights",
"enableLayer2": true,
"enableLayer3": true,
"textureMap": ""
},
"parallax": {
"enable": false
}
}
}
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b6d860c6fc3703914716a97910899eca2e66927688690646f697c6246ac310fb
size 317340
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91b8153f93e4773d872478fef40ff00c1b8d5f1ef13101cf62f81956e1c30107
size 68800
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2cf646a0a977c2edc5ee2ab6351ef633f194ce60c59ea3cb8359f71648db668e
size 374492
@@ -32,6 +32,23 @@ namespace AZ
{
namespace Render
{
namespace Internal
{
struct MeshComponentNotificationBusHandler final
: public MeshComponentNotificationBus::Handler
, public AZ::BehaviorEBusHandler
{
AZ_EBUS_BEHAVIOR_BINDER(
MeshComponentNotificationBusHandler, "{8B8F4977-817F-4C7C-9141-0E5FF899E1BC}", AZ::SystemAllocator, OnModelReady);
void OnModelReady(
[[maybe_unused]] const Data::Asset<RPI::ModelAsset>& modelAsset,
[[maybe_unused]] const Data::Instance<RPI::Model>& model) override
{
Call(FN_OnModelReady);
}
};
} // namespace Internal
namespace MeshComponentControllerVersionUtility
{
@@ -173,6 +190,12 @@ namespace AZ
->VirtualProperty("MinimumScreenCoverage", "GetMinimumScreenCoverage", "SetMinimumScreenCoverage")
->VirtualProperty("QualityDecayRate", "GetQualityDecayRate", "SetQualityDecayRate")
;
behaviorContext->EBus<MeshComponentNotificationBus>("MeshComponentNotificationBus")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Category, "render")
->Attribute(AZ::Script::Attributes::Module, "render")
->Handler<Internal::MeshComponentNotificationBusHandler>();
}
}
@@ -306,7 +329,7 @@ namespace AZ
return model ? model->GetUvNames() : AZStd::unordered_set<AZ::Name>();
}
void MeshComponentController::OnMaterialsUpdated([[maybe_unused]] const MaterialAssignmentMap& materials)
void MeshComponentController::OnMaterialsUpdated(const MaterialAssignmentMap& materials)
{
if (m_meshFeatureProcessor)
{