Hi all,
I am coming from pythonic root and am trying to initialize, append, and loop though arrays/lists. I struggled to find docs other than the official site as array and list are common terms for other objects on threads. I’ve seen this in the documentation:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/technical/
“”"
ZScript provides for arrays of strings or numbers. The declarations are simple:
[VarDef, gValues(9), 3] creates an array ‘gValues’ of 9 numbers, each initialized to 3.
[VarDef, gWords(5), “Hello”] creates a three element array of strings, each initialized to “Hello”. Array element are accessed starting from 0; myArray(0) is the first element of myArray, myArray(1) is the second element, and so forth. (This is standard use for arrays in most programming languages.)
“”"
I dont want consecutive ints though, I want the list to be able to hold strings and another to hold variables. Is there way to initialize a list with several strings or vars? i.e. listX = [“A”, “B”, “C”]
Is there a way to append strings and vars to an existing list? i.e. listY.append(newSubtoolName)
And the next step would be looping through an array.
[Loop, listX,
[IPress, x]
,x]
If we cant do that can we check the number of items in an array - len(listX) so that we can do something like this:
listXLen = len(listX)
[Loop, listXLen,
[IPress, listX(x)]
,x]
Thanks!