4. Mar 2015

Python Iterators for your Cinema 4D Scene

One thing you will do over and over again in scripting Cinema 4D is to go through your scene. Usually you go hunting for certain objects, tags or materials. This is pretty straight forward using the BaseList2D class methods by using GetNext() and GetDown() but can get old pretty fast as you are doing the same checking and safeguards over and over again. Python - like many modern programming languages - has a neat iterator pattern that is engrained into the language.