On 13/03/2017 at 05:45, xxxxxxxx wrote:
Yeah, I can understand almost everything happening in the script, but it breaks the instant you change pretty much anything.
I noticed Douwe said if you copy the contents of the scene into a new empty scene, it starts working with the new changes. I confirm this works, but what a dirty fix...
Could there be a more elegant way to offset clones indices?
I tried a different approach, based on an example python effector from the Python SDK (py_effector)
In that example there is no "return" present, and when I try my code (seen below) I have to include "return 1.0" otherwise I get an error:
"TypeError: main expected float or c4d.Vector, not None"
from c4d.modules import mograph as mo
def my_shuffle(array) :
print "I shuffled"
def main() :
md = mo.GeGetMoData(op)
if md==None: return
cnt = md.GetCount()
marr = md.GetArray(c4d.MODATA_MATRIX)
fall = md.GetFalloffs()
frame = doc.GetTime().GetFrame(doc.GetFps())
marr = newmarr
if frame%5==0 and frame != 0:
newmarr = my_shuffle(marr)
md.SetArray(c4d.MODATA_MATRIX, marr, True)
So, this code doesn't work, it throws no errors either, it does dump about a million "I shuffled" messages to the log every 5th frame. Why that is happening, I have no clue.. I assumed python effector executes once per frame..?