Merge branch 'development' into cmake/SPEC-2513_w4267

This commit is contained in:
Esteban Papp
2021-08-02 18:03:04 -07:00
493 changed files with 7775 additions and 12867 deletions
@@ -30,29 +30,43 @@ namespace ScriptCanvasBuilder
{
m_source.Reset();
m_variables.clear();
m_overrides.clear();
m_overridesUnused.clear();
m_entityIds.clear();
m_dependencies.clear();
}
void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source)
{
for (auto& overriddenValue : m_overrides)
auto copyPreviousIfFound = [](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector<ScriptCanvas::GraphVariable>& source)
{
auto iter = AZStd::find_if(source.m_overrides.begin(), source.m_overrides.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); });
if (iter != source.m_overrides.end())
if (auto iter = AZStd::find_if(source.begin(), source.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); });
iter != source.end())
{
overriddenValue.DeepCopy(*iter);
overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide);
overriddenValue.SetAllowSignalOnChange(false);
// check that a name update is not necessary anymore
return true;
}
else
{
return false;
}
};
for (auto& overriddenValue : m_overrides)
{
if (!copyPreviousIfFound(overriddenValue, source.m_overrides))
{
// the variable in question may have been previously unused, and is now used, so copy the previous value over
copyPreviousIfFound(overriddenValue, source.m_overridesUnused);
}
}
//////////////////////////////////////////////////////////////////////////
// #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one.
// the above will provide the data to handle the cases where only certain dependency nodes were removed
// until then we do a sanity check, if any part of the depenecies were altered, assume no overrides are valid.
// until then we do a sanity check, if any part of the dependencies were altered, assume no overrides are valid.
if (m_dependencies.size() != source.m_dependencies.size())
{
return;
@@ -85,31 +99,41 @@ namespace ScriptCanvasBuilder
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(reflectContext))
{
serializeContext->Class<BuildVariableOverrides>()
->Version(0)
->Version(1)
->Field("source", &BuildVariableOverrides::m_source)
->Field("variables", &BuildVariableOverrides::m_variables)
->Field("entityId", &BuildVariableOverrides::m_entityIds)
->Field("overrides", &BuildVariableOverrides::m_overrides)
->Field("overridesUnused", &BuildVariableOverrides::m_overridesUnused)
->Field("dependencies", &BuildVariableOverrides::m_dependencies)
;
if (auto editContext = serializeContext->GetEditContext())
{
editContext->Class< BuildVariableOverrides>("Variables", "Variables exposed by the attached Script Canvas Graph")
->ClassElement(AZ::Edit::ClassElements::Group, "Variable Fields")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
editContext->Class<BuildVariableOverrides>("Variables", "Variables exposed by the attached Script Canvas Graph")
->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_overrides, "Variables", "Array of Variables within Script Canvas Graph")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false)
->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_overridesUnused, "Unused Variables", "Unused variables within Script Canvas Graph, when used they keep the values set here")
->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false)
->DataElement(AZ::Edit::UIHandlers::Default, &BuildVariableOverrides::m_dependencies, "Dependencies", "Variables in Dependencies of the Script Canvas Graph")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false)
;
}
}
}
// use this to initialize the new data, and make sure they have a editor graph variable for proper editor display
void BuildVariableOverrides::PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables)
void BuildVariableOverrides::PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, const ScriptCanvas::VariableData& variables)
{
if (!abstractCodeModel)
{
AZ_Error("ScriptCanvasBuider", false, "null abstract code model");
return;
}
const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs = abstractCodeModel->GetRuntimeInputs();
for (auto& variable : inputs.m_variables)
{
auto graphVariable = variables.FindVariable(variable.first);
@@ -147,6 +171,23 @@ namespace ScriptCanvasBuilder
}
}
}
for (auto& variable : abstractCodeModel->GetVariablesUnused())
{
auto graphVariable = variables.FindVariable(variable->m_sourceVariableId);
if (!graphVariable)
{
AZ_Error("ScriptCanvasBuilder", false, "Missing Variable from graph data that was just parsed");
continue;
}
// copy to override unused list for editor display
m_overridesUnused.push_back(*graphVariable);
auto& overrideValue = m_overridesUnused.back();
overrideValue.DeepCopy(*graphVariable);
overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide);
overrideValue.SetAllowSignalOnChange(false);
}
}
EditorAssetTree* EditorAssetTree::ModRoot()
@@ -345,7 +386,7 @@ namespace ScriptCanvasBuilder
BuildVariableOverrides result;
result.m_source = editorAssetTree.m_asset;
result.PopulateFromParsedResults(parseOutcome.GetValue()->GetRuntimeInputs(), *variableData);
result.PopulateFromParsedResults(parseOutcome.GetValue(), *variableData);
// recurse...
for (auto& dependentAsset : editorAssetTree.m_dependencies)
@@ -355,7 +396,7 @@ namespace ScriptCanvasBuilder
if (!parseDependentOutcome.IsSuccess())
{
return AZ::Failure(AZStd::string::format
("ParseEditorAssetTree failed to parse dependent graph from %s-%s: %s"
( "ParseEditorAssetTree failed to parse dependent graph from %s-%s: %s"
, dependentAsset.m_asset.GetId().ToString<AZStd::string>().c_str()
, dependentAsset.m_asset.GetHint().c_str()
, parseDependentOutcome.GetError().c_str()));
@@ -10,16 +10,9 @@
#include <AzCore/Asset/AssetCommon.h>
#include <ScriptCanvas/Asset/RuntimeAsset.h>
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
#include <ScriptCanvas/Variable/VariableCore.h>
namespace ScriptCanvas
{
namespace Grammar
{
struct ParsedRuntimeInputs;
}
}
namespace ScriptCanvasEditor
{
class ScriptCanvasAsset;
@@ -43,7 +36,7 @@ namespace ScriptCanvasBuilder
bool IsEmpty() const;
// use this to initialize the new data, and make sure they have a editor graph variable for proper editor display
void PopulateFromParsedResults(const ScriptCanvas::Grammar::ParsedRuntimeInputs& inputs, const ScriptCanvas::VariableData& variables);
void PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, const ScriptCanvas::VariableData& variables);
// #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one.
AZ::Data::Asset<ScriptCanvasEditor::ScriptCanvasAsset> m_source;
@@ -52,8 +45,9 @@ namespace ScriptCanvasBuilder
AZStd::vector<ScriptCanvas::GraphVariable> m_variables;
// the values here may or may not be overrides
AZStd::vector<AZStd::pair<ScriptCanvas::VariableId, AZ::EntityId>> m_entityIds;
// this is all that gets exposed to the edit context
// these two variable lists are all that gets exposed to the edit context
AZStd::vector<ScriptCanvas::GraphVariable> m_overrides;
AZStd::vector<ScriptCanvas::GraphVariable> m_overridesUnused;
// AZStd::vector<size_t> m_entityIdRuntimeInputIndices; since all of the entity ids need to go in, they may not need indices
AZStd::vector<BuildVariableOverrides> m_dependencies;
};
@@ -82,23 +82,35 @@ namespace ScriptCanvasBuilder
m_processEditorAssetDependencies.clear();
auto assetFilter = [this, &response](const AZ::Data::AssetFilterInfo& filterInfo)
AZStd::unordered_multimap<AZStd::string, AssetBuilderSDK::SourceFileDependency> jobDependenciesByKey;
auto assetFilter = [this, &jobDependenciesByKey](const AZ::Data::AssetFilterInfo& filterInfo)
{
// force load these before processing
if (filterInfo.m_assetType == azrtti_typeid<ScriptCanvas::SubgraphInterfaceAsset>()
|| filterInfo.m_assetType == azrtti_typeid<ScriptEvents::ScriptEventsAsset>())
|| filterInfo.m_assetType == azrtti_typeid<ScriptEvents::ScriptEventsAsset>())
{
this->m_processEditorAssetDependencies.push_back(filterInfo);
}
// these trigger re-processing
if (filterInfo.m_assetType == azrtti_typeid<ScriptCanvasEditor::ScriptCanvasAsset>()
|| filterInfo.m_assetType == azrtti_typeid<ScriptEvents::ScriptEventsAsset>()
|| filterInfo.m_assetType == azrtti_typeid<ScriptCanvas::SubgraphInterfaceAsset>())
if (filterInfo.m_assetType == azrtti_typeid<ScriptCanvasEditor::ScriptCanvasAsset>())
{
AZ_Error("ScriptCanvas", false, "ScriptAsset Reference in a graph detected");
}
if (filterInfo.m_assetType == azrtti_typeid<ScriptEvents::ScriptEventsAsset>())
{
AssetBuilderSDK::SourceFileDependency dependency;
dependency.m_sourceFileDependencyUUID = filterInfo.m_assetId.m_guid;
response.m_sourceFileDependencyList.push_back(dependency);
jobDependenciesByKey.insert({ ScriptEvents::k_builderJobKey, dependency });
}
if (filterInfo.m_assetType == azrtti_typeid<ScriptCanvas::SubgraphInterfaceAsset>())
{
AssetBuilderSDK::SourceFileDependency dependency;
dependency.m_sourceFileDependencyUUID = filterInfo.m_assetId.m_guid;
jobDependenciesByKey.insert({ s_scriptCanvasProcessJobKey, dependency });
}
// Asset filter always returns false to prevent parsing dependencies, but makes note of the script canvas dependencies
@@ -163,9 +175,10 @@ namespace ScriptCanvasBuilder
jobDescriptor.m_additionalFingerprintInfo = AZStd::string(GetFingerprintString()).append("|").append(AZStd::to_string(static_cast<AZ::u64>(fingerprint)));
// Graph process job needs to wait until its dependency asset job finished
for (const auto& processingDependency : response.m_sourceFileDependencyList)
for (const auto& processingDependency : jobDependenciesByKey)
{
jobDescriptor.m_jobDependencyList.emplace_back(s_scriptCanvasProcessJobKey, info.m_identifier.c_str(), AssetBuilderSDK::JobDependencyType::Order, processingDependency);
response.m_sourceFileDependencyList.push_back(processingDependency.second);
jobDescriptor.m_jobDependencyList.emplace_back(processingDependency.first, info.m_identifier.c_str(), AssetBuilderSDK::JobDependencyType::Order, processingDependency.second);
}
response.m_createJobOutputs.push_back(jobDescriptor);
@@ -58,6 +58,7 @@ namespace ScriptCanvasBuilder
AddAssetDependencySearch,
PrefabIntegration,
CorrectGraphVariableVersion,
ReflectEntityIdNodes,
// add new entries above
Current,
};
@@ -97,7 +97,7 @@ namespace ScriptCanvasBuilder
bool pathFound = false;
AZStd::string relativePath;
AzToolsFramework::AssetSystemRequestBus::BroadcastResult
(pathFound
( pathFound
, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath
, fullPath.c_str(), relativePath);
@@ -474,6 +474,8 @@ namespace ScriptCanvasEditor
OnScriptCanvasAssetReady(memoryAsset);
}
}
AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent);
}
void EditorScriptCanvasComponent::OnStartPlayInEditor()
@@ -21,6 +21,7 @@
#include <ScriptCanvas/Execution/ExecutionState.h>
#include <ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.h>
#include <ScriptCanvas/Execution/RuntimeComponent.h>
#include <ScriptCanvas/Libraries/UnitTesting/UnitTestBusSender.h>
namespace ScriptCanvasEditor
{
@@ -217,11 +218,27 @@ namespace ScriptCanvasEditor
if (!reporter.IsProcessOnly())
{
dependencies = LoadInterpretedDepencies(luaAssetResult.m_dependencies.source.userSubgraphs);
RuntimeDataOverrides runtimeDataOverrides;
runtimeDataOverrides.m_runtimeAsset = loadResult.m_runtimeAsset;
#if defined(LINUX) //////////////////////////////////////////////////////////////////////////
// Temporarily disable testing on the Linux build until the file name casing discrepancy
// is sorted out through the SC build and testing pipeline.
if (!luaAssetResult.m_dependencies.source.userSubgraphs.empty())
{
auto graphEntityId = AZ::Entity::MakeId();
reporter.SetGraph(graphEntityId);
loadResult.m_entity->Activate();
ScriptCanvas::UnitTesting::EventSender::MarkComplete(graphEntityId, "");
loadResult.m_entity->Deactivate();
reporter.FinishReport();
ScriptCanvas::SystemRequestBus::Broadcast(&ScriptCanvas::SystemRequests::MarkScriptUnitTestEnd);
return;
}
#else ///////////////////////////////////////////////////////////////////////////////////////
dependencies = LoadInterpretedDepencies(luaAssetResult.m_dependencies.source.userSubgraphs);
if (!dependencies.empty())
{
// #functions2_recursive_unit_tests eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework
@@ -258,6 +275,7 @@ namespace ScriptCanvasEditor
Execution::InitializeInterpretedStatics(dependencyData);
}
}
#endif //////////////////////////////////////////////////////////////////////////////////////
loadResult.m_scriptAsset = luaAssetResult.m_scriptAsset;
loadResult.m_runtimeAsset.Get()->GetData().m_script = loadResult.m_scriptAsset;
@@ -120,7 +120,6 @@ namespace ScriptCanvasEditor
m_variableName = m_variable->GetVariableName();
const AZStd::string variableTypeName = TranslationHelper::GetSafeTypeName(m_variable->GetDatum()->GetType());
m_variable->SetDisplayName(variableTypeName);
m_componentTitle = AZStd::string::format("%s Variable", variableTypeName.data());
@@ -2083,7 +2083,6 @@ namespace ScriptCanvas
editContext->Class<Datum>("Datum", "Datum")
->ClassElement(AZ::Edit::ClassElements::EditorData, "Datum")
->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetVisibility)
->Attribute(AZ::Edit::Attributes::ChildNameLabelOverride, &Datum::GetLabel)
->DataElement(AZ::Edit::UIHandlers::Default, &Datum::m_storage, "Datum", "")
->Attribute(AZ::Edit::Attributes::Visibility, &Datum::GetDatumVisibility)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
@@ -803,12 +803,6 @@ namespace ScriptCanvas
m_namespacePath = namespacePath;
}
void SubgraphInterface::TakeNamespacePath(NamespacePath&& namespacePath)
{
m_namespacePath = AZStd::move(namespacePath);
}
AZStd::string SubgraphInterface::ToExecutionString() const
{
AZStd::string result;
@@ -236,8 +236,6 @@ namespace ScriptCanvas
void SetNamespacePath(const NamespacePath& namespacePath);
void TakeNamespacePath(NamespacePath&& namespacePath);
AZStd::string ToExecutionString() const;
private:
@@ -37,8 +37,7 @@ namespace ScriptCanvas
static void Reflect(AZ::ReflectContext* reflection);
static BehaviorContextObjectPtr Create(const AZ::BehaviorClass& behaviorClass, const void* value = nullptr);
static BehaviorContextObjectPtr CreateDeepCopy(const AZ::BehaviorClass& behaviorClass, const BehaviorContextObject* value = nullptr);
template<typename t_Value>
AZ_INLINE static BehaviorContextObjectPtr Create(const t_Value& value, const AZ::BehaviorClass& behaviorClass);
@@ -116,6 +115,7 @@ namespace ScriptCanvas
AZ_FORCE_INLINE BehaviorContextObject() = default;
BehaviorContextObject& operator=(const BehaviorContextObject&) = delete;
BehaviorContextObject(const BehaviorContextObject&) = delete;
// copy ctor
@@ -1358,17 +1358,23 @@ namespace ScriptCanvas
{
if (variable->m_isMember)
{
return !this->m_variableUse.memberVariables.contains(variable);
if (!this->m_variableUse.memberVariables.contains(variable))
{
m_variablesUnused.push_back(variable);
return true;
}
}
else
{
return !this->m_variableUse.localVariables.contains(variable);
if (!this->m_variableUse.localVariables.contains(variable))
{
m_variablesUnused.push_back(variable);
return true;
}
}
}
else
{
return false;
}
return false;
});
}
@@ -2068,6 +2074,11 @@ namespace ScriptCanvas
return m_variables;
}
const AZStd::vector<VariableConstPtr>& AbstractCodeModel::GetVariablesUnused() const
{
return m_variablesUnused;
}
bool AbstractCodeModel::IsActiveGraph() const
{
if (!m_nodeablesByNode.empty())
@@ -3230,7 +3241,7 @@ namespace ScriptCanvas
auto valueSlot = forEachNodeSC->GetSlot(forEachNodeSC->GetValueSlotId());
AZ_Assert(valueSlot, "no value slot in for each node");
lastExecution->AddChild({});
lastExecution->AddChild({ &loopSlot, {}, nullptr });
auto outputValue = CreateOutputData(lastExecution, lastExecution->ModChild(0), *valueSlot);
lastExecution->ModChild(0).m_output.push_back({ valueSlot, outputValue });
@@ -138,6 +138,8 @@ namespace ScriptCanvas
const AZStd::vector<VariableConstPtr>& GetVariables() const;
const AZStd::vector<VariableConstPtr>& GetVariablesUnused() const;
bool IsErrorFree() const;
// has modified data or handlers
@@ -166,8 +168,6 @@ namespace ScriptCanvas
void AddAllVariablesPreParse();
void AddAllVariablesPreParse_LegacyFunctions();
void AddDebugInformation();
void AddDebugInformation(ExecutionChild& execution);
@@ -519,6 +519,7 @@ namespace ScriptCanvas
AZStd::unordered_map<VariableConstPtr, DependencyInfo> m_dependencyByVariable;
AZStd::vector<VariableConstPtr> m_variables;
AZStd::vector<VariableConstPtr> m_variablesUnused;
AZStd::vector<const Node*> m_possibleExecutionRoots;
// true iff there are no internal errors and no error validation events
@@ -235,7 +235,7 @@ namespace ScriptCanvas
const VariableData Source::k_emptyVardata{};
Source::Source
(const Graph& graph
( const Graph& graph
, const AZ::Data::AssetId& id
, const GraphData& graphData
, const VariableData& variableData
@@ -277,7 +277,7 @@ namespace ScriptCanvas
AzFramework::StringFunc::Path::StripExtension(namespacePath);
return AZ::Success(Source
(*request.graph
(*request.graph
, request.scriptAssetId
, *graphData
, *sourceVariableData
@@ -290,7 +290,7 @@ namespace ScriptCanvas
Source() = default;
Source
(const Graph& graph
( const Graph& graph
, const AZ::Data::AssetId& id
, const GraphData& graphData
, const VariableData& variableData
@@ -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<EntityIDNodes::IsValidNode>()))
if (!rootNodeElement.Convert(context, azrtti_typeid<EntityNodes::IsValidNode>()))
{
AZ_Error("Script Canvas", false, "Unable to convert old Entity::IsValid function node(%s) to new EntityId::IsValid function node(%s)",
rootNodeElement.GetId().ToString<AZStd::string>().data(), azrtti_typeid<EntityIDNodes::IsValidNode>().ToString<AZStd::string>().data());
rootNodeElement.GetId().ToString<AZStd::string>().data(), azrtti_typeid<EntityNodes::IsValidNode>().ToString<AZStd::string>().data());
return false;
}
@@ -79,14 +79,12 @@ namespace ScriptCanvas
void Entity::InitNodeRegistry(NodeRegistry& nodeRegistry)
{
EntityIDNodes::Registrar::AddToRegistry<Entity>(nodeRegistry);
EntityNodes::Registrar::AddToRegistry<Entity>(nodeRegistry);
}
AZStd::vector<AZ::ComponentDescriptor*> Entity::GetComponentDescriptors()
{
AZStd::vector<AZ::ComponentDescriptor*> descriptors;
EntityIDNodes::Registrar::AddDescriptors(descriptors);
EntityNodes::Registrar::AddDescriptors(descriptors);
return descriptors;
}
@@ -12,5 +12,4 @@
// shared code
#include "RotateMethod.h"
#include "EntityIDNodes.h"
#include "EntityNodes.h"
@@ -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 <ScriptCanvas/Core/NodeFunctionGeneric.h>
#include <AzCore/Component/Entity.h>
#include <AzCore/Component/ComponentApplicationBus.h>
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
>;
}
}
@@ -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<int t_Index>
AZ_INLINE void DefaultScale(Node& node) { SetDefaultValuesByIndex<t_Index>::_(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
>;
}
}
@@ -348,7 +348,6 @@ namespace ScriptCanvas
void GraphVariable::SetVariableName(AZStd::string_view variableName)
{
m_variableName = variableName;
SetDisplayName(variableName);
}
AZStd::string_view GraphVariable::GetVariableName() const
@@ -356,16 +355,6 @@ namespace ScriptCanvas
return m_variableName;
}
void GraphVariable::SetDisplayName(const AZStd::string& displayName)
{
m_datum.SetLabel(displayName);
}
AZStd::string_view GraphVariable::GetDisplayName() const
{
return m_datum.GetLabel();
}
void GraphVariable::SetScriptInputControlVisibility(const AZ::Crc32& inputControlVisibility)
{
m_inputControlVisibility = inputControlVisibility;
@@ -134,9 +134,6 @@ namespace ScriptCanvas
void SetVariableName(AZStd::string_view displayName);
AZStd::string_view GetVariableName() const;
void SetDisplayName(const AZStd::string& displayName);
AZStd::string_view GetDisplayName() const;
void SetScriptInputControlVisibility(const AZ::Crc32& inputControlVisibility);
AZ::Crc32 GetInputControlVisibility() const;
@@ -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