On 18/04/2017 at 11:08, xxxxxxxx wrote:
Hello! It seems that in a Python Effector set to Full Control, I need to reverse the falloff array index pointer in order to access the matching clone from any other modata array? It seems that GetFalloffs returns the array in reverse?
Also, I do not understand the purpose of MoData.SetArray(id, arr, apply_strength ). It seems to apply the falloff more accurately with apply_strength set to False.
The default example loaded in the Full Control Python Effector does not properly apply the falloff set in the Effector's Falloff tab. Here is the example of how I hacked that default script to work properly with the Falloff set in the Effector's Falloff tab.
import c4d from c4d.modules import mograph as mo #Welcome to the world of Python def main() : md = mo.GeGetMoData(op) if md is None: return False cnt = md.GetCount() marr = md.GetArray(c4d.MODATA_MATRIX) fall = md.GetFalloffs() for i in reversed(xrange(0, cnt)) : marr[i].off = marr[i].off+fall[cnt-i-1]*100.0 md.SetArray(c4d.MODATA_MATRIX, marr, False) return True
The only parts I modified were the "cnt-i-1" which reverses the index pointer to the falloff array, and setting the apply_strength parameter of SetArray( to False.
Maybe someone can explain to me why it is this way? Seems like a bug, but I am not sure yet so I didn't want to post it in the Bug Report forum quite yet!