How the heck do i get myself a roSgNode field with type “array of dictionaries”?
What do i type in or in node.addField() to make this happen?
No, i am not confused and i don’t need “dictionary of arrays” nor “dictionary of anythings”. Nor are “array of float”, “array of integer”, “array of Boolean”, “array of string”, “array of vector2d”, “array of color”, “array of time”, “array of nodes” of any help.
I am very reasonable - I’ll take a strongly-typed or a weakly-typed option, whatever:
I wanted an “array of roAssociativeArray” field type
In lieu of that, i’ll take an “array of Object” field type
In lieu of that, i’ll take an “array of Dynamic” field type
In lieu of that, i’ll take an “Object” field type
In lieu of that, i’ll take a “Dynamic” field type
Here are my attempts so far in order of increasing desperation:
“port 8089” wrote:
Found 1 parse error in XML file _Scene.xml
— Line 6:
“TheEndless” wrote:
The only way I’ve found to do that is to set assocarray as the field type, then add your variant/dynamic array to a single element AA. Hacky, but…
For posterity, an illustration of above workaround idea (copied from here
' you cant have this: '
myNode.addFields({ myField: [1, 2, 3] })
' however, you can cheat and do this just fine: '
myNode.addFields({ myField: {bless_RSGs_maker: [1, 2, 3]} })
“TheEndless” wrote:
The preferred/recommended way would be to use ContentNodes instead of AAs.
Not really/not anymore though. First, there are indications the Co will be adding (begrudgingly 8-)) direct support for roArray fields in future firmware, so for my money the above hack is better since can be easily changed to the sane way when available.
And second, if one really wants to use a node as container for a list of ContentNodes, at least use an instance of the parent class Node and not another ContentNode - both are equally privileged re thread ownership. The difference being Node does not have all the content-metadata fields junk (“junk” for our specific purpose as container here, not in general).