So far I'm doing the following:
multiparmTemplate = node.parm("myMultiParmFolder").parmTemplate().parmTemplates() nparms_eachBlock = len(multiparmTemplate)
- The problem arises when you have a nested folder (with its own child parms) inside your multiparm folder. The above code would treat that folder as 1 single element.
Is there a way to do it procedurally, without having to add-hardcode to the above result the number of items of the nested folder (number that can vary)? - Bonus question: my ultimate goal is to know the Index of the multiparm block, given one of the parameter instances of the multiparm folder. (es. from “range3x” , it should return 3)
I managed to do it in a convoluted way, withbut multiParmInstanceIndices() is accounting for the child paramaters of the nested Folder, and for the folder itself.parm.multiParmInstanceIndices()[0] / nparms_eachBlock
So, if I can't have the exact number of items of the multiparm template folder, I should hardcode it. Maybe there's a function that I overlooked that can tell you the id of the multiparm block of provenience?