On 30/05/2017 at 13:12, xxxxxxxx wrote:
Hi gr4ph0s, thanks for writing us.
With reference to your question, assuming that you're already aware that the UVW values belonging to a clone has nothing to due with UVW values of the mesh (of the cloned object). For instance considering a MoGraph Cloner creating a Linear Array, the U value correnspond to the ration between the clone index and the total number of clones whilst for a Object Array the U and V values correnspond to the UV values of the mesh used to create the instances.
That said, it's also relevant to state that although all cloners objects have internal UV cooridinates that can be used to drive an Effector's effect, only a limited set of effectors (e.g. the Formula effector) can be influenced by such parameters.
The scene referred by this link, shows two cloners (a linear and an object) where a Formula Effector is used to modify size and position of a cloned object.
Internally the effector uses the U and V coordinates of the clone to calculate the effect. On top of that a Python Effector randomise the U and V coordinates based on the script below before having them used by the Formula Effector.
from c4d.modules import mograph as mo
#Welcome to the world of Python
def main() :
# retrieve the MoData attached to the MoGraph generator
md = mo.GeGetMoData(op)
if md is None:
# the effector will run on all the clones and all the BlendIDs
# GetCurrentIndex() returns the index of the current clone
index = md.GetCurrentIndex()
# GetBlendID() returns the current BlendIDs
mode = md.GetBlendID()
value = 0.0
# filter the BlendID
if mode == c4d.ID_MG_BASEEFFECTOR_U:
# update the U value and return
value = random.random()
elif mode == c4d.ID_MG_BASEEFFECTOR_V:
# update the V value and return
value = float(index)/float(md.GetCount())
The approach you were trying to achieve instead aims to modify the MoData UVW array directly which is not the way the Python Effector is meant to be used.
Best regards, Riccardo