Пример #1
0
def aw_ranAnim():
    shift = int(textField("ranAnim", q=1, text=1))
    args = ls()
    aw_bakeCam.doChecks(args, 1)
    animSrc = args[0]
    # Determine Selected attributes from channelbox
    melGlobals.initVar("string", "gChannelBoxName")
    attrList = channelBox(melGlobals["gChannelBoxName"], q=1, sma=1)
    # Copy Keys from the Graph Editor for main object (deselect other objects before copying)
    select(r=animSrc)
    copyKey(animSrc, hierarchy="none")
    select()
    # Paste keys to all objects depending on attributes selected from the channelBox
    for arg in args:
        if arg != animSrc:
            offsetSeed = int(mel.floor(mel.rand(0, shift)))
            # Randomize the frame offsets
            print "Offset seed = " + str(offsetSeed) + " on object " + str(arg) + ".\n"
            pasteKey(arg, floatOffset=0, option="insert", copies=1, valueOffset=0, connect=1, timeOffset=offsetSeed)
            """
			            for ($attr in $attrList) {
			                print ("Pasting onto attribute: "+$attr+"\n");
			                //Assign from original object to all other objects given shift value
			                pasteKey -to $offsetSeed -at $attr $arg;
			            } 
			            """

    select(r=args)
Пример #2
0
def aw_ranSel():
    percent = float(textField("ranSel", q=1, text=1))
    args = ls()
    aw_bakeCam.doChecks(args, 2)
    for arg in args:
        randomSeed = float(mel.rand(0, 1))
        if randomSeed >= (percent / 100):
            select(d=arg)
Пример #3
0
def aw_ranShift():
    shift = int(textField("ranShift", q=1, text=1))
    args = ls()
    aw_bakeCam.doChecks(args, 0)
    for arg in args:
        select(r=arg)
        selectSeed = float(mel.rand(0, 1))
        # DEBUG LINE - // print ("Random Seed is "+$selectSeed+"\n");
        if selectSeed <= 0.1:
            select(d=arg)
            # DEBUG LINE - //print ("Keeping animation the same for: " + $arg + "\n");

        else:
            randomShift = int(mel.floor(mel.rand(shift)))
            randomShift = randomShift * -1
            keyframe(edit=1, relative=1, timeChange=randomShift)
            # DEBUG LINE - //print ("Moving "+$arg+" by "+$randomShift+"\n");

    select(r=args)