本文整理汇总了Python中Control.cubeCtl方法的典型用法代码示例。如果您正苦于以下问题:Python Control.cubeCtl方法的具体用法?Python Control.cubeCtl怎么用?Python Control.cubeCtl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.cubeCtl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createBlueprinter
# 需要导入模块: import Control [as 别名]
# 或者: from Control import cubeCtl [as 别名]
def createBlueprinter( name, args ):
'Creates a default blueprinters'
ret = {}
sctl = []
jnt = ""
functArgs = {"shape":"cube", "size":1, "t":0, "r":0, "s":0}
functArgs = dict(functArgs.items() + args.items())
#create Control
if(functArgs["shape"] == "cube"):
sctl = Control.cubeCtl( name, functArgs )
elif(functArgs["shape"] == "sphere"):
sctl = Control.sphereCtl( name, functArgs )
elif(functArgs["shape"] == "arrow"):
sctl = Control.arrowCtl( name , functArgs )
elif(functArgs["shape"] == "locator"):
sctl = Control.locatorCtl( name , functArgs )
else:
print "Shape not supported...\n"
return 0
#lock hide unwanted Attribute
if functArgs["t"] == 1:
Attribute.lockHide(sctl[0], {"t":1, "h":1, "l":1})
if functArgs["r"] == 1:
Attribute.lockHide(sctl[0], {"r":1, "h":1, "l":1})
if functArgs["s"] == 1:
Attribute.lockHide(sctl[0], {"s":1, "h":1, "l":1})
#add blueprinter joint
jnt = cmds.joint( n = ( name + "_SJNT" ), p= (0, 0, 0 ) )
Constraint.constrain(sctl[0], jnt, args={ "t":1, "mo":0, "name":(name)} )
#matrixConstraint(sctl[0] , jnt, 0, {})
#template(jnt)
#parent to root
cmds.parent(jnt,sctl[0])
#cmds.parent(ret["sctl"][1],rootGrp)
#rename suffix
newName = sctl[0].replace("_CTL","_SCTL")
cmds.rename(sctl[0],newName)
sctl[0] = newName
newName = sctl[1].replace("Ctl_GRP","Sctl_GRP")
cmds.rename(sctl[1],newName)
sctl[1] = newName
#create blueprinter variable
"""for blueprinter in sctl:
storeString(blueprinter, "blueprinter", "")
storeString(jnt, "sjoint", "")"""
ret["sctl"] = sctl
ret["jnt"] = jnt
return ret