import c4d
def main():
global traveled
global lastPos
obj = op.GetObject()
objMat = obj.GetMg()
frame = doc.GetTime().GetFrame(doc.GetFps())
forwardVec = objMat.MulV(c4d.Vector(1.0, 0.0, 0.0))
sign = 1.0
try: lastPos
except NameError:
lastPos = obj.GetMg().off
try: traveled
except NameError:
traveled = 0
if frame == 0:
traveled = 0
lastPos = objMat.off
else:
currentPos = objMat.off
# calculate actual movement
distVec = currentPos - lastPos
dotProd = distVec.Dot(forwardVec)
if dotProd > 0: sign = -1.0
projVec = forwardVec * dotProd
dist = projVec.GetLength()
lastPos = currentPos
traveled = traveled + sign * dist
# find the material
mat = obj.GetTag(c4d.Ttexture)
mat[c4d.TEXTURETAG_OFFSETX] = traveled / 500.0
# the factor depends on the texture and the obje
Hello, how to adress the Mograph cloner offset (cloner is set to object (spline) and i want just to edit the part in the code
mat[c4d.TEXTURETAG_OFFSETX] = traveled / 500.0
and make it work, but i am affraid i will need to edit more, for example to find the object. I am noob about python or any language, so could you help me someone please