On 01/06/2017 at 08:36, xxxxxxxx wrote:
Hi,
welcome to the Plugin Café forums :slightly_smiling_face:
The referenced scene actually does not do, what you expect it to do. The user data scale parameter is only linked to the scale of the two cubes via Xpresso. The MoGraph cloner takes these cubes clones them into the array and while doing so, it blends between the two given cubes (not touching user data at all). On top of that the clones get influenced by the random effector.
It's not possible to have individual user data on the clones generated by a MoGraph cloner. The clones are just instances and their individual data is stored in the MoData. Of course you can use user data to influence the behavior of a Python Effector, just not on a per clone basis.
But you can add your own custom MoData arrays in a Python Effector, although I'm not sure how you'd access these inside Arnold. But roughly it looks like so, code for Python Effector:
MY_ARRAY_ID = 123456 # have a unique ID from Plugin Cafe
md = mo.GeGetMoData(op)
if md is None:
return False
# A proper DescID is needed for AddArray()
# Especially set the correct data type here!
did = c4d.DescID(c4d.DescLevel(MY_ARR_ID, c4d.DTYPE_LONG, 0))
myArr = md.GetArray(MY_ARR_ID)
if myArr is None: # check, if the array has already been added earlier on
idxArr = md.AddArray(did, "my array", 0)
if idyArr == c4d.NOTOK:
print "Error" # handle error here
return False
# Finally fill the array with your data
md.SetArray(MY_ARR_ID, your data, True)
Of course a second Python Effector could now access this custom array in the same fashion.