Custom Flownode corrupts main.lyr, why?

#1
Hey there.

So a very basic custom flownode corrupts the main.lyr (objects are gone after loading, XML error pops up)
I wonder why.

Here is the code that corrupts it:

Code: Select all

#include "StdAfx.h" #include <CryFlowGraph/IFlowBaseNode.h> class CMyFlowNode final : public CFlowBaseNode<eNCT_Instanced> { public: CMyFlowNode(SActivationInfo* pActInfo) { } ~CMyFlowNode() { } virtual IFlowNodePtr Clone(SActivationInfo* pActInfo) { return new CMyFlowNode(pActInfo); } virtual void GetConfiguration(SFlowNodeConfig& config) override { static const SInputPortConfig inputs[] = { InputPortConfig_Void("Execute", _HELP("Execute calculation")), InputPortConfig<float>("Input A"), InputPortConfig<float>("Input B"), { 0 } }; static const SOutputPortConfig outputs[] = { OutputPortConfig<float>("Result"), { 0 } }; config.pInputPorts = inputs; config.pOutputPorts = outputs; config.sDescription = _HELP("Adds A to B and returns result"); config.SetCategory(EFLN_APPROVED); }; } virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) override { } virtual void GetMemoryUsage(ICrySizer* pSizer) const override { pSizer->Add(*this); } }; REGISTER_FLOW_NODE("TestNodes:Test", CMyFlowNode);
Here is the code that DOES NOT corrupt it:

Code: Select all

#include "StdAfx.h" #include <CryFlowGraph/IFlowBaseNode.h> class CMyFlowNode final : public CFlowBaseNode<eNCT_Instanced> { public: CMyFlowNode(SActivationInfo* pActInfo) { } ~CMyFlowNode() { } virtual IFlowNodePtr Clone(SActivationInfo* pActInfo) { return new CMyFlowNode(pActInfo); } virtual void GetConfiguration(SFlowNodeConfig& config) override { config.sDescription = _HELP("Description"); config.SetCategory(EFLN_APPROVED); } virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) override { } virtual void GetMemoryUsage(ICrySizer* pSizer) const override { pSizer->Add(*this); } }; REGISTER_FLOW_NODE("TestNodes:Test", CMyFlowNode);
As soon as I add the PortConfigs, load the level, add the node, save, close and reload, main.lyr is broken.
Any idea why this is??

Who is online

Users browsing this forum: No registered users and 2 guests