Problem summary
If forceArrayNames is specified in NodeTypeBuilder.setParametersTemplateAttr, it does not work for parameters that are part of an Enableable Parameter Group because the generic assign root is processed with a separate code path which doesn't have access to the forceArrayNames values.
In the below example, forceArrayNames works for the single-element 'chicken' but not for 'args.taco'.
While the workaround is to use a zero-length attr as the template default, it'd be useful if forceArrayNames could apply to all attrs in the template.
nb = Nodes3DAPI.NodeTypeBuilder('AAA')nb.setParametersTemplateAttr(FnAttribute.GroupBuilder() .set('args.taco', '') .set('chicken', '') .build(), forceArrayNames=('args.taco', 'chicken',))def buildOpChain(self, interface): passnb.setBuildOpChainFnc(buildOpChain)nb.setGenericAssignRoots('args', '')nb.build()
Steps to reproduce
-
Copy and paste the above NodeTypeBuilder example into a text editor.
-
Save the file as NTB.py in a Plugins folder under KATANA_RESOURCES
-
Launch Katana and create an ‘AAA’ node.
-
Inspect the parameters by running the following in the Python tab:
print NodegraphAPI.GetNode('AAA').getParameter('chicken').getXML()
print NodegraphAPI.GetNode('AAA').getParameter('args.taco').getXML()
-
Note that chicken is a stringarray parameter, while the value of taco is a string parameter.
Workaround
Use a zero-length attr as the template default.
Reproduced by support
Katana 2.6v3 - Windows 7
- This issue appears to be in all versions of the product
Expected behaviour
All attrs specified in forceArrayNames should be created as array parameters on the node.
Actual behaviour
forceArrayNames is not respected for GenericAssign-based parameters.