diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 6a5344ed9b..73e18a356c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -30,6 +30,7 @@ namespace ScriptCanvasBuilder { m_source.Reset(); m_variables.clear(); + m_overrides.clear(); m_entityIds.clear(); m_dependencies.clear(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 9135f348b3..dbc525e8e1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -474,6 +474,8 @@ namespace ScriptCanvasEditor OnScriptCanvasAssetReady(memoryAsset); } } + + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } void EditorScriptCanvasComponent::OnStartPlayInEditor() diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp index 1cce8cb3d3..b2bfd25031 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.cpp @@ -23,10 +23,10 @@ namespace ScriptCanvas // The DataElementNode is being copied purposefully in this statement to clone the data AZ::SerializeContext::DataElementNode baseNodeElement = rootNodeElement.GetSubElement(nodeElementIndex); - if (!rootNodeElement.Convert(context, azrtti_typeid())) + if (!rootNodeElement.Convert(context, azrtti_typeid())) { AZ_Error("Script Canvas", false, "Unable to convert old Entity::IsValid function node(%s) to new EntityId::IsValid function node(%s)", - rootNodeElement.GetId().ToString().data(), azrtti_typeid().ToString().data()); + rootNodeElement.GetId().ToString().data(), azrtti_typeid().ToString().data()); return false; } @@ -79,14 +79,12 @@ namespace ScriptCanvas void Entity::InitNodeRegistry(NodeRegistry& nodeRegistry) { - EntityIDNodes::Registrar::AddToRegistry(nodeRegistry); EntityNodes::Registrar::AddToRegistry(nodeRegistry); } AZStd::vector Entity::GetComponentDescriptors() { AZStd::vector descriptors; - EntityIDNodes::Registrar::AddDescriptors(descriptors); EntityNodes::Registrar::AddDescriptors(descriptors); return descriptors; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h index dcfae2db9f..f8171a3fe0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Entity.h @@ -12,5 +12,4 @@ // shared code #include "RotateMethod.h" -#include "EntityIDNodes.h" #include "EntityNodes.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNodes.h deleted file mode 100644 index fa6cd9981e..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityIDNodes.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include - -namespace ScriptCanvas -{ - namespace EntityIDNodes - { - using namespace Data; - static const char* k_categoryName = "Entity/Entity"; - - AZ_INLINE BooleanType IsValid(const EntityIDType& source) - { - return source.IsValid(); - } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsValid, k_categoryName, "{0ED8A583-A397-4657-98B1-433673323F21}", "returns true if Source is valid, else false", "Source"); - - AZ_INLINE StringType ToString(const EntityIDType& source) - { - return source.ToString(); - } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToString, k_categoryName, "{B094DCAE-15D5-42A3-8D8C-5BD68FE6E356}", "returns a string representation of Source", "Source"); - - AZ_INLINE BooleanType IsActive(const EntityIDType& entityId) - { - AZ::Entity* entity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, entityId); - return (entity && entity->GetState() == AZ::Entity::State::Active); - } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsActive, k_categoryName, "{DF5240FD-6510-4C24-8382-9515C4B0C7B4}", "returns true if entity with the provided Id is valid and active.", "Entity Id"); - - using Registrar = RegistrarGeneric< - IsValidNode, - ToStringNode, - IsActiveNode - >; - - } -} - diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityNodes.h index dcad06d2c7..701c3a0869 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/EntityNodes.h @@ -21,7 +21,7 @@ namespace ScriptCanvas namespace EntityNodes { using namespace Data; - static const char* k_categoryName = "Entity/Transform"; + static const char* k_categoryName = "Entity/Entity"; template AZ_INLINE void DefaultScale(Node& node) { SetDefaultValuesByIndex::_(node, Data::One()); } @@ -59,10 +59,33 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(GetEntityUp, DefaultScale<1>, k_categoryName, "{96B86F3F-F022-4611-9AEA-175EA952C562}", "returns the up direction vector from the specified entity's world transform, scaled by a given value (Lumberyard uses Z up, right handed)", "EntityId", "Scale"); + AZ_INLINE BooleanType IsActive(const EntityIDType& entityId) + { + AZ::Entity* entity = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, entityId); + return (entity && entity->GetState() == AZ::Entity::State::Active); + } + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsActive, k_categoryName, "{DF5240FD-6510-4C24-8382-9515C4B0C7B4}", "returns true if entity with the provided Id is valid and active.", "Entity Id"); + + AZ_INLINE BooleanType IsValid(const EntityIDType& source) + { + return source.IsValid(); + } + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsValid, k_categoryName, "{0ED8A583-A397-4657-98B1-433673323F21}", "returns true if Source is valid, else false", "Source"); + + AZ_INLINE StringType ToString(const EntityIDType& source) + { + return source.ToString(); + } + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToString, k_categoryName, "{B094DCAE-15D5-42A3-8D8C-5BD68FE6E356}", "returns a string representation of Source", "Source"); + using Registrar = RegistrarGeneric< GetEntityRightNode, GetEntityForwardNode, - GetEntityUpNode + GetEntityUpNode, + IsActiveNode, + IsValidNode, + ToStringNode >; } } diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index e1c12b7068..84ba39cc72 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -297,7 +297,6 @@ set(FILES Include/ScriptCanvas/Libraries/Core/UnaryOperator.h Include/ScriptCanvas/Libraries/Entity/Entity.cpp Include/ScriptCanvas/Libraries/Entity/Entity.h - Include/ScriptCanvas/Libraries/Entity/EntityIDNodes.h Include/ScriptCanvas/Libraries/Entity/EntityNodes.h Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp Include/ScriptCanvas/Libraries/Entity/RotateMethod.h