def blendScale(blend="none", sourceA="none", sourceB="none", target="none", sourceValue="none"):
"""name is first arg, then three objects. Blends translation from first two selected into third selected. SourceValue (last input) is for the driving obj.attr. First source is active at '1', second at '2'"""
#add input and *args
if blend == "none":
blend = "blendColors"
if sourceA == "none":
sel = getSelection()
if len(sel) != 3:
cmds.error("Error: blendRotation, select three transforms")
#inert some kind of break here
sourceA = sel[0]
sourceB = sel[1]
target = sel[2]
blend = cmds.shadingNode("blendColors", asUtility=True, name=blend)
sourceAOut = sourceA + ".scale"
sourceBOut = sourceB + ".scale"
targetIn = target + ".scale"
blend1 = blend + ".color1"
blend2 = blend + ".color2"
blendOut = blend + ".output"
cmds.connectAttr(sourceAOut, blend1)
cmds.connectAttr(sourceBOut, blend2)
cmds.connectAttr(blendOut, targetIn)
if not sourceValue == "none":
cmds.connectAttr(sourceValue, "%s.blender"%blend)
return(blend)
# def colorControl(color="none", *args):
# """enter a color (red, blue, green, yellow, dkRed, dkBlue, dkGreen, dkYellow, pink, ltBlue, ltGreen, ltYellow, black, purple), then objs or selection"""
# if color == "none":
# cmds.error("must choose a color to use 'colorControl'")
# #create dictionary
# colors = {"red":13}
# if args == ():
# args = getSelection()
# for obj in args:
# #get shape node
# #check to make sure there is a shape node
# #set coloroverride to 1
# #set color to color value of dict
# pass
# def standInGeo():
# ## check that there is a next joint
# ## measure distance to next joint?
# ## create geo that is scaled to that measurement
# ## snap the geo to the joint
# pass
评论列表
文章目录