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


Python CtrlSpace.xfo方法代码示例

本文整理汇总了Python中kraken.core.objects.ctrlSpace.CtrlSpace.xfo方法的典型用法代码示例。如果您正苦于以下问题:Python CtrlSpace.xfo方法的具体用法?Python CtrlSpace.xfo怎么用?Python CtrlSpace.xfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kraken.core.objects.ctrlSpace.CtrlSpace的用法示例。


在下文中一共展示了CtrlSpace.xfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: insertCtrlSpace

# 需要导入模块: from kraken.core.objects.ctrlSpace import CtrlSpace [as 别名]
# 或者: from kraken.core.objects.ctrlSpace.CtrlSpace import xfo [as 别名]
    def insertCtrlSpace(self, name=None):
        """Adds a CtrlSpace object above this object

        Args:
            name (string): optional name for this CtrlSpace, default is same as
                this object

        Returns:
            object: New CtrlSpace object

        """

        if name is None:
            name = self.getName()

        newCtrlSpace = CtrlSpace(name, parent=self.getParent())
        if self.getParent() is not None:
            self.getParent().removeChild(self)

        self.setParent(newCtrlSpace)
        newCtrlSpace.addChild(self)

        newCtrlSpace.xfo = Xfo(self.xfo)

        # To ensure that names of control spaces don't clash with controls and
        # if they do, set's the control space's name back to what it was intended
        if self.getName() == name:
            newCtrlSpace.setName(name)

        return newCtrlSpace
开发者ID:AbedSHP,项目名称:Kraken,代码行数:32,代码来源:control.py

示例2: addFinger

# 需要导入模块: from kraken.core.objects.ctrlSpace import CtrlSpace [as 别名]
# 或者: from kraken.core.objects.ctrlSpace.CtrlSpace import xfo [as 别名]
    def addFinger(self, name, data):

        fingerCtrls = []
        fingerJoints = []

        parentCtrl = self.handCtrl
        for i, joint in enumerate(data):
            if i == 0:
                jointName = name + 'Meta'
            else:
                jointName = name + str(i).zfill(2)

            jointXfo = joint.get('xfo', Xfo())
            jointCrvData = joint.get('curveData')

            # Create Controls
            newJointCtrlSpace = CtrlSpace(jointName, parent=parentCtrl)
            newJointCtrl = Control(jointName, parent=newJointCtrlSpace, shape='square')
            newJointCtrl.lockScale(True, True, True)
            newJointCtrl.lockTranslation(True, True, True)

            if jointCrvData is not None:
                newJointCtrl.setCurveData(jointCrvData)

            fingerCtrls.append(newJointCtrl)

            # Create Deformers
            jointDef = Joint(jointName, parent=self.defCmpGrp)
            fingerJoints.append(jointDef)

            # Create Constraints

            # Set Xfos
            newJointCtrlSpace.xfo = jointXfo
            newJointCtrl.xfo = jointXfo

            parentCtrl = newJointCtrl


        # =================
        # Create Operators
        # =================
        # Add Deformer KL Op
        deformersToCtrlsKLOp = KLOperator(name + 'DeformerKLOp', 'MultiPoseConstraintSolver', 'Kraken')
        self.addOperator(deformersToCtrlsKLOp)

        # Add Att Inputs
        deformersToCtrlsKLOp.setInput('drawDebug', self.drawDebugInputAttr)
        deformersToCtrlsKLOp.setInput('rigScale', self.rigScaleInputAttr)

        # Add Xfo Inputs
        deformersToCtrlsKLOp.setInput('constrainers', fingerCtrls)

        # Add Xfo Outputs
        deformersToCtrlsKLOp.setOutput('constrainees', fingerJoints)

        return deformersToCtrlsKLOp
开发者ID:AbedSHP,项目名称:Kraken,代码行数:59,代码来源:hand_component.py


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