当前位置: 首页>>代码示例>>Python>>正文


Python Lib.getFirst方法代码示例

本文整理汇总了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
开发者ID:jwnwilson,项目名称:nw_rig,代码行数:9,代码来源:Control.py

示例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
开发者ID:jwnwilson,项目名称:nw_rig,代码行数:9,代码来源:Control.py

示例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
开发者ID:jwnwilson,项目名称:nw_rig,代码行数:10,代码来源:Control.py

示例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
开发者ID:jwnwilson,项目名称:nw_rig,代码行数:11,代码来源:Control.py

示例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
开发者ID:jwnwilson,项目名称:nw_maya,代码行数:15,代码来源:joint.py

示例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)
开发者ID:jwnwilson,项目名称:nw_maya,代码行数:40,代码来源:file.py

示例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
开发者ID:jwnwilson,项目名称:nw_rig,代码行数:21,代码来源:Control.py


注:本文中的Lib.getFirst方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。