Merge branch 'upstream/stabilization/2106' into genewalt/gitflow_210628
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Mesh/EditorMeshComponent.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
@@ -52,7 +47,7 @@ namespace AZ
|
||||
->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/Component_Placeholder.png")
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c))
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://docs.aws.amazon.com/lumberyard/latest/userguide/component-mesh.html")
|
||||
->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/atom/")
|
||||
->Attribute(AZ::Edit::Attributes::PrimaryAssetType, AZ::AzTypeInfo<RPI::ModelAsset>::Uuid())
|
||||
->DataElement(AZ::Edit::UIHandlers::Button, &EditorMeshComponent::m_addMaterialComponentFlag, "Add Material Component", "Add Material Component")
|
||||
->Attribute(AZ::Edit::Attributes::NameLabelOverride, "")
|
||||
@@ -231,6 +226,7 @@ namespace AZ
|
||||
&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay,
|
||||
AzToolsFramework::Refresh_EntireTree);
|
||||
}
|
||||
|
||||
AZ::u32 EditorMeshComponent::OnConfigurationChanged()
|
||||
{
|
||||
// temp variable is needed to hold reference to m_modelAsset while it's being loaded.
|
||||
@@ -244,5 +240,18 @@ namespace AZ
|
||||
|
||||
return BaseClass::OnConfigurationChanged();
|
||||
}
|
||||
|
||||
void EditorMeshComponent::OnEntityVisibilityChanged(bool visibility)
|
||||
{
|
||||
m_controller.SetVisibility(visibility);
|
||||
}
|
||||
|
||||
bool EditorMeshComponent::ShouldActivateController() const
|
||||
{
|
||||
// By default, components using the EditorRenderComponentAdapter will only activate if the component is visible
|
||||
// Since the mesh component handles visibility changes by not rendering the mesh, rather than deactivating the component entirely,
|
||||
// it can be activated even if it is not visible
|
||||
return true;
|
||||
}
|
||||
} // namespace Render
|
||||
} // namespace AZ
|
||||
|
||||
Reference in New Issue
Block a user