本文整理汇总了Python中Lib.getFirst方法的典型用法代码示例。如果您正苦于以下问题:Python Lib.getFirst方法的具体用法?Python Lib.getFirst怎么用?Python Lib.getFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lib
的用法示例。
在下文中一共展示了Lib.getFirst方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sphereCtl
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def sphereCtl( name, functArgs ):
J=[]
ctl = Lib.getFirst(cmds.polySphere( n = (name + "_CTL"), r= functArgs["size"], sx= 1, sy= 1, ax= [0, 1, 0], ch= 1))
grp = cmds.group( ctl, n = (name + "Ctl_GRP"))
J.append(ctl)
J.append(grp)
return J
示例2: cubeCtl
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def cubeCtl( name, functArgs ):
J=[]
ctl = Lib.getFirst(cmds.polyCube( n = (name + "_CTL"), w= functArgs["size"], h= functArgs["size"], d= 1, sx= 1, sy= 1, sz= 1, ax= [0, 1, 0], cuv= 4, ch= 1))
grp = cmds.group( ctl, n = (name + "Ctl_GRP"))
J.append(ctl)
J.append(grp)
return J
示例3: circleCtl
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def circleCtl( name, radius ):
'Creates arrow control'
J=[]
curve= Lib.getFirst(cmds.circle( n = (name+ "_CTL"), c= [0, 0, 0], nr= [0, 1, 0], sw= 360, r= radius, d= 3, ut= 0, tol= 0.01 ,s= 8, ch=1))
grp = cmds.group( curve, n = (name + "Ctl_GRP"))
J.append(curve)
J.append(grp)
return J
示例4: locatorCtl
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def locatorCtl( name, args ):
'Creates locator ctl'
J=[]
ctl = Lib.getFirst(cmds.spaceLocator( n =(name + "_CTL") ) )
grp = cmds.group( ctl, n = (name + "Ctl_GRP"))
cmds.xform(grp, piv= [0,0,0] )
J.append(ctl)
J.append(grp)
return J
示例5: duplicateChain
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def duplicateChain(name , chainJoints):
'Duplicates a chain of joints'
i = 1
joints = []
jointNo = len(chainJoints)
for x in range( jointNo ):
joints.append( Lib.getFirst(cmds.duplicate(chainJoints[x], po = True, n = (name + str(x + 1) + "_JNT"))) )
for x in range( 1, jointNo ):
cmds.parent(joints[jointNo - x], joints[jointNo - (x + 1)])
return joints
示例6: saveTransforms
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def saveTransforms(filePath, module, objects):
"""
Will Store transfrom data in file
"""
# objects = self.getRegisteredObjects( module, regAttr)
writeData = ""
for object in objects:
translate = Lib.getFirst(cmds.getAttr((object + ".t")))
rotate = Lib.getFirst(cmds.getAttr((object + ".r")))
scale = Lib.getFirst(cmds.getAttr((object + ".s")))
writeLine = (
object
+ " "
+ str(translate[0])
+ " "
+ str(translate[1])
+ " "
+ str(translate[2])
+ " "
+ str(rotate[0])
+ " "
+ str(rotate[1])
+ " "
+ str(rotate[2])
+ " "
+ str(scale[0])
+ " "
+ str(scale[1])
+ " "
+ str(scale[2])
+ "\n"
)
writeData += writeLine
FILE = open(filePath, "wb")
blueprintData = FILE.write(writeData)
FILE.close()
print ("Saved Transform data to : " + filePath)
示例7: createPoleVec
# 需要导入模块: import Lib [as 别名]
# 或者: from Lib import getFirst [as 别名]
def createPoleVec(joints, ikHandle, position):
"""
Creates pole vector for handle for three joints
"""
if len(joints) != 3:
cmds.error("Incorrect number of joints supplied to IkHandle.")
# Create locator to act as pole vector
locName = (String.removeSuffix(ikHandle) + "Pole_LOC")
poleGrpName = (String.removeSuffix(ikHandle) + "Pole_GRP")
poleVecName = (String.removeSuffix(ikHandle) + "Pole_PVC")
loc = Lib.getFirst(cmds.spaceLocator(n = locName, p= (0,0,0) ))
cmds.xform(loc, ws= True, t= (position[0], position[1], position[2]) )
locGrp = cmds.group(loc, n= poleGrpName)
cmds.poleVectorConstraint( loc , ikHandle, n= poleVecName, w=.1 )
cmds.setAttr((loc + ".v"), 0)
return locGrp