Execute python script if any object is moving


#1

Hey,
i just started with python scripting in c4d. I have build some stuff with cloners and change the colors with an shader effector. I managed to write a script which writes out the colordata of each clone in a file. Now this should be executed automatically every time when something changes in my scene. At the moment the “export” just happens when i click execute. So in the end i want to get a text file which contains the colordata of each object for every frame, like wxporting the color animation.
Can someone please help me out with this?
thanks


#2

If your python was on a tag in OM, it would execute every frame. You might need to remove any main = main, else it will go crazy. You can check frame dependent, so it doesn’t execute when you manually tinker with the scene.


#3

thanks, for the tipp with python tag, but couldn`t figure it out how to “record” the data and put it in one single file.
I solved it a bit different now.
I´m looping through every frame with my python script now, collect all the data and write it to an file when i reach the last frame.