Hi @gsmetzer ,
Thank you for providing the scene that shows the problem!
Your code in the Python generator should be scoped with functions and classes. The code outside of main() function is only run once. Please also make sure you're familiar with cinema threading restrictions: Threading Manual.
Once you cover the code into a separate function it starts working (check the code below). Although, you are kind of misusing the python generator object (as it doesn't generate any cache). The Python Tag could probably be a better fit here.
Another note is that although changing other object's attributes is somewhat acceptable, you can still fall into a trap of changes being delayed, because of lacking the recalculate pass after you've changed the value. It might be worth trying to store your text in a user data attribute of python generator. And for the text object just create an xpresso tag that drives the text value from the string in the user data attribute of python generator. This way you can fine tune the execution priority order: documentation.
One more thing. I've also received the missing font error upon loading your test scene, make sure it is fixed to have the code working.
Cheers,
Ilia
Code for your python generator:
import c4d def foo(): children = op.GetChildren() widths = [] for i in range(len(children)): radius = children[i].GetRad() widths.append(round(radius.x)) return widths def main(): op[c4d.ID_USERDATA,1][c4d.PRIM_TEXT_TEXT] = str(foo()) return