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
@@ -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;