diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasNodeable_Source.jinja b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasNodeable_Source.jinja index 27498a2aec..71681ed73b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasNodeable_Source.jinja +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasNodeable_Source.jinja @@ -186,21 +186,16 @@ void {{attribute_QualifiedName}}::Reflect(AZ::ReflectContext* context) ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) {% if attribute_Category is defined %} - ->Attribute(AZ::Edit::Attributes::Category, "{{ attribute_Category }}") + ->Attribute(AZ::Edit::Attributes::Category, "{{ attribute_Category }}") {%- endif %} - {% if attribute_Icon is defined %} - ->Attribute(AZ::Edit::Attributes::Icon, "{{ attribute_Icon }}") + ->Attribute(AZ::Edit::Attributes::Icon, "{{ attribute_Icon }}") {%- endif %} - {% if attribute_Deprecated is defined %} - ->Attribute(AZ::Edit::Attributes::Deprecated, "{{ attribute_Deprecated }}") + ->Attribute(AZ::Edit::Attributes::Deprecated, "{{ attribute_Deprecated }}") {%- endif %} - {% set uihandler = 'AZ::Edit::UIHandlers::Default' %} - -{% for Property in Class.iter('Property') %} -{% for item in Property.iter('PropertyData') %} +{% for item in Class.iter('Property') %} {% if item.attrib['UIHandler'] is defined %} {% set uihandler = item.attrib['UIHandler'] %} {% endif %} @@ -208,12 +203,11 @@ void {{attribute_QualifiedName}}::Reflect(AZ::ReflectContext* context) {% if item.attrib['Description'] is defined %} {% set description = item.attrib['Description'] %} {% endif %} - // {{ item.attrib['Name'] }} - ->DataElement({{ uihandler }}, &{{ attribute_Name }}::{{ Property.attrib['Name'] }}, "{{ item.attrib['Name'] }}", "{{ description }}") -{% for EditAttribute in Property.iter('EditAttribute') %} - ->Attribute({{ EditAttribute.attrib['Key'] }}, {{ EditAttribute.attrib['Value'] }}) -{% endfor %} -{% endfor %} + // {{ item.attrib['Name'] }} + ->DataElement({{ uihandler }}, &{{ attribute_Name }}::{{ item.attrib['Name'] }}, "{{ item.attrib['Name'] }}", "{{ description }}") +{% for EditAttribute in item.iter('EditAttribute') %} + ->Attribute({{ EditAttribute.attrib['Key'] }}, {{ EditAttribute.attrib['Value'] }}) +{% endfor %} {% endfor %} ; } diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestFixture.h b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestFixture.h index cb3c9cdccb..7f026edf58 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestFixture.h +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestFixture.h @@ -122,6 +122,8 @@ namespace ScriptCanvasTests ::Nodes::InputTypeExampleNode::Reflect(m_behaviorContext); ::Nodes::BranchInputTypeExampleNode::Reflect(m_serializeContext); ::Nodes::BranchInputTypeExampleNode::Reflect(m_behaviorContext); + ::Nodes::PropertyExampleNode::Reflect(m_serializeContext); + ::Nodes::PropertyExampleNode::Reflect(m_behaviorContext); TestNodeableObject::Reflect(m_serializeContext); TestNodeableObject::Reflect(m_behaviorContext); diff --git a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/NodeableTestingLibrary.cpp b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/NodeableTestingLibrary.cpp index 6a9f7fd6c3..5d8574fb10 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/NodeableTestingLibrary.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/NodeableTestingLibrary.cpp @@ -44,6 +44,7 @@ namespace ScriptCanvasTesting ScriptCanvas::Library::AddNodeToRegistry(nodeRegistry); ScriptCanvas::Library::AddNodeToRegistry(nodeRegistry); ScriptCanvas::Library::AddNodeToRegistry(nodeRegistry); + ScriptCanvas::Library::AddNodeToRegistry(nodeRegistry); } AZStd::vector NodeableTestingLibrary::GetComponentDescriptors() @@ -53,7 +54,8 @@ namespace ScriptCanvasTesting ::Nodes::BranchMethodSharedDataSlotExampleNode::CreateDescriptor(), ::Nodes::ReturnTypeExampleNode::CreateDescriptor(), ::Nodes::InputTypeExampleNode::CreateDescriptor(), - ::Nodes::BranchInputTypeExampleNode::CreateDescriptor() + ::Nodes::BranchInputTypeExampleNode::CreateDescriptor(), + ::Nodes::PropertyExampleNode::CreateDescriptor() }); } } diff --git a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.ScriptCanvasNodeable.xml b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.ScriptCanvasNodeable.xml index efebbefce7..0be3c8c81a 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.ScriptCanvasNodeable.xml +++ b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.ScriptCanvasNodeable.xml @@ -32,7 +32,7 @@ - + @@ -51,13 +51,27 @@ Namespace="None" Description="Example of passing as input by value, pointer and reference."> - + - + - + + + + + + + diff --git a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.cpp b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.cpp index 154508d5f1..35fa1136f9 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.cpp @@ -66,5 +66,15 @@ namespace ScriptCanvasTesting { input.clear(); } + + void PropertyExample::In() + { + for (auto& num : Numbers) + { + AZ_TracePrintf("ScriptCanvas", "%f", num); + } + + AZ_TracePrintf("ScriptCanvas", "Slang: %s", Slang.c_str()); + } } } diff --git a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.h b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.h index 7bcfed8bb4..8c19e1916c 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.h +++ b/Gems/ScriptCanvasTesting/Code/Source/Nodes/Nodeables/ValuePointerReferenceExample.h @@ -48,5 +48,11 @@ namespace ScriptCanvasTesting { SCRIPTCANVAS_NODE(InputTypeExample); }; + + class PropertyExample + : public ScriptCanvas::Nodeable + { + SCRIPTCANVAS_NODE(PropertyExample); + }; } }