THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/11/2012 at 00:04, xxxxxxxx wrote:
Just tinkering - I know this isnt correct - but any feedback appreciated
Trying to get a random sort mograph clones
by shuffling the clone array
I can randomise or reverse on a particular frame
but not keep the randomisation
if (frame >= 70) : random.shuffle(marr)
constantly shuffles - not wanted
if (frame == 70) : random.shuffle(marr)
shuffles on that one frame then resets to original order on 71 - not wanted
any ideas
import c4d
from c4d.modules import mograph as mo
import math, random
#Welcome to the world of Python
def main() :
md = mo.GeGetMoData(op)
if md==None: return False
cnt = md.GetCount()
marr = md.GetArray(c4d.MODATA_MATRIX)
fall = md.GetFalloffs()
#marr.reverse() #just reverse
#marr.append(marr.pop(0)) #another reverse
frame = doc.GetTime().GetFrame(doc.GetFps())
if (frame >= 70) : random.shuffle(marr)
for i in reversed(xrange(0, cnt)) :
marr _.off = marr _.off__
_ _ #if (i == 4) : marr.reverse() # experimen__
_ _ md.SetArray(c4d.MODATA_MATRIX, marr, True)__
_ _ return True__
__
_ _
__