Repository navigation
Replies: 1 comment
|
Groot2 is not the problem. It only writes Up to 4.8.x, if constexpr(std::is_enum_v<T> && !std::is_same_v<T, NodeStatus>)
{
auto it = config().enums->find(str); // scripting-enum registry
if(it != config().enums->end())
return static_cast<T>(it->second);
else
return static_cast<T>(convertFromString<int>(str)); // -> "Can't convert string [test1] to integer"
}So "test1" must be a registered scripting enum, or the port value must be a number. Calling Pick one fix:
I checked this with a node that has
After the fix, |
Uh oh!
There was an error while loading. Please reload this page.
Hey,
So here is an enum class : Test.
enum class Test{ Test1, Test2, Test3 }And I already had :
template<> inline Test convertFromString(StringView str) {...}.I tested it within the code and it works fine.
But the issue when passing the String "test1" to the InputPort in the Groot2 editor.
It treats that enum class as an integer and I get :
getInput(): Can't convert string [test1] to integerThe The TreeNodesModel XML actually says:
<input_port name="type" type="enum Test"/>Thanks in advance.
All reactions