Merge branch 'carlitosan/thecleansing' of https://github.com/aws-lumberyard-dev/o3de into carlitosan/thecleansing

main
chcurran 5 years ago
commit 21b511b174

@ -1,6 +1,6 @@
/*
* 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
*
*/

@ -160,7 +160,7 @@ namespace ScriptCanvasEditor
struct ScopedOutputSuppression
{
ScopedOutputSuppression([[maybe_unused]] bool suppressState = true)
ScopedOutputSuppression(bool suppressState = true)
{
AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", "");
TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState);

@ -110,12 +110,12 @@ namespace ScriptCanvasEditor
, m_graphCanvasSaveVersion(GraphCanvas::EntitySaveDataContainer::CurrentVersion)
, m_upgradeSM(this)
{}
~Graph() override;
void Activate() override;
void Deactivate() override;
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
ScriptCanvas::Graph::GetProvidedServices(provided);
@ -160,7 +160,7 @@ namespace ScriptCanvasEditor
bool CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) override;
bool IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const override;
AZStd::string GetDataTypeString(const AZ::Uuid& typeId) override;
void OnRemoveUnusedNodes() override;
@ -188,7 +188,7 @@ namespace ScriptCanvasEditor
GraphCanvas::CanHandleMimeEventOutcome CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override;
bool HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override;
GraphCanvas::SlotId RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason ) override;
GraphCanvas::SlotId RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason) override;
void ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) override;
void FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) override;
@ -212,7 +212,7 @@ namespace ScriptCanvasEditor
void PostCreationEvent() override;
void OnPasteBegin() override;
void OnPasteEnd() override;
void OnViewRegistered() override;
/////////////////////////////////////////////////////////////////////////////////////////////
@ -258,7 +258,7 @@ namespace ScriptCanvasEditor
AZStd::vector<NodeIdPair> GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier&) override;
AZStd::vector<NodeIdPair> GetVariableNodes(const ScriptCanvas::VariableId&) override;
void RemoveUnusedVariables() override;
bool CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) override;
@ -266,9 +266,9 @@ namespace ScriptCanvasEditor
bool ConvertReferenceToVariableNode(const GraphCanvas::Endpoint& endpoint) override;
void QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) override;
bool CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) override;
ScriptCanvas::Endpoint ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const override;
GraphCanvas::Endpoint ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const override;
////
@ -326,8 +326,8 @@ namespace ScriptCanvasEditor
Graph(const Graph&) = delete;
void DisplayUpdateToast();
AZ::EntityId ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const;
AZ::EntityId ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const;
GraphCanvas::NodePropertyDisplay* CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const;
@ -363,10 +363,10 @@ namespace ScriptCanvasEditor
AZ::EntityId m_wrapperNodeDropTarget;
VariableComboBoxDataModel m_variableDataModel;
WrappedNodeGroupingMap m_wrappedNodeGroupings;
AZStd::vector< AZ::EntityId > m_lastGraphCanvasCreationGroup;
AZ::Entity* m_graphCanvasSceneEntity;
GraphCanvas::EntitySaveDataContainer::VersionInformation m_graphCanvasSaveVersion;

@ -54,7 +54,7 @@ namespace ScriptCanvas
virtual bool FindConnection(AZ::Entity*& connectionEntity, const Endpoint& firstEndpoint, const Endpoint& otherEndpoint) const = 0;
virtual Slot* FindSlot(const Endpoint& endpoint) const = 0;
//! Retrieves the Entity this Graph component is located on
//! NOTE: There can be multiple Graph components on the same entity so calling FindComponent may not not return this GraphComponent
virtual AZ::Entity* GetGraphEntity() const = 0;
@ -62,7 +62,7 @@ namespace ScriptCanvas
//! Retrieves the Graph Component directly using the BusId
virtual Graph* GetGraph() = 0;
virtual bool Connect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId,const SlotId& targetSlot) = 0;
virtual bool Connect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId, const SlotId& targetSlot) = 0;
virtual bool Disconnect(const AZ::EntityId& sourceNodeId, const SlotId& sourceSlot, const AZ::EntityId& targetNodeId, const SlotId& targetSlot) = 0;
virtual bool ConnectByEndpoint(const Endpoint& sourceEndpoint, const Endpoint& targetEndpoint) = 0;
@ -91,7 +91,7 @@ namespace ScriptCanvas
virtual bool AddItem(AZ::Entity* itemEntity) = 0;
//! Remove item if it is on the graph
virtual bool RemoveItem(AZ::Entity* itemEntity) = 0;
//! Retrieves a pointer the GraphData structure stored on the graph
virtual GraphData* GetGraphData() = 0;
virtual const GraphData* GetGraphDataConst() const = 0;

@ -1,6 +1,6 @@
/*
* 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
*
*/
@ -23,7 +23,7 @@ namespace ScriptCanvas
AZ_COMPONENT(BinaryOperator, "{5BD0E8C7-9B0A-42F5-9EB0-199E6EC8FA99}", Node);
static void Reflect(AZ::ReflectContext* reflection);
static const char* k_lhsName;
static const char* k_rhsName;
static const char* k_resultName;
@ -31,7 +31,7 @@ namespace ScriptCanvas
static const char* k_evaluateName;
static const char* k_outName;
static const char* k_onTrue;
static const char* k_onFalse;
static const char* k_onFalse;
protected:
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override
@ -47,7 +47,7 @@ namespace ScriptCanvas
SlotId GetOutputSlotId() const;
};
class ArithmeticExpression
: public BinaryOperator
{
@ -57,20 +57,20 @@ namespace ScriptCanvas
static void Reflect(AZ::ReflectContext* reflection);
bool IsDeprecated() const override { return true; }
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
protected:
// adds Number inputs, adds Number output type
void OnInit() override;
};
class BooleanExpression
: public BinaryOperator
{
public:
AZ_COMPONENT(BooleanExpression, "{36C69825-CFF8-4F70-8F3B-1A9227E8BEEA}", BinaryOperator);
static void Reflect(AZ::ReflectContext* reflection);
//////////////////////////////////////////////////////////////////////////
@ -93,20 +93,20 @@ namespace ScriptCanvas
//////////////////////////////////////////////////////////////////////////
protected:
// initialize boolean expression, adds boolean output type calls
// initialize boolean expression, adds boolean output type calls
void OnInit() override;
virtual void InitializeBooleanExpression();
virtual void InitializeBooleanExpression();
};
// accepts any type, checks for type equality, and then value equality or pointer equality
class EqualityExpression
: public BooleanExpression
: public BooleanExpression
{
public:
AZ_COMPONENT(EqualityExpression, "{78D20EB6-BA07-4071-B646-7C2D68A0A4A6}", BooleanExpression);
static void Reflect(AZ::ReflectContext* reflection);
protected:
// adds any required input types
void InitializeBooleanExpression() override;
@ -125,10 +125,10 @@ namespace ScriptCanvas
AZ_COMPONENT(ComparisonExpression, "{82C50EAD-D3DD-45D2-BFCE-981D95771DC8}", EqualityExpression);
static void Reflect(AZ::ReflectContext* reflection);
protected:
// adds number types
void InitializeBooleanExpression() override;
void InitializeBooleanExpression() override;
};
}
}
}
}

@ -130,12 +130,12 @@ namespace ScriptCanvas
{
return IsIDRequired();
}
bool EBusEventHandler::IsAutoConnected() const
{
return m_autoConnectToGraphOwner;
}
const Datum* EBusEventHandler::GetHandlerStartAddress() const
{
return FindDatum(GetSlotId(c_busIdName));
@ -203,7 +203,7 @@ namespace ScriptCanvas
{
return AZ::Success(entry->m_eventName);
}
return AZ::Failure();
}
@ -244,7 +244,7 @@ namespace ScriptCanvas
{
return EventHandlerTranslationHelper::GetSlotsInExecutionThreadByType(*this, executionSlot, targetSlotType);
}
AZStd::vector<SlotId> EBusEventHandler::GetNonEventSlotIds() const
{
AZStd::vector<SlotId> nonEventSlotIds;
@ -311,7 +311,7 @@ namespace ScriptCanvas
return true;
}
const AZ::BehaviorEBusHandler::BusForwarderEvent& event = m_handler->GetEvents()[eventIndex];
const AZ::BehaviorEBusHandler::BusForwarderEvent& event = m_handler->GetEvents()[eventIndex];
// Compare output type
const bool eventHasOutput = !event.m_parameters.empty() && !event.m_parameters.front().m_typeId.IsNull() && event.m_parameters.front().m_typeId != azrtti_typeid<void>();
@ -451,7 +451,7 @@ namespace ScriptCanvas
config.m_name = c_busIdName;
config.m_toolTip = busToolTip;
config.SetConnectionType(ConnectionType::Input);
if (busId == azrtti_typeid<AZ::EntityId>())
{
config.SetDefaultValue(GraphOwnerId);
@ -459,7 +459,7 @@ namespace ScriptCanvas
else
{
Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId));
config.ConfigureDatum(AZStd::move(Datum(busIdType, Datum::eOriginality::Original)));
}
@ -655,7 +655,7 @@ namespace ScriptCanvas
return AZStd::find(m_parameterSlotIds.begin(), m_parameterSlotIds.end(), slotId) != m_parameterSlotIds.end();
}
}
bool EBusEventEntry::EBusEventEntryVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement)
{
if (rootElement.GetVersion() == 0)

@ -36,7 +36,7 @@ namespace ScriptCanvas
static void Reflect(AZ::ReflectContext* context);
AZ_TYPE_INFO(EBusEventEntry, "{92A20C1B-A54A-4583-97DB-A894377ACE21}");
AZStd::string m_eventName;
EBusEventId m_eventId;
SlotId m_eventSlotId;
@ -44,7 +44,7 @@ namespace ScriptCanvas
AZStd::vector<SlotId> m_parameterSlotIds;
int m_numExpectedArguments = {};
bool m_resultEvaluated = {};
bool m_shouldHandleEvent = false;
bool m_isHandlingEvent = false;
@ -54,7 +54,7 @@ namespace ScriptCanvas
};
//! Provides a node that represents an EBus handler
class EBusEventHandler
class EBusEventHandler
: public Node
, public EBusHandlerNodeRequestBus::Handler
{
@ -68,7 +68,7 @@ namespace ScriptCanvas
using Events = AZStd::vector<EBusEventEntry>;
using EventMap = AZStd::map<AZ::Crc32, EBusEventEntry>;
EBusEventHandler()
EBusEventHandler()
: m_autoConnectToGraphOwner(true)
{}
@ -79,7 +79,7 @@ namespace ScriptCanvas
void OnInit() override;
void OnActivate() override;
void OnGraphSet() override;
void CollectVariableReferences(AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const override;
bool ContainsReferencesToVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) const override;
@ -93,10 +93,10 @@ namespace ScriptCanvas
void InitializeEvent(int eventIndex);
bool IsOutOfDate(const VersionData& graphVersion) const override;
bool IsOutOfDate(const VersionData& graphVersion) const override;
bool CreateHandler(AZStd::string_view ebusName);
const EBusEventEntry* FindEventWithSlot(const Slot& slot) const;
AZ::Outcome<AZStd::string, void> GetFunctionCallName(const Slot* /*slot*/) const override;
@ -119,7 +119,7 @@ namespace ScriptCanvas
AZStd::vector<SlotId> GetNonEventSlotIds() const override;
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
bool IsEventSlotId(const SlotId& slotId) const;
bool IsEventHandler() const override;
@ -129,7 +129,7 @@ namespace ScriptCanvas
bool IsVariableWriteHandler() const override;
bool IsValid() const;
inline bool IsIDRequired() const
{
return m_ebus && BehaviorContextUtils::GetEBusAddressPolicy(*m_ebus) == AZ::EBusAddressPolicy::ById;
@ -156,11 +156,11 @@ namespace ScriptCanvas
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* executionChildSlot) const override;
inline bool IsConfigured() const { return !m_eventMap.empty(); }
private:
EBusEventHandler(const EBusEventHandler&) = delete;
EventMap m_eventMap;
AZStd::string m_ebusName;
ScriptCanvas::EBusBusId m_busId;

@ -56,7 +56,7 @@ namespace ScriptCanvas
AddPropertySlots(dataType);
}
}
Data::Type ExtractProperty::GetSourceSlotDataType() const
{
return m_dataType;
@ -81,7 +81,7 @@ namespace ScriptCanvas
{
return AZ::Success(DependencyReport::NativeLibrary(Data::GetName(m_dataType)));
}
PropertyFields ExtractProperty::GetPropertyFields() const
{
PropertyFields propertyFields;

@ -44,7 +44,7 @@ namespace ScriptCanvas
bool IsOutOfDate(const VersionData& graphVersion) const override;
////
protected:
void OnInit() override;

@ -289,7 +289,7 @@ namespace ScriptCanvas
const GraphVariableMapping* variableMap = nullptr;
GraphRequestBus::EventResult(variableMap, GetOwningScriptCanvasId(), &GraphRequests::GetVariables);
if (variableMap && baseType.IsValid())
{
for (const auto& variablePair : *variableMap)

@ -58,7 +58,7 @@ namespace ScriptCanvas
const Slot* GetVariableOutputSlot() const override;
// Translation
//////////////////////////////////////////////////////////////////////////
protected:

@ -121,7 +121,7 @@ namespace ScriptCanvas
{
return AZ::Failure();
}
DependencyReport dependencyNames;
for (size_t index(0), sentinel = m_method->GetNumArguments(); index < sentinel; ++index)
{
@ -131,7 +131,7 @@ namespace ScriptCanvas
return AZ::Success(dependencyNames);
}
AZ::Outcome<Grammar::LexicalScope, void> Method::GetFunctionCallLexicalScope(const Slot* /*slot*/) const
{
if (m_method)
@ -139,7 +139,7 @@ namespace ScriptCanvas
Grammar::LexicalScope lexicalScope;
if (m_method->IsMember()
|| AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes))
|| AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes))
{
lexicalScope.m_type = Grammar::LexicalScopeType::Variable;
}
@ -160,7 +160,7 @@ namespace ScriptCanvas
if (m_method)
{
if (m_method->IsMember()
|| AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes))
|| AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, m_method->m_attributes))
{
auto name = BehaviorContextUtils::FindExposedMethodName(*m_method, m_class);
if (!name.empty())
@ -172,7 +172,7 @@ namespace ScriptCanvas
return AZ::Success(m_lookupName);
}
EventType Method::GetFunctionEventType(const Slot*) const
{
return m_eventType;
@ -206,7 +206,7 @@ namespace ScriptCanvas
m_lookupName = config.m_lookupName ? AZStd::string(*config.m_lookupName) : config.m_method.m_name;
m_methodType = config.m_methodType;
m_eventType = config.m_eventType;
auto isExposableOutcome = IsExposable(config.m_method);
AZ_Warning("ScriptCanvas", isExposableOutcome.IsSuccess(), "BehaviorContext Method %s is no longer exposable to ScriptCanvas: %s", isExposableOutcome.GetError().data());
ConfigureMethod(config.m_method, config.m_class);
@ -322,7 +322,7 @@ namespace ScriptCanvas
}
}
void Method::InitializeEvent(const NamespacePath&, AZStd::string_view ebusName, AZStd::string_view eventName)
void Method::InitializeEvent(const NamespacePath&, AZStd::string_view ebusName, AZStd::string_view eventName)
{
AZStd::lock_guard<AZStd::recursive_mutex> lock(m_mutex);
@ -698,7 +698,7 @@ namespace ScriptCanvas
return TupleType{ method, m_methodType, eventType, bcClass };
}
return TupleType{ nullptr, MethodType::Count, EventType::Count, nullptr};
return TupleType{ nullptr, MethodType::Count, EventType::Count, nullptr };
}
void Method::OnWriteEnd()
@ -804,13 +804,13 @@ namespace ScriptCanvas
{
editContext->Class<Method>("Method", "Method")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
;
}
}
}
}
}
}
}
}
}

@ -182,6 +182,6 @@ namespace ScriptCanvas
Method(const Method&) = delete;
};
}
}
}
}
}
}

@ -27,7 +27,7 @@ namespace ScriptCanvas
AZStd::unordered_map<size_t, const AZ::BehaviorMethod*> GetTupleGetMethods(const AZ::TypeId& typeId)
{
AZStd::unordered_map<size_t, const AZ::BehaviorMethod*> tupleGetMethodMap;
AZ::BehaviorContext* behaviorContext{};
AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext);
auto bcClassIterator = behaviorContext->m_typeToClassMap.find(typeId);
@ -83,4 +83,4 @@ namespace ScriptCanvas
return AZ::Failure();
}
}
}

@ -24,4 +24,4 @@ namespace ScriptCanvas
AZStd::unordered_map<size_t, const AZ::BehaviorMethod*> GetTupleGetMethods(const AZ::TypeId& typeId);
AZ::Outcome<const AZ::BehaviorMethod*, void> GetTupleGetMethod(const AZ::TypeId& typeID, size_t index);
}
}

@ -93,7 +93,7 @@ namespace ScriptCanvas
bool isNewSlot = true;
const auto busToolTip = AZStd::string::format("%s (Type: %s)", c_busIdTooltip, m_ebus->m_idParam.m_name);
const AZ::TypeId& busId = m_ebus->m_idParam.m_typeId;
const AZ::TypeId& busId = m_ebus->m_idParam.m_typeId;
SlotId addressSlotId;
@ -117,8 +117,8 @@ namespace ScriptCanvas
}
else
{
Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId));
Data::Type busIdType(AZ::BehaviorContextHelper::IsStringParameter(m_ebus->m_idParam) ? Data::Type::String() : Data::FromAZType(busId));
config.ConfigureDatum(AZStd::move(Datum(busIdType, Datum::eOriginality::Original)));
config.m_contractDescs = { { [busIdType]() { return aznew RestrictedTypeContract({ busIdType }); } } };
}
@ -267,7 +267,7 @@ namespace ScriptCanvas
SlotId slotId = AddSlot(slotConfiguration, isNewSlot);
AZ_Error("ScriptCanvas", populationMapping.find(argIdentifier) == populationMapping.end(), "Trying to create the same slot twice. Unable to create sane mapping.");
populationMapping[argIdentifier] = slotId;
eBusEventEntry.m_parameterSlotIds.push_back(slotId);
}
@ -281,7 +281,7 @@ namespace ScriptCanvas
slotConfiguration.m_isLatent = true;
slotConfiguration.m_name = eventID;
slotConfiguration.SetConnectionType(ConnectionType::Output);
slotConfiguration.SetConnectionType(ConnectionType::Output);
slotConfiguration.m_addUniqueSlotByNameAndType = true;
auto remappingIter = m_eventSlotMapping.find(outputSlotId);
@ -323,7 +323,7 @@ namespace ScriptCanvas
void ReceiveScriptEvent::OnDeactivate()
{
ScriptEventBase::OnDeactivate();
}
}
const Internal::ScriptEventEntry* ReceiveScriptEvent::FindEventWithSlot(const Slot& slot) const
{
@ -535,7 +535,7 @@ namespace ScriptCanvas
{
AZ::BehaviorContext* behaviorContext = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationBus::Events::GetBehaviorContext);
const auto& ebusIterator = behaviorContext->m_ebuses.find(m_definition.GetName());
if (ebusIterator == behaviorContext->m_ebuses.end())
{

@ -54,11 +54,11 @@ namespace ScriptCanvas
AZStd::optional<size_t> GetEventIndex(AZStd::string eventName) const override;
AZStd::vector<SlotId> GetEventSlotIds() const override;
AZStd::vector<SlotId> GetNonEventSlotIds() const override;
bool IsIDRequired() const;
bool IsEventSlotId(const SlotId& slotId) const;
// NodeVersioning...
bool IsOutOfDate(const VersionData& graphVersion) const override;
UpdateResult OnUpdateNode() override;
@ -122,6 +122,6 @@ namespace ScriptCanvas
bool m_connected;
};
}
}
}
}

@ -59,7 +59,7 @@ namespace ScriptCanvas
if (slot == nullptr)
{
// Handle older versions and improperly updated names
for (auto testUnit : { BaseTimerNode::TimeUnits::Seconds, BaseTimerNode::TimeUnits::Ticks})
for (auto testUnit : { BaseTimerNode::TimeUnits::Seconds, BaseTimerNode::TimeUnits::Ticks })
{
AZStd::string legacyName = BaseTimerNode::s_timeUnitNames[static_cast<int>(testUnit)];

@ -31,7 +31,7 @@ namespace ScriptCanvas
const char* GetTimeSlotFormat() const override { return "Delay (%s)"; }
const char* GetBaseTimeSlotName() const override { return "Interval"; }
const char* GetBaseTimeSlotToolTip() const override { return "The Interval between repetitions"; }
protected:
int m_repetionCount;
};

@ -21,7 +21,7 @@ namespace ScriptCanvas
{
namespace Internal
{
void ScriptEventEntry::Reflect(AZ::ReflectContext* context)
void ScriptEventEntry::Reflect(AZ::ReflectContext* context)
{
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
{
@ -154,7 +154,7 @@ namespace ScriptCanvas
}
m_definition = definition;
}
}
void ScriptEventBase::OnDeactivate()
{

@ -106,7 +106,7 @@ namespace ScriptCanvas
AZStd::pair<AZ::Data::Asset<ScriptEvents::ScriptEventsAsset>, bool> IsAssetOutOfDate() const;
virtual void Initialize(const AZ::Data::AssetId assetId);
virtual void Initialize(const AZ::Data::AssetId assetId);
protected:

@ -208,7 +208,7 @@ namespace ScriptCanvas
asset.BlockUntilLoadComplete();
const ScriptEvents::ScriptEvent& definition = asset.Get()->m_definition;
// If no name has been serialized, this is a new node, so initialize it to the Script Event's definition values.
if (m_busId == ScriptCanvas::EBusBusId())
{
@ -232,7 +232,7 @@ namespace ScriptCanvas
}
NamespacePath emptyNamespacePath;
ScriptEvents::ScriptEventBus::BroadcastResult(m_scriptEvent, &ScriptEvents::ScriptEventRequests::RegisterScriptEvent, assetId, m_version);
AZ::BehaviorMethod* method{};
@ -299,9 +299,9 @@ namespace ScriptCanvas
ScriptEvents::Method scriptEventMethod;
definition.FindMethod(method->m_name, scriptEventMethod);
size_t argIndex = 0;
// Address slot (BusId)
if (method->HasBusId())
{
@ -397,7 +397,7 @@ namespace ScriptCanvas
{
return true;
}
RegisterScriptEvent(asset);
if (asset && asset.IsReady())
@ -428,7 +428,7 @@ namespace ScriptCanvas
{
ConfigureMethod(*method);
InitializeResultSlotId();
return true;
}
}
@ -528,7 +528,7 @@ namespace ScriptCanvas
if (m_scriptEvent == nullptr)
{
return false;
}
}
m_ebus = m_scriptEvent->GetBehaviorBus();

@ -61,13 +61,13 @@ namespace ScriptCanvas
PropertyFields GetPropertyFields() const override;
// Translation
//////////////////////////////////////////////////////////////////////////
protected:
void OnInit() override;
void OnPostActivate() override;
void OnPostActivate() override;
void AddSlots();
void RemoveSlots();
void AddPropertySlots(const Data::Type& type);

@ -42,7 +42,7 @@ namespace ScriptCanvas
void ConfigureSlots() override;
SlotId GetOutputSlotId() const;
SlotId GetOutputSlotId() const;
};
class UnaryExpression : public UnaryOperator
@ -56,7 +56,7 @@ namespace ScriptCanvas
void ConfigureSlots() override;
virtual void InitializeUnaryExpression();
virtual void InitializeUnaryExpression();
};
}
}

@ -62,7 +62,7 @@ namespace ScriptCanvas
const AZ::TypeId nodeFunctionGenericMultiReturnTemplateTypeId("{DC5B1799-6C5B-4190-8D90-EF0C2D1BCE4E}");
const AZ::TypeId oldEntityIdIsValidFuncSignatureTypeId = azrtti_typeid<bool(*)(AZ::EntityId)>();
const AZ::TypeId oldEntityIdIsValidTypeId("{7CEC53AE-E12B-4738-B542-4587B8B95DC2}");
// Aggregate NodeFunctionGenericMultiReturn<bool(*)(AZ::EntityId), OldIsValidTraits> typeid
// NOTE: Aggregation order addition is not commutative and must be in the added last to first: (FirstUuid + ( SecondUuid + (ThirdUuid + ... + (NthUuid))
const AZ::TypeId oldIsValidNodeAggregateTypeId = nodeFunctionGenericMultiReturnTemplateTypeId + (oldEntityIdIsValidFuncSignatureTypeId + oldEntityIdIsValidTypeId);

@ -60,7 +60,7 @@ namespace ScriptCanvas
virtual ~LibraryDefinition() = default;
static const NodeRegistry::NodeList GetNodes(const AZ::Uuid& libraryType)
{
{
NodeRegistry& registry = (*GetNodeRegistry());
const auto& libraryIterator = registry.m_nodeMap.find(libraryType);
if (libraryIterator != registry.m_nodeMap.end())

@ -28,7 +28,7 @@ namespace ScriptCanvas
return AZ::Success(DependencyReport{});
}
bool Any::IsNoOp() const
bool Any::IsNoOp() const
{
return true;
}

@ -30,7 +30,7 @@ namespace ScriptCanvas
Current
};
public:
SCRIPTCANVAS_NODE(Any);
@ -52,10 +52,10 @@ namespace ScriptCanvas
////
/// Translation
bool IsNoOp() const override;
bool IsNoOp() const override;
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
protected:
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot*) const override
{

@ -27,11 +27,11 @@ namespace ScriptCanvas
SCRIPTCANVAS_NODE(Break);
Break() = default;
Break() = default;
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
};
}

@ -54,7 +54,7 @@ namespace ScriptCanvas
void FixupStateNames();
int m_numOutputs;
size_t m_executionSlot;
AZStd::vector< SlotId > m_orderedOutputSlots;

@ -32,7 +32,7 @@ namespace ScriptCanvas
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
bool IsIfBranch() const override { return true; }
bool IsIfBranch() const override { return true; }
protected:
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override

@ -39,7 +39,7 @@ namespace ScriptCanvas
{
{
auto func = []() { return aznew IsReferenceTypeContract(); };
ContractDescriptor descriptor{ AZStd::move(func) };
ContractDescriptor descriptor{ AZStd::move(func) };
DynamicDataSlotConfiguration slotConfiguration;

@ -53,7 +53,7 @@ namespace ScriptCanvas
AddNodeToRegistry<Logic, Once>(nodeRegistry);
AddNodeToRegistry<Logic, Or>(nodeRegistry);
AddNodeToRegistry<Logic, OrderedSequencer>(nodeRegistry);
AddNodeToRegistry<Logic, Sequencer>(nodeRegistry);
AddNodeToRegistry<Logic, Sequencer>(nodeRegistry);
AddNodeToRegistry<Logic, TargetedSequencer>(nodeRegistry);
AddNodeToRegistry<Logic, WeightedRandomSequencer>(nodeRegistry);
AddNodeToRegistry<Logic, While>(nodeRegistry);
@ -78,7 +78,7 @@ namespace ScriptCanvas
ScriptCanvas::Nodes::Logic::TargetedSequencer::CreateDescriptor(),
ScriptCanvas::Nodes::Logic::WeightedRandomSequencer::CreateDescriptor(),
ScriptCanvas::Nodes::Logic::While::CreateDescriptor(),
});
});
}
}
}

@ -63,7 +63,7 @@ namespace ScriptCanvas
}
// Translation
//////////////////////////////////////////////////////////////////////////
};
};
}
}

@ -29,7 +29,7 @@ namespace ScriptCanvas
Once();
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
protected:

@ -18,7 +18,7 @@ namespace ScriptCanvas
OrderedSequencer::OrderedSequencer()
: Node()
, m_numOutputs(0)
{
{
}
AZ::Outcome<DependencyReport, void> OrderedSequencer::GetDependencies() const
@ -67,15 +67,15 @@ namespace ScriptCanvas
visualExtensions.m_connectionType = ConnectionType::Output;
visualExtensions.m_identifier = AZ::Crc32("AddOutputGroup");
visualExtensions.m_displayGroup = GetDisplayGroup();
RegisterExtension(visualExtensions);
}
}
bool OrderedSequencer::CanDeleteSlot(const SlotId& slotId) const
{
Slot* slot = GetSlot(slotId);
Slot* slot = GetSlot(slotId);
// Only remove execution out slots when we have more then 1 output slot.
if (slot && slot->IsExecution() && slot->IsOutput())
{
@ -88,17 +88,17 @@ namespace ScriptCanvas
SlotId OrderedSequencer::HandleExtension([[maybe_unused]] AZ::Crc32 extensionId)
{
ExecutionSlotConfiguration executionConfiguration(GenerateOutputName(m_numOutputs), ConnectionType::Output);
executionConfiguration.m_addUniqueSlotByNameAndType = false;
executionConfiguration.m_displayGroup = GetDisplayGroup();
++m_numOutputs;
return AddSlot(executionConfiguration);
}
void OrderedSequencer::OnSlotRemoved([[maybe_unused]] const SlotId& slotId)
{
{
FixupStateNames();
}
@ -107,12 +107,12 @@ namespace ScriptCanvas
AZStd::string slotName = AZStd::string::format("Out %i", counter);
return AZStd::move(slotName);
}
void OrderedSequencer::FixupStateNames()
{
auto outputSlots = GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut());
m_numOutputs = static_cast<int>(outputSlots.size());
for (int i = 0; i < outputSlots.size(); ++i)
{
Slot* slot = GetSlot(outputSlots[i]->GetId());
@ -122,7 +122,7 @@ namespace ScriptCanvas
slot->Rename(GenerateOutputName(i));
}
}
}
}
}
}
}

@ -22,7 +22,7 @@ namespace ScriptCanvas
class OrderedSequencer
: public Node
{
public:
SCRIPTCANVAS_NODE(OrderedSequencer);
@ -43,10 +43,10 @@ namespace ScriptCanvas
void ConfigureVisualExtensions() override;
protected:
AZStd::string GetDisplayGroup() const { return "OutputGroup"; }
protected:
@ -57,11 +57,11 @@ namespace ScriptCanvas
AZStd::string GenerateOutputName(int counter) const;
void FixupStateNames();
int m_numOutputs;
AZStd::vector< SlotId > m_orderedOutputSlots;
};
}
}
}
}

@ -29,7 +29,7 @@ namespace ScriptCanvas
{
auto inSlot = SequencerProperty::GetInSlot(this);
auto nextSlot = SequencerProperty::GetNextSlot(this);
if (inSlot && inSlot->IsConnected())
{
// Replace by TargetedSequencer

@ -18,9 +18,9 @@ namespace ScriptCanvas
TargetedSequencer::TargetedSequencer()
: Node()
, m_numOutputs(0)
{
{
}
void TargetedSequencer::OnInit()
{
m_numOutputs = static_cast<int>(GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut()).size());
@ -45,11 +45,11 @@ namespace ScriptCanvas
RegisterExtension(visualExtensions);
}
}
bool TargetedSequencer::CanDeleteSlot(const SlotId& slotId) const
{
Slot* slot = GetSlot(slotId);
Slot* slot = GetSlot(slotId);
// Only remove execution out slots when we have more then 1 output slot.
if (slot && slot->IsExecution() && slot->IsOutput())
{
@ -62,17 +62,17 @@ namespace ScriptCanvas
SlotId TargetedSequencer::HandleExtension([[maybe_unused]] AZ::Crc32 extensionId)
{
ExecutionSlotConfiguration executionConfiguration(GenerateOutputName(m_numOutputs), ConnectionType::Output);
executionConfiguration.m_addUniqueSlotByNameAndType = false;
executionConfiguration.m_displayGroup = GetDisplayGroup();
++m_numOutputs;
return AddSlot(executionConfiguration);
}
void TargetedSequencer::OnSlotRemoved([[maybe_unused]] const SlotId& slotId)
{
{
FixupStateNames();
}
@ -81,12 +81,12 @@ namespace ScriptCanvas
AZStd::string slotName = AZStd::string::format("Out %i", counter);
return AZStd::move(slotName);
}
void TargetedSequencer::FixupStateNames()
{
auto outputSlots = GetAllSlotsByDescriptor(SlotDescriptors::ExecutionOut());
m_numOutputs = static_cast<int>(outputSlots.size());
for (int i = 0; i < outputSlots.size(); ++i)
{
Slot* slot = GetSlot(outputSlots[i]->GetId());
@ -96,7 +96,7 @@ namespace ScriptCanvas
slot->Rename(GenerateOutputName(i));
}
}
}
}
}
}
}

@ -31,10 +31,10 @@ namespace ScriptCanvas
void OnInit() override;
void OnConfigured() override;
void ConfigureVisualExtensions() override;
bool CanDeleteSlot(const SlotId& slotId) const;
SlotId HandleExtension(AZ::Crc32 extensionId);
SlotId HandleExtension(AZ::Crc32 extensionId);
// Script Canvas Translation...
bool IsSwitchStatement() const override { return true; }
@ -51,7 +51,7 @@ namespace ScriptCanvas
//////////////////////////////////////////////////////////////////////////
protected:
AZStd::string GetDisplayGroup() const { return "OutputGroup"; }
void OnSlotRemoved(const SlotId& slotId) override;
@ -60,7 +60,7 @@ namespace ScriptCanvas
AZStd::string GenerateOutputName(int counter);
void FixupStateNames();
int m_numOutputs;
};
}

@ -30,7 +30,7 @@ namespace ScriptCanvas
return AZ::Success(DependencyReport());
}
ConstSlotsOutcome WeightedRandomSequencer::GetSlotsInExecutionThreadByTypeImpl(const Slot& , CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const
ConstSlotsOutcome WeightedRandomSequencer::GetSlotsInExecutionThreadByTypeImpl(const Slot&, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const
{
return AZ::Success(GetSlotsByType(targetSlotType));
}
@ -45,7 +45,7 @@ namespace ScriptCanvas
->Version(1)
->Field("WeightSlotId", &WeightedPairing::m_weightSlotId)
->Field("ExecutionSlotId", &WeightedPairing::m_executionSlotId)
;
;
}
}
}
@ -57,7 +57,7 @@ namespace ScriptCanvas
EndpointNotificationBus::MultiHandler::BusConnect({ GetEntityId(), weightedPairing.m_weightSlotId });
EndpointNotificationBus::MultiHandler::BusConnect({ GetEntityId(), weightedPairing.m_executionSlotId });
}
// We always want at least one weighted transition state
if (m_weightedPairings.empty())
{
@ -130,7 +130,7 @@ namespace ScriptCanvas
return isValid;
}
SlotId WeightedRandomSequencer::HandleExtension(AZ::Crc32 extensionId)
{
auto weightedPairing = AddWeightedPair();
@ -162,9 +162,9 @@ namespace ScriptCanvas
{
for (auto pairIter = m_weightedPairings.begin(); pairIter != m_weightedPairings.end(); ++pairIter)
{
if (pairIter->m_executionSlotId == slotId
|| pairIter->m_weightSlotId == slotId)
|| pairIter->m_weightSlotId == slotId)
{
SlotId executionSlot = pairIter->m_executionSlotId;
SlotId weightSlot = pairIter->m_weightSlotId;
@ -178,15 +178,15 @@ namespace ScriptCanvas
else if (slotId == weightSlot)
{
RemoveSlot(executionSlot);
}
}
break;
}
}
FixupStateNames();
}
bool WeightedRandomSequencer::AllWeightsFilled() const
{
bool isFilled = true;
@ -197,7 +197,7 @@ namespace ScriptCanvas
isFilled = false;
break;
}
}
}
return isFilled;
}
@ -225,15 +225,15 @@ namespace ScriptCanvas
return hasExcess;
}
WeightedRandomSequencer::WeightedPairing WeightedRandomSequencer::AddWeightedPair()
{
int counterWeight = static_cast<int>(m_weightedPairings.size()) + 1;
WeightedPairing weightedPairing;
WeightedPairing weightedPairing;
DataSlotConfiguration dataSlotConfiguration;
dataSlotConfiguration.SetConnectionType(ConnectionType::Input);
dataSlotConfiguration.m_name = GenerateDataName(counterWeight);
dataSlotConfiguration.m_toolTip = "The weight associated with the execution state.";
@ -242,24 +242,24 @@ namespace ScriptCanvas
dataSlotConfiguration.SetDefaultValue(1.0f);
dataSlotConfiguration.m_displayGroup = GetDisplayGroup();
weightedPairing.m_weightSlotId = AddSlot(dataSlotConfiguration);
ExecutionSlotConfiguration slotConfiguration;
slotConfiguration.m_name = GenerateOutName(counterWeight);
slotConfiguration.m_addUniqueSlotByNameAndType = false;
slotConfiguration.SetConnectionType(ConnectionType::Output);
slotConfiguration.m_displayGroup = GetDisplayGroup();
weightedPairing.m_executionSlotId = AddSlot(slotConfiguration);
weightedPairing.m_executionSlotId = AddSlot(slotConfiguration);
m_weightedPairings.push_back(weightedPairing);
return weightedPairing;
}
void WeightedRandomSequencer::FixupStateNames()
{
int counter = 1;
@ -267,30 +267,30 @@ namespace ScriptCanvas
{
AZStd::string dataName = GenerateDataName(counter);
AZStd::string executionName = GenerateOutName(counter);
Slot* dataSlot = GetSlot(weightedPairing.m_weightSlotId);
if (dataSlot)
{
dataSlot->Rename(dataName);
}
Slot* executionSlot = GetSlot(weightedPairing.m_executionSlotId);
if (executionSlot)
{
executionSlot->Rename(executionName);
}
++counter;
}
}
AZStd::string WeightedRandomSequencer::GenerateDataName(int counter)
{
return AZStd::string::format("Weight %i", counter);
}
AZStd::string WeightedRandomSequencer::GenerateOutName(int counter)
{
return AZStd::string::format("Out %i", counter);

@ -26,10 +26,10 @@ namespace ScriptCanvas
SCRIPTCANVAS_NODE(WeightedRandomSequencer);
static void ReflectDataTypes(AZ::ReflectContext* reflectContext);
WeightedRandomSequencer() = default;
~WeightedRandomSequencer() = default;
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override;
@ -39,20 +39,20 @@ namespace ScriptCanvas
void ConfigureVisualExtensions() override;
bool OnValidateNode(ValidationResults& validationResults);
SlotId HandleExtension(AZ::Crc32 extensionId) override;
SlotId HandleExtension(AZ::Crc32 extensionId) override;
bool CanDeleteSlot(const SlotId& slotId) const override;
void OnSlotRemoved(const SlotId& slotId) override;
////
protected:
AZ::Crc32 GetWeightExtensionId() const { return AZ_CRC("WRS_Weight_Extension", 0xd17b9467); }
AZ::Crc32 GetExecutionExtensionId() const { return AZ_CRC("WRS_Execution_Extension", 0x0706035e); }
AZStd::string GetDisplayGroup() const { return "WeightedExecutionGroup"; }
AZStd::string GetDisplayGroup() const { return "WeightedExecutionGroup"; }
private:
struct WeightedPairing
@ -68,22 +68,22 @@ namespace ScriptCanvas
int m_totalWeight;
SlotId m_executionSlotId;
};
void RemoveWeightedPair(SlotId slotId);
bool AllWeightsFilled() const;
bool HasExcessEndpoints() const;
WeightedPairing AddWeightedPair();
void FixupStateNames();
AZStd::string GenerateDataName(int counter);
AZStd::string GenerateOutName(int counter);
AZStd::string GenerateOutName(int counter);
using WeightedPairingList = AZStd::vector<WeightedPairing>;
WeightedPairingList m_weightedPairings;
};
}
}
}
}

@ -19,7 +19,7 @@ namespace ScriptCanvas
{
return AZ::Success(DependencyReport{});
}
SlotId While::GetLoopFinishSlotId() const
{
return WhileProperty::GetOutSlotId(const_cast<While*>(this));
@ -31,8 +31,8 @@ namespace ScriptCanvas
}
bool While::IsFormalLoop() const
{
return true;
{
return true;
}
}
}

@ -29,11 +29,11 @@ namespace ScriptCanvas
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
SlotId GetLoopFinishSlotId() const override;
SlotId GetLoopSlotId() const override;
bool IsFormalLoop() const override;
bool IsFormalLoop() const override;
protected:
ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& /*executionSlot*/, CombinedSlotType targetSlotType, const Slot* /*executionChildSlot*/) const override
{

@ -79,7 +79,7 @@ namespace ScriptCanvas
void Math::InitNodeRegistry(NodeRegistry& nodeRegistry)
{
using namespace ScriptCanvas::Nodes::Math;
AddNodeToRegistry<Math, Divide>(nodeRegistry);
AddNodeToRegistry<Math, MathExpression>(nodeRegistry);
AddNodeToRegistry<Math, Multiply>(nodeRegistry);
@ -101,7 +101,7 @@ namespace ScriptCanvas
Vector3Nodes::Registrar::AddToRegistry<Math>(nodeRegistry);
Vector4Nodes::Registrar::AddToRegistry<Math>(nodeRegistry);
}
AZStd::vector<AZ::ComponentDescriptor*> Math::GetComponentDescriptors()
{
AZStd::vector<AZ::ComponentDescriptor*> descriptors = {

@ -42,5 +42,5 @@ namespace ScriptCanvas
StringToNumberNode
>;
}
}
}

@ -58,7 +58,7 @@ namespace ScriptCanvas
AZ_Assert(randomEngineVar.IsConstructed(), "random engine is not initialized");
return dis(randomEngineVar->m_randomEngine);
}
AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs)
{
if (lhs == rhs)
@ -74,5 +74,5 @@ namespace ScriptCanvas
}
}
}
}

@ -24,11 +24,11 @@ namespace ScriptCanvas
template<int t_Index>
AZ_INLINE void DefaultToleranceEpsilon(Node& node) { SetDefaultValuesByIndex<t_Index>::_(node, Data::ToleranceEpsilon()); }
Data::NumberType GetRandom(Data::NumberType lhs, Data::NumberType rhs);
AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs);
AZ::s64 GetRandom(AZ::s64 lhs, AZ::s64 rhs);
template<typename NumberType>
AZ_INLINE NumberType GetRandomIntegral(NumberType lhs, NumberType rhs)
{
@ -56,5 +56,5 @@ namespace ScriptCanvas
void RandomEngineInit();
void RandomEngineReset();
}
}
}

@ -26,9 +26,9 @@ namespace ScriptCanvas
AZ_INLINE Data::ColorType RandomColor(Data::ColorType minValue, Data::ColorType maxValue)
{
return Data::ColorType(MathNodeUtilities::GetRandomReal<float>(minValue.GetR(), maxValue.GetR()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetG(), maxValue.GetG()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetB(), maxValue.GetB()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetA(), maxValue.GetA()));
MathNodeUtilities::GetRandomReal<float>(minValue.GetG(), maxValue.GetG()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetB(), maxValue.GetB()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetA(), maxValue.GetA()));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomColor, SetRandomColorDefaults, k_categoryName, "{0A984F40-322B-44A6-8753-6D2056A96659}", "Returns a random color [Min, Max]", "Min", "Max");
@ -81,8 +81,8 @@ namespace ScriptCanvas
{
Data::Vector3Type halfDimensions = 0.5f * dimensions;
Data::Vector3Type point(MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetX(), halfDimensions.GetX()),
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetY(), halfDimensions.GetY()),
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetZ(), halfDimensions.GetZ()));
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetY(), halfDimensions.GetY()),
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetZ(), halfDimensions.GetZ()));
return point;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInBox, SetRandomPointInBoxDefaults, k_categoryName, "{6785C5F8-2F87-4AD6-AE15-87FE5E72D142}", "returns a random point in a box", "Dimensions");
@ -99,8 +99,8 @@ namespace ScriptCanvas
float theta = MathNodeUtilities::GetRandomReal<float>(0.f, AZ::Constants::TwoPi - std::numeric_limits<float>::epsilon());
Data::Vector3Type point(fRadius * cosf(theta),
fRadius * sinf(theta),
0.f);
fRadius * sinf(theta),
0.f);
return point;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointOnCircle, SetRandomPointOnCircleDefaults, k_categoryName, "{2F079E35-216D-42B3-AA81-C9823F732893}", "returns a random point on the circumference of a circle", "Radius");
@ -150,8 +150,8 @@ namespace ScriptCanvas
float theta = MathNodeUtilities::GetRandomReal<float>(0.f, AZ::Constants::TwoPi - std::numeric_limits<float>::epsilon());
Data::Vector3Type point(r * cosf(theta),
r * sinf(theta),
MathNodeUtilities::GetRandomReal<float>(fNegHalfHeight, fHalfHeight));
r * sinf(theta),
MathNodeUtilities::GetRandomReal<float>(fNegHalfHeight, fHalfHeight));
return point;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInCylinder, SetRandomPointInCylinderDefaults, k_categoryName, "{BD81133C-AAC0-44B0-9C9A-D06E780F4CCE}", "returns a random point in a cylinder", "Radius", "Height");
@ -168,8 +168,8 @@ namespace ScriptCanvas
float theta = MathNodeUtilities::GetRandomReal<float>(0.f, AZ::Constants::TwoPi - std::numeric_limits<float>::epsilon());
Data::Vector3Type point(r * cosf(theta),
r * sinf(theta),
0.f);
r * sinf(theta),
0.f);
return point;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInCircle, SetRandomPointInCircleDefaults, k_categoryName, "{93378981-85DD-42B9-9D2D-826BE68BBE8F}", "returns a random point inside the area of a circle", "Radius");
@ -234,8 +234,8 @@ namespace ScriptCanvas
{
Data::Vector2Type halfDimensions = 0.5f * dimensions;
Data::Vector3Type point(MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetX(), halfDimensions.GetX()),
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetY(), halfDimensions.GetY()),
0.f);
MathNodeUtilities::GetRandomReal<float>(-halfDimensions.GetY(), halfDimensions.GetY()),
0.f);
return point;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInSquare, SetRandomPointInSquareDefaults, k_categoryName, "{B81B4049-CBD2-460E-A4AB-155AB8FFDCB9}", "returns a random point in a square", "Dimensions");
@ -295,7 +295,7 @@ namespace ScriptCanvas
{
float theta = MathNodeUtilities::GetRandomReal<float>(0.f, AZ::Constants::TwoPi - std::numeric_limits<float>::epsilon());
return Data::Vector2Type(cosf(theta),
sinf(theta));
sinf(theta));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RandomUnitVector2, k_categoryName, "{02CE950A-06F8-485D-87E9-77FDE808B160}", "returns a random Vector2 direction");
@ -324,7 +324,7 @@ namespace ScriptCanvas
AZ_INLINE Data::Vector2Type RandomVector2(Data::Vector2Type minValue, Data::Vector2Type maxValue)
{
return Data::Vector2Type(MathNodeUtilities::GetRandomReal<float>(minValue.GetX(), maxValue.GetX()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()));
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector2, SetRandomVector2Defaults, k_categoryName, "{6F9982F5-D6F6-4568-8A83-D5A35390D425}", "returns a random Vector2", "Min", "Max");
@ -337,8 +337,8 @@ namespace ScriptCanvas
AZ_INLINE Data::Vector3Type RandomVector3(Data::Vector3Type minValue, Data::Vector3Type maxValue)
{
return Data::Vector3Type(MathNodeUtilities::GetRandomReal<float>(minValue.GetX(), maxValue.GetX()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetZ(), maxValue.GetZ()));
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetZ(), maxValue.GetZ()));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector3, SetRandomVector3Defaults, k_categoryName, "{FF5526DC-E56D-4101-B7DE-4E7283E31B10}", "returns a random Vector3", "Min", "Max");
@ -351,15 +351,15 @@ namespace ScriptCanvas
AZ_INLINE Data::Vector4Type RandomVector4(Data::Vector4Type minValue, Data::Vector4Type maxValue)
{
return Data::Vector4Type(MathNodeUtilities::GetRandomReal<float>(minValue.GetX(), maxValue.GetX()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetZ(), maxValue.GetZ()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetW(), maxValue.GetW()));
MathNodeUtilities::GetRandomReal<float>(minValue.GetY(), maxValue.GetY()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetZ(), maxValue.GetZ()),
MathNodeUtilities::GetRandomReal<float>(minValue.GetW(), maxValue.GetW()));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomVector4, SetRandomVector4Defaults, k_categoryName, "{76FCA9CF-7BBF-471C-9D4A-67FE8E9C6298}", "returns a random Vector4", "Min", "Max");
AZ_INLINE void SetRandomPointInArcDefaults(Node& node)
{
SetDefaultValuesByIndex<0>::_(node, Data::Vector3Type(0.f,0.f,0.f));
SetDefaultValuesByIndex<0>::_(node, Data::Vector3Type(0.f, 0.f, 0.f));
SetDefaultValuesByIndex<1>::_(node, Data::Vector3Type(1.f, 0.f, 0.f));
SetDefaultValuesByIndex<2>::_(node, Data::Vector3Type(0.f, 0.f, 1.f));
SetDefaultValuesByIndex<3>::_(node, Data::NumberType(1.0));
@ -405,7 +405,7 @@ namespace ScriptCanvas
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_WITH_DEFAULTS(RandomPointInWedge, SetRandomPointInWedgeDefaults, k_categoryName, "{F224DA37-240D-4ABB-A97A-3565197B94B4}", "returns a random point in the specified wedge", "Origin", "Direction", "Normal", "Radius", "Height", "Angle");
using Registrar = RegistrarGeneric<
using Registrar = RegistrarGeneric <
RandomColorNode
, RandomGrayscaleNode
, RandomIntegerNode
@ -427,6 +427,6 @@ namespace ScriptCanvas
, RandomVector4Node
, RandomPointInArcNode
, RandomPointInWedgeNode
>;
> ;
}
}
}

@ -20,7 +20,7 @@ namespace ScriptCanvas
using namespace Data;
using namespace MathNodeUtilities;
static const char* k_categoryName = "Math/Quaternion";
AZ_INLINE QuaternionType Add(QuaternionType a, QuaternionType b)
{
return a + b;
@ -106,7 +106,7 @@ namespace ScriptCanvas
return QuaternionType::CreateFromVector3AndValue(imaginary, aznumeric_cast<float>(real));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromVector3AndValue, k_categoryName, "{955FE6EB-7C38-4587-BBB7-9C886ACEAF94}", "returns a rotation with the imaginary elements from Imaginary and the real element from Real", "Imaginary", "Real");
AZ_INLINE NumberType GetElement(QuaternionType source, NumberType index)
{
return source.GetElement(AZ::GetClamp(aznumeric_cast<int>(index), 0, 3));
@ -172,7 +172,7 @@ namespace ScriptCanvas
return a.Lerp(b, aznumeric_cast<float>(t));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Lerp, k_categoryName, "{91CF1C54-89C6-4A00-A53D-20C58454C4EC}", "returns a the linear interpolation between From and To by the amount T", "From", "To", "T");
AZ_INLINE QuaternionType ModX(QuaternionType source, NumberType value)
{
source.SetX(aznumeric_cast<float>(value));
@ -228,7 +228,7 @@ namespace ScriptCanvas
AZ_INLINE std::tuple<QuaternionType, NumberType> NormalizeWithLength(QuaternionType source)
{
const float length = source.NormalizeWithLength();
return std::make_tuple( source, length );
return std::make_tuple(source, length);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(NormalizeWithLength, k_categoryName, "{E1A7F3F8-854E-4BA1-9DEA-7507BEC6D369}", "returns the normalized version of Source, and the length of Source", "Source", "Normalized", "Length");
@ -249,7 +249,7 @@ namespace ScriptCanvas
return QuaternionType::CreateRotationZ(AZ::DegToRad(aznumeric_caster(degrees)));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RotationZDegrees, k_categoryName, "{8BC8B0FE-51A1-4ECC-AFF1-A828A0FC8F8F}", "creates a rotation of Degrees around the z-axis", "Degrees");
AZ_INLINE QuaternionType ShortestArc(Vector3Type from, Vector3Type to)
{
return QuaternionType::CreateShortestArc(from, to);
@ -279,7 +279,7 @@ namespace ScriptCanvas
return aznumeric_caster(AZ::RadToDeg(source.GetAngle()));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToAngleDegrees, k_categoryName, "{3EA78793-9AFA-4857-8CB8-CD0D47E97D25}", "returns the angle of angle-axis pair that Source represents in degrees", "Source");
AZ_INLINE Vector3Type ToImaginary(QuaternionType source)
{
return source.GetImaginary();
@ -301,7 +301,7 @@ namespace ScriptCanvas
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RotateVector3, k_categoryName, "{DDF7C05C-7148-4860-93A3-D507C5896B6C}", "Returns a new Vector3 that is the source vector3 rotated by the given Quaternion", "Quaternion", "Vector");
using Registrar = RegistrarGeneric<
using Registrar = RegistrarGeneric <
AddNode
, ConjugateNode
, ConvertTransformToRotationNode
@ -369,5 +369,5 @@ namespace ScriptCanvas
> ;
}
}
}

@ -24,7 +24,7 @@ namespace ScriptCanvas
AZ_COMPONENT(Sum, "{6C52B2D1-3526-4855-A217-5106D54F6B90}", ArithmeticExpression);
static void Reflect(AZ::ReflectContext* reflection)
{
{
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection))
{
serializeContext->Class<Sum, ArithmeticExpression>()

@ -24,7 +24,7 @@ namespace ScriptCanvas
AZ_INLINE std::tuple<NumberType, TransformType> ExtractUniformScale(TransformType source)
{
auto scale(source.ExtractUniformScale());
return std::make_tuple( scale, source );
return std::make_tuple(scale, source);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(ExtractUniformScale, k_categoryName, "{8DFE5247-0950-4CD1-87E6-0CAAD42F1637}", "returns the uniform scale as a float, and a transform with the scale extracted ", "Source", "Uniform Scale", "Extracted");
@ -114,7 +114,7 @@ namespace ScriptCanvas
return source.IsFinite();
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(IsFinite, k_categoryName, "{B7D23934-0101-40B9-80E8-3D88C8580B25}", "returns true if every row of source is finite, else false", "Source");
AZ_INLINE BooleanType IsOrthogonal(const TransformType& source, NumberType tolerance)
{
return source.IsOrthogonal(aznumeric_cast<float>(tolerance));
@ -139,7 +139,7 @@ namespace ScriptCanvas
return source.TransformVector(multiplier);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Multiply3x3ByVector3, k_categoryName, "{4F2ABFC6-2E93-4A9D-8639-C7967DB318DB}", "returns Source's 3x3 upper matrix post multiplied by Multiplier", "Source", "Multiplier");
AZ_INLINE TransformType MultiplyByUniformScale(TransformType source, NumberType scale)
{
source.MultiplyByUniformScale(scale);
@ -170,7 +170,7 @@ namespace ScriptCanvas
return source.GetOrthogonalized();
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Orthogonalize, k_categoryName, "{2B4140CD-6E22-44D3-BDB5-309E69FE7CC2}", "returns an orthogonal matrix if the Source is almost orthogonal", "Source");
AZ_INLINE TransformType RotationXDegrees(NumberType degrees)
{
return TransformType::CreateRotationX(AZ::DegToRad(aznumeric_caster(degrees)));
@ -194,13 +194,13 @@ namespace ScriptCanvas
return source.GetUniformScale();
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToScale, k_categoryName, "{063C58AD-F567-464D-A432-F298FE3953A6}", "returns the uniform scale of the Source", "Source");
using Registrar = RegistrarGeneric
<
<
#if ENABLE_EXTENDED_MATH_SUPPORT
ExtractUniformScaleNode ,
ExtractUniformScaleNode,
#endif
FromMatrix3x3AndTranslationNode
FromMatrix3x3AndTranslationNode
, FromMatrix3x3Node
, FromRotationAndTranslationNode
, FromRotationNode
@ -245,8 +245,8 @@ namespace ScriptCanvas
, TransposedMultiply3x3Node
, ZeroNode
#endif
>;
> ;
}
}
}

@ -165,7 +165,7 @@ namespace ScriptCanvas
return a.GetMin(b);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Min, k_categoryName, "{815685B8-B877-4D54-9E11-D0161185B4B9}", "returns the vector (min(A.x, B.x), min(A.y, B.y))", "A", "B");
AZ_INLINE Vector2Type SetX(Vector2Type source, NumberType value)
{
source.SetX(aznumeric_caster(value));
@ -242,7 +242,7 @@ namespace ScriptCanvas
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToPerpendicular, k_categoryName, "{CC4DC102-8B50-4828-BA94-0586F34E0D37}", "returns the vector (-Source.y, Source.x), a 90 degree, positive rotation", "Source");
using Registrar = RegistrarGeneric<
using Registrar = RegistrarGeneric <
AbsoluteNode
, AddNode
, AngleNode
@ -294,8 +294,8 @@ namespace ScriptCanvas
, SlerpNode
, SubtractNode
, ToPerpendicularNode
>;
> ;
}
}
}

@ -33,14 +33,14 @@ namespace ScriptCanvas
return lhs + rhs;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Add, k_categoryName, "{0F554E23-9AB6-4D17-A517-C885ECD024F0}", "This node is deprecated, use Add (+), it provides contextual type and slots", "A", "B");
AZ_INLINE Vector3Type AngleMod(const Vector3Type source)
{
return source.GetAngleMod();
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(AngleMod, k_categoryName, "{BF5C12A8-F42D-43E7-9CE3-D16D30B182D2}", "wraps the angle in each element into the range [-pi, pi]", "Source")
AZ_INLINE std::tuple<Vector3Type, Vector3Type> BuildTangentBasis(Vector3Type source)
AZ_INLINE std::tuple<Vector3Type, Vector3Type> BuildTangentBasis(Vector3Type source)
{
std::tuple<Vector3Type, Vector3Type> tangentBitangent;
source.NormalizeSafe();
@ -48,13 +48,13 @@ namespace ScriptCanvas
return tangentBitangent;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(BuildTangentBasis, k_categoryName, "{3EBA365F-063A-45A0-BDD1-ED0F995AD310}", "returns a tangent basis from the normal", "Normal", "Tangent", "Bitangent");
AZ_INLINE Vector3Type Clamp(const Vector3Type source, const Vector3Type min, const Vector3Type max)
{
return source.GetClamp(min, max);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Clamp, k_categoryName, "{28305F88-0940-43C8-B0A8-B8CEB3B0B82A}", "returns vector clamped to [min, max] and equal to source if possible", "Source", "Min", "Max");
AZ_INLINE Vector3Type Cosine(const Vector3Type source)
{
return source.GetCos();
@ -66,7 +66,7 @@ namespace ScriptCanvas
return lhs.Cross(rhs);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Cross, k_categoryName, "{6FAF4ACA-A100-4B71-ACF8-F1DB4674F51C}", "returns the vector cross product of A X B", "A", "B");
AZ_INLINE Vector3Type CrossXAxis(const Vector3Type source)
{
return source.CrossXAxis();
@ -120,7 +120,7 @@ namespace ScriptCanvas
return lhs.Dot(rhs);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Dot, k_categoryName, "{5DFA6260-C044-4798-A55C-3CF5F3DB45CE}", "returns the vector dot product of A dot B", "A", "B");
AZ_INLINE Vector3Type FromElement(Vector3Type source, const NumberType index, const NumberType value)
{
source.SetElement(AZ::GetClamp(aznumeric_cast<int>(index), 0, 2), aznumeric_cast<float>(value));
@ -200,7 +200,7 @@ namespace ScriptCanvas
return from.Lerp(to, aznumeric_cast<float>(t));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Lerp, k_categoryName, "{AA063267-DA0F-4407-9356-30B4E89A9FA4}", "returns the linear interpolation (From + ((To - From) * T)", "From", "To", "T");
AZ_INLINE Vector3Type Max(const Vector3Type a, const Vector3Type b)
{
return a.GetMax(b);
@ -297,7 +297,7 @@ namespace ScriptCanvas
return std::make_tuple(sin, cos);
}
SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(SineCosine, k_categoryName, "{04EE253D-680D-4F95-A451-837EAE104E88}", "returns a vector from the sine of each element from the source, and from the cosine of each element from the source", "Source", "Sine", "Cosine");
AZ_INLINE Vector3Type Slerp(const Vector3Type from, const Vector3Type to, const NumberType t)
{
return from.Slerp(to, aznumeric_cast<float>(t));
@ -328,7 +328,7 @@ namespace ScriptCanvas
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ZAxisCross, k_categoryName, "{29206E84-392C-412E-9DD5-781B2759260D}", "returns the vector cross product of Z-Axis X Source", "Source");
using Registrar = RegistrarGeneric<
using Registrar = RegistrarGeneric <
AbsoluteNode
, AddNode
@ -409,8 +409,8 @@ namespace ScriptCanvas
, ZAxisCrossNode
#endif
>;
> ;
}
}
}

@ -74,13 +74,13 @@ namespace ScriptCanvas
return Vector4Type(aznumeric_cast<float>(x), aznumeric_cast<float>(y), aznumeric_cast<float>(z), aznumeric_cast<float>(w));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromValues, k_categoryName, "{725D79B8-1CB1-4473-8480-4DE584C75540}", "returns a vector from elements", "X", "Y", "Z", "W");
AZ_INLINE Vector4Type FromVector3AndNumber(Vector3Type source, const NumberType w)
{
return Vector4Type::CreateFromVector3AndFloat(source, aznumeric_cast<float>(w));
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromVector3AndNumber, k_categoryName, "{577E2B26-BEC1-4CC7-B23B-5172ED1BFF6E}", "returns a vector with x,y,z from Source and w from W", "Source", "W");
AZ_INLINE NumberType GetElement(const Vector4Type source, const NumberType index)
{
return source.GetElement(AZ::GetClamp(aznumeric_cast<int>(index), 0, 3));
@ -99,7 +99,7 @@ namespace ScriptCanvas
return source;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Homogenize, k_categoryName, "{9A3FAB19-0442-44A5-8454-12003BA146EE}", "returns a vector with all components divided by the w element", "Source");
AZ_INLINE BooleanType IsClose(const Vector4Type a, const Vector4Type b, NumberType tolerance)
{
return a.IsClose(b, aznumeric_cast<float>(tolerance));
@ -212,8 +212,8 @@ namespace ScriptCanvas
return lhs - rhs;
}
SCRIPT_CANVAS_GENERIC_FUNCTION_NODE_DEPRECATED(Subtract, k_categoryName, "{A5FA6465-9C39-4A44-BD7C-E8ECF9503E46}", "This node is deprecated, use Subtract (-), it provides contextual type and slots", "A", "B");
using Registrar = RegistrarGeneric<
using Registrar = RegistrarGeneric <
AbsoluteNode,
AddNode,
DivideByNumberNode,
@ -260,8 +260,8 @@ namespace ScriptCanvas
ReciprocalNode,
SubtractNode
>;
> ;
}
}
}

@ -41,7 +41,7 @@ namespace ScriptCanvas
slotConfiguration.m_toolTip = "The value at the specified index";
slotConfiguration.m_displayGroup = GetSourceDisplayGroup();
slotConfiguration.SetType(type);
slotConfiguration.SetConnectionType(ConnectionType::Output);
slotConfiguration.SetConnectionType(ConnectionType::Output);
m_outputSlots.insert(AddSlot(slotConfiguration));
}

@ -50,7 +50,7 @@ namespace ScriptCanvas
slotConfiguration.m_name = Data::GetName(type);
slotConfiguration.m_displayGroup = GetSourceDisplayGroup();
slotConfiguration.SetType(type);
slotConfiguration.SetConnectionType(ConnectionType::Input);
slotConfiguration.SetConnectionType(ConnectionType::Input);
m_inputSlots.insert(AddSlot(slotConfiguration));
}

@ -66,7 +66,7 @@ namespace ScriptCanvas
AZ::SerializeContext::DataElementNode baseNodeElement = operatorBaseClass->GetSubElement(nodeElementIndex);
classElement.RemoveElementByName(AZ::Crc32("BaseClass1"));
classElement.AddElement(baseNodeElement);
classElement.AddElement(baseNodeElement);
}
return true;

@ -33,7 +33,7 @@ namespace ScriptCanvas
// Node...
void OnInit() override;
////
};
};
}
}
}

@ -45,13 +45,13 @@ namespace ScriptCanvas
Data::ColorType operator()(const Data::ColorType& lhs, const Datum& rhs)
{
const AZ::Color* dataRhs = rhs.GetAs<AZ::Color>();
float a = AZ::GetClamp<float>(lhs.GetA(), 0.f, 1.f) + AZ::GetClamp<float>(dataRhs->GetA(), 0.f, 1.f);
float r = AZ::GetClamp<float>(lhs.GetR(), 0.f, 1.f) + AZ::GetClamp<float>(dataRhs->GetR(), 0.f, 1.f);
float g = AZ::GetClamp<float>(lhs.GetG(), 0.f, 1.f) + AZ::GetClamp<float>(dataRhs->GetG(), 0.f, 1.f);
float b = AZ::GetClamp<float>(lhs.GetB(), 0.f, 1.f) + AZ::GetClamp<float>(dataRhs->GetB(), 0.f, 1.f);
return AZ::Color(r, g, b, a);
return AZ::Color(r, g, b, a);
}
};

@ -73,7 +73,7 @@ namespace ScriptCanvas
{
// Version conversion for previous elements
for (Slot& currentSlot : ModSlots())
{
{
if (currentSlot.IsData())
{
auto& contracts = currentSlot.GetContracts();
@ -89,7 +89,7 @@ namespace ScriptCanvas
contract->SetSupportedOperator(OperatorFunction());
contract->SetSupportedNativeTypes(GetSupportedNativeDataTypes());
}
}
}
}
if (!currentSlot.IsDynamicSlot())
@ -110,17 +110,17 @@ namespace ScriptCanvas
void OperatorArithmetic::OnActivate()
{
if (m_scrapedInputs)
{
{
m_scrapedInputs = false;
m_applicableInputs.clear();
m_result.ReconfigureDatumTo(AZStd::move(ScriptCanvas::Datum()));
m_result.ReconfigureDatumTo(AZStd::move(ScriptCanvas::Datum()));
}
}
void OperatorArithmetic::ConfigureVisualExtensions()
{
{
{
VisualExtensionSlotConfiguration visualExtensions(VisualExtensionSlotConfiguration::VisualExtensionType::ExtenderSlot);
visualExtensions.m_name = "Add Operand";
@ -150,12 +150,12 @@ namespace ScriptCanvas
bool OperatorArithmetic::CanDeleteSlot(const SlotId& slotId) const
{
Slot* slot = GetSlot(slotId);
Slot* slot = GetSlot(slotId);
if (slot && slot->GetDynamicGroup() == GetArithmeticDynamicTypeGroup())
{
if (!slot->IsOutput())
{
{
auto slotList = GetSlotsWithDynamicGroup(GetArithmeticDynamicTypeGroup());
int inputCount = 0;
@ -185,14 +185,14 @@ namespace ScriptCanvas
}
else if (operands.size() == 1)
{
const Datum* operand = operands.front();
const Datum* operand = operands.front();
result = (*operand);
return;
}
auto type = result.GetType();
Operator(type.GetType(), operands, result);
}
Operator(type.GetType(), operands, result);
}
void OperatorArithmetic::Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result)
{

@ -65,7 +65,7 @@ namespace ScriptCanvas
AZ::Crc32 GetArithmeticExtensionId() const { return AZ_CRC("AddnewValueExtension", 0xea20301c); }
AZ::Crc32 GetArithmeticDynamicTypeGroup() const { return AZ_CRC("ArithmeticGroup", 0x4271e41f); }
AZStd::string GetArithmeticDisplayGroup() const { return "ArithmeticGroup"; }
virtual AZStd::string_view OperatorFunction() const { return ""; }
virtual AZStd::unordered_set< Data::Type > GetSupportedNativeDataTypes() const
{
@ -81,14 +81,14 @@ namespace ScriptCanvas
Data::Type::Matrix4x4()
};
}
// Node
void OnSlotDisplayTypeChanged(const SlotId& slotId, const Data::Type& dataType) override final;
void OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) override final;
void OnConfigured() override;
void OnInit() override;
void OnActivate() override;
void OnActivate() override;
void ConfigureVisualExtensions() override;
SlotId HandleExtension(AZ::Crc32 extensionId) override;
@ -100,7 +100,7 @@ namespace ScriptCanvas
virtual void Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result);
virtual void InitializeSlot(const SlotId& slotId, const Data::Type& dataType);
//////////////////////////////////////////////////////////////////////////
// Translation
AZ::Outcome<DependencyReport, void> GetDependencies() const override;
@ -128,7 +128,7 @@ namespace ScriptCanvas
Slot* m_resultSlot;
SlotId m_outSlot;
};
//! Deprecated: kept here for version conversion
class OperatorArithmeticUnary : public OperatorArithmetic
{

@ -27,7 +27,7 @@ namespace ScriptCanvas
Type operator()(const Type& a, const Datum& b)
{
const Type* dataB = b.GetAs<Type>();
const Type& divisor = (*dataB);
if (AZ::IsClose(divisor, Type(0), std::numeric_limits<Type>::epsilon()))
{
@ -35,7 +35,7 @@ namespace ScriptCanvas
return Type(0);
}
return a / divisor;
return a / divisor;
}
private:
@ -65,9 +65,9 @@ namespace ScriptCanvas
SCRIPTCANVAS_REPORT_ERROR((*m_node), "Divide by Zero");
return VectorType(0);
}
}
return a / (*divisor);
}
return a / (*divisor);
}
OperatorDivVectorTypes(Node* node)
@ -114,7 +114,7 @@ namespace ScriptCanvas
{
const AZ::Color* dataA = lhs.GetAs<AZ::Color>();
const AZ::Color* dataB = rhs.GetAs<AZ::Color>();
if (dataB->IsClose(AZ::Color(), std::numeric_limits<float>::epsilon()))
{
// Divide by zero

@ -33,7 +33,7 @@ namespace ScriptCanvas
protected:
void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override;
void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override;
bool IsValidArithmeticSlot(const SlotId& slotId) const override;
void OnResetDatumToDefaultValue(ModifiableDatumView& datumView) override;

@ -19,9 +19,9 @@ namespace ScriptCanvas
#define DIVIDABLE_TYPES { Data::Type::Number(), Data::Type::Vector2(), Data::Type::Vector3(), Data::Type::Vector4() }
//! Deprecated: see MethodOverloaded for "Divide by Number (/)"
class OperatorDivideByNumber
class OperatorDivideByNumber
: public Node
{
{
public:
SCRIPTCANVAS_NODE(OperatorDivideByNumber);

@ -25,7 +25,7 @@ namespace ScriptCanvas
SlotId stepId = LerpBetweenProperty::GetStepSlotId(this);
if (stepId.IsValid())
{
{
for (const SlotId& slotId : { m_startSlotId, m_stopSlotId, m_speedSlotId, stepId })
{
Slot* slot = GetSlot(slotId);
@ -54,7 +54,7 @@ namespace ScriptCanvas
void LerpBetween::OnConfigured()
{
SetupInternalSlotReferences();
}
}
void LerpBetween::SetupInternalSlotReferences()
{
@ -66,7 +66,7 @@ namespace ScriptCanvas
m_stepSlotId = LerpBetweenProperty::GetStepSlotId(this);
m_percentSlotId = LerpBetweenProperty::GetPercentSlotId(this);
}
bool LerpBetween::IsGroupConnected() const
{
bool hasConnections = false;
@ -78,10 +78,10 @@ namespace ScriptCanvas
break;
}
}
return hasConnections;
}
bool LerpBetween::IsInGroup(const SlotId& slotId) const
{
return m_groupedSlotIds.count(slotId) > 0;

@ -25,7 +25,7 @@ namespace ScriptCanvas
#define LERPABLE_TYPES { Data::Type::Number(), Data::Type::Vector2(), Data::Type::Vector3(), Data::Type::Vector4() }
//! Deprecated: see NodeableNodeOverloadedLerp
class LerpBetween
class LerpBetween
: public Node
{
public:
@ -50,21 +50,21 @@ namespace ScriptCanvas
LerpBetween() = default;
~LerpBetween() override = default;
void OnInit() override;
void OnConfigured() override;
private:
void SetupInternalSlotReferences();
bool IsGroupConnected() const;
bool IsInGroup(const SlotId& slotId) const;
bool IsInGroup(const SlotId& slotId) const;
AZStd::unordered_set< SlotId > m_groupedSlotIds;
float m_duration;
float m_counter;
Datum m_startDatum;
Datum m_differenceDatum;
};

@ -129,7 +129,7 @@ namespace ScriptCanvas
return AZ::TickBus::Handler::BusIsConnected()
|| AZ::SystemTickBus::Handler::BusIsConnected();
}
protected:
size_t GetRequiredOutCount() const override
{

@ -189,7 +189,7 @@ namespace ScriptCanvas
dataSlotConfiguration.SetConnectionType(ScriptCanvas::ConnectionType::Output);
dataSlotConfiguration.m_dynamicDataType = DynamicDataType::Value;
SlotId slotIdStep = AddSlot(dataSlotConfiguration);
AZ_Assert(slotIdStep.IsValid(), "Data slot is not created successfully.");
latentOut.outputs.push_back(slotIdStep);

@ -29,7 +29,7 @@ namespace ScriptCanvas
AZ::Crc32 GetDataDynamicGroup() const { return AZ_CRC("LerpDataDynamicGroup", 0x62b5f89e); }
};
}
}
}
}

@ -75,7 +75,7 @@ namespace ScriptCanvas
break;
case Data::eType::Matrix4x4:
OperatorEvaluator::Evaluate<Data::Matrix4x4Type>(OperatorMulImpl<Data::Matrix4x4Type>(), operands, result);
break;
break;
default:
AZ_Assert(false, "Multiplication operator not defined for type: %s", Data::ToAZType(type).ToString<AZStd::string>().c_str());
break;
@ -88,7 +88,7 @@ namespace ScriptCanvas
FindModifiableDatumView(slotId, datumView);
OnResetDatumToDefaultValue(datumView);
}
}
bool OperatorMul::IsValidArithmeticSlot(const SlotId& slotId) const
{
@ -110,7 +110,7 @@ namespace ScriptCanvas
return (datum != nullptr);
}
void OperatorMul::OnResetDatumToDefaultValue(ModifiableDatumView& datumView)
void OperatorMul::OnResetDatumToDefaultValue(ModifiableDatumView& datumView)
{
Data::Type displayType = GetDisplayType(GetArithmeticDynamicTypeGroup());

@ -29,7 +29,7 @@ namespace ScriptCanvas
AZStd::unordered_set< Data::Type > GetSupportedNativeDataTypes() const override;
void Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result) override;
protected:
void InitializeSlot(const SlotId& slotId, const ScriptCanvas::Data::Type& dataType) override;

@ -50,7 +50,7 @@ namespace ScriptCanvas
{
const AZ::Matrix3x3* dataRhs = rhs.GetAs<AZ::Matrix3x3>();
return AZ::Matrix3x3::CreateFromColumns(lhs.GetColumn(0) - dataRhs->GetColumn(0), lhs.GetColumn(1) - dataRhs->GetColumn(1), lhs.GetColumn(2) - dataRhs->GetColumn(2));
return AZ::Matrix3x3::CreateFromColumns(lhs.GetColumn(0) - dataRhs->GetColumn(0), lhs.GetColumn(1) - dataRhs->GetColumn(1), lhs.GetColumn(2) - dataRhs->GetColumn(2));
}
};

@ -17,7 +17,7 @@ namespace ScriptCanvas
namespace Operators
{
//! Node that provides subtraction
class OperatorSub: public OperatorArithmetic
class OperatorSub : public OperatorArithmetic
{
public:

@ -182,7 +182,7 @@ namespace ScriptCanvas
break;
}
}
}
}
if (!handledConfiguration)
{
@ -250,7 +250,7 @@ namespace ScriptCanvas
if (handledConfiguration)
{
configurationIter = unhandledConfigurations.erase(configurationIter);
configurationIter = unhandledConfigurations.erase(configurationIter);
}
else
{
@ -296,7 +296,7 @@ namespace ScriptCanvas
m_sourceDisplayType = dataType;
OnDisplayTypeChanged(dataType);
}
}
}
}
void OperatorBase::OnSlotRemoved(const SlotId& slotId)
@ -319,7 +319,7 @@ namespace ScriptCanvas
return nullptr;
}
Slot* OperatorBase::GetFirstOutputSourceSlot() const
{
for (const SlotId& slotId : m_sourceSlots)
@ -429,7 +429,7 @@ namespace ScriptCanvas
bool isInBatchAdd = false;
GraphRequestBus::EventResult(isInBatchAdd, GetOwningScriptCanvasId(), &GraphRequests::IsBatchAddingGraphData);
if (IsSourceSlotId(currentSlotId))
{
auto node = AZ::EntityUtils::FindFirstDerivedComponent<Node>(endpoint.GetNodeId());
@ -493,7 +493,7 @@ namespace ScriptCanvas
}
SlotId OperatorBase::AddSlotWithSourceType()
{
{
Data::Type type = Data::Type::Invalid();
if (!m_sourceTypes.empty())

@ -22,7 +22,7 @@ namespace ScriptCanvas
{
namespace Operators
{
class OperatorBase
class OperatorBase
: public ScriptCanvas::Node
{
public:
@ -41,7 +41,7 @@ namespace ScriptCanvas
{
SourceType m_sourceType = SourceType::SourceInput;
DynamicDataType m_dynamicDataType = DynamicDataType::Any;
DynamicDataType m_dynamicDataType = DynamicDataType::Any;
AZStd::string m_name;
AZStd::string m_tooltip;
@ -103,7 +103,7 @@ namespace ScriptCanvas
virtual void OnInputSlotAdded(const SlotId& inputSlotId) { AZ_UNUSED(inputSlotId); };
virtual void OnDataInputSlotConnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {}
virtual void OnDataInputSlotDisconnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {}
virtual void OnDataInputSlotDisconnected([[maybe_unused]] const SlotId& slotId, [[maybe_unused]] const Endpoint& endpoint) {}
AZ::BehaviorMethod* GetOperatorMethod(const char* methodName);

@ -49,7 +49,7 @@ namespace ScriptCanvas
void Operators::InitNodeRegistry(NodeRegistry& nodeRegistry)
{
using namespace ScriptCanvas::Nodes::Operators;
// Math
AddNodeToRegistry<Operators, OperatorAdd>(nodeRegistry);
AddNodeToRegistry<Operators, OperatorDiv>(nodeRegistry);

@ -20,8 +20,8 @@
namespace ScriptCanvas::Nodeables::Spawning
{
class SpawnNodeable
: public ScriptCanvas::Nodeable,
public AZ::TickBus::Handler
: public ScriptCanvas::Nodeable
, public AZ::TickBus::Handler
{
SCRIPTCANVAS_NODE(SpawnNodeable);
public:

@ -6,14 +6,3 @@
*/
#include "Format.h"
namespace ScriptCanvas
{
namespace Nodes
{
namespace String
{
}
}
}

@ -24,7 +24,7 @@ namespace ScriptCanvas
{
public:
SCRIPTCANVAS_NODE(StartsWith);
};
};
//! Deprecated: see class String's reflection of method "Ends With"
class EndsWith

@ -62,7 +62,7 @@ namespace ScriptCanvas
};
//! Deprecated: see DelayNodeableNode
class Countdown
class Countdown
: public Node
{

@ -21,13 +21,13 @@ namespace ScriptCanvas
{
namespace Time
{
class DelayNodeable
class DelayNodeable
: public ScriptCanvas::Nodeable
, public AZ::TickBus::Handler
{
public:
SCRIPTCANVAS_NODE(DelayNodeable);
protected:
void OnDeactivate() override;
@ -43,7 +43,7 @@ namespace ScriptCanvas
float m_currentTime = 0.0f;
float m_holdTime = 0.0f;
void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime);
void InitiateCountdown(bool reset, float countdownSeconds, bool looping, float holdTime);
};
}
}

@ -23,7 +23,7 @@ namespace ScriptCanvas
namespace Time
{
//! Deprecated: see DurationNodeableNode
class Duration
class Duration
: public Node
{

@ -21,7 +21,7 @@ namespace ScriptCanvas
{
namespace Time
{
class DurationNodeable
class DurationNodeable
: public ScriptCanvas::Nodeable
, public AZ::TickBus::Handler
{

@ -33,7 +33,7 @@ namespace ScriptCanvas
protected:
};
};
}
}
}

@ -57,7 +57,7 @@ namespace ScriptCanvas
AddNodeToRegistry<Time, ScriptCanvas::Nodes::TimeDelayNodeableNode>(nodeRegistry);
AddNodeToRegistry<Time, ScriptCanvas::Nodes::TimerNodeableNode>(nodeRegistry);
}
AZStd::vector<AZ::ComponentDescriptor*> Time::GetComponentDescriptors()
{
return AZStd::vector<AZ::ComponentDescriptor*>({
@ -73,7 +73,7 @@ namespace ScriptCanvas
ScriptCanvas::Nodes::HeartBeatNodeableNode::CreateDescriptor(),
ScriptCanvas::Nodes::TimeDelayNodeableNode::CreateDescriptor(),
ScriptCanvas::Nodes::TimerNodeableNode::CreateDescriptor(),
});
});
}
}

@ -23,7 +23,7 @@ namespace ScriptCanvas
namespace Time
{
//! Deprecated: See TimerNodeableNode
class Timer
class Timer
: public Node
{
public:
@ -31,7 +31,7 @@ namespace ScriptCanvas
SCRIPTCANVAS_NODE(Timer);
Timer();
float m_seconds;
float m_milliseconds;
};

@ -21,7 +21,7 @@ namespace ScriptCanvas
{
namespace Time
{
class TimerNodeable
class TimerNodeable
: public Nodeables::Time::BaseTimer
{
SCRIPTCANVAS_NODE(TimerNodeable);

@ -9,13 +9,3 @@
#include "UnitTestBus.h"
namespace ScriptCanvas
{
namespace Nodes
{
namespace UnitTesting
{
}
}
}

@ -37,8 +37,8 @@ namespace ScriptCanvas
}
const char* StringConversion::CStyleToCStyle(const char* input)
{
return input;
{
return input;
}
void StringConversion::Reflect(AZ::ReflectContext* reflection)
@ -69,17 +69,17 @@ namespace ScriptCanvas
->Field("outcomeVector3Void", &TypeExposition::m_outcomeVector3Void)
;
}
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(reflection))
{
behaviorContext->Class<TypeExposition>("TypeExposition")
->Method("Reflect_AZStd::array<AZ::Vector3, 2>", [](AZStd::array<AZ::Vector3, 2>& vector) { return vector.size(); })
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Method("Reflect_AZ::Outcome<AZ::Vector3, void>", [](AZ::Outcome<AZ::Vector3>& vector) { return vector.IsSuccess(); })
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
;
}
}
}
}
}
}
}

@ -36,14 +36,14 @@ namespace ScriptCanvas
};
using EBus = AZ::EBus<EBusTraits>;
class EBusHandler
class EBusHandler
: public EBus::Handler
, public AZ::BehaviorEBusHandler
{
public:
AZ_EBUS_BEHAVIOR_BINDER
( EBusHandler
(EBusHandler
, "{5168D163-AAB9-417D-9FD4-CE10541D51CE}"
, AZ::SystemAllocator
, CStyleToCStyle
@ -95,14 +95,14 @@ namespace ScriptCanvas
return result;
}
};
class StringConversion
{
public:
AZ_TYPE_INFO(StringConversion, "{47A9CF0C-6F34-4E0C-B1F9-F908FC2B7388}");
static const char* CStyleToCStyle(const char* input);
static void Reflect(AZ::ReflectContext* reflection);
};
@ -118,5 +118,5 @@ namespace ScriptCanvas
AZ::Outcome<AZ::Vector3> m_outcomeVector3Void;
};
}
}
}
}
}

@ -24,7 +24,7 @@ namespace ScriptCanvas
SCRIPTCANVAS_NODE(ExpectTrue);
void OnInit() override;
void OnInit() override;
};
}
}

Loading…
Cancel
Save