Hey guys,
as you know I’m super happy with the parGroups implementation, props for that!
I’m already using it a great deal. In my current project I often have to assign new values to a few parameters in a parGroup while leaving the other pars in that same parGroup as is, so now I thought of a useful addon to my wishlist:
RFE: make the parGroup sliceable
Goal: to assign values to multiple (but not all) pars in a parGroup, in one call
Explanation: The parGroup is already an iterable tuple in TD. In normal Python, tuples can also be sliced.
If we could also slice a parGroup, we could for instance in a Constant TOP assign colorg
and colorb
color, while leaving colorr
alone, all done in one call.
(perhaps the goal is best comparable to ‘swizzling’ in GLSL, which enables you to update multiple components of a vector in one call).
Example code how this would work:
>>> n = op("constant1")
>>> n.parGroup.color = (0.1,0.2,0.3)
>>> print(n.parGroup.color)
(0.1, 0.2, 0.3)
>>> n.parGroup.color[1:] = (0.5, 0.6)
>>> print(n.parGroup.color)
(0.1, 0.5, 0.6)
>>> print(n.parGroup.color[:2])
(0.1, 0.5)