本文整理汇总了Python中kraken.core.objects.control.Control.getVisibilityAttr方法的典型用法代码示例。如果您正苦于以下问题:Python Control.getVisibilityAttr方法的具体用法?Python Control.getVisibilityAttr怎么用?Python Control.getVisibilityAttr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kraken.core.objects.control.Control
的用法示例。
在下文中一共展示了Control.getVisibilityAttr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addFinger
# 需要导入模块: from kraken.core.objects.control import Control [as 别名]
# 或者: from kraken.core.objects.control.Control import getVisibilityAttr [as 别名]
def addFinger(self, name):
digitSizeAttributes = []
fingerGuideCtrls = []
firstDigitCtrl = Control(name + "01", parent=self.handCtrl, shape='sphere')
firstDigitCtrl.scalePoints(Vec3(0.125, 0.125, 0.125))
firstDigitShapeCtrl = Control(name + "Shp01", parent=self.guideCtrlHrcGrp, shape='square')
firstDigitShapeCtrl.setColor('yellow')
firstDigitShapeCtrl.scalePoints(Vec3(0.175, 0.175, 0.175))
firstDigitShapeCtrl.translatePoints(Vec3(0.0, 0.125, 0.0))
fingerGuideCtrls.append(firstDigitShapeCtrl)
firstDigitCtrl.shapeCtrl = firstDigitShapeCtrl
firstDigitVisAttr = firstDigitShapeCtrl.getVisibilityAttr()
firstDigitVisAttr.connect(self.ctrlShapeToggle)
triangleCtrl = Control('tempCtrl', parent=None, shape='triangle')
triangleCtrl.rotatePoints(90.0, 0.0, 0.0)
triangleCtrl.scalePoints(Vec3(0.025, 0.025, 0.025))
triangleCtrl.translatePoints(Vec3(0.0, 0.0875, 0.0))
firstDigitCtrl.appendCurveData(triangleCtrl.getCurveData())
firstDigitCtrl.lockScale(True, True, True)
digitSettingsAttrGrp = AttributeGroup("DigitSettings", parent=firstDigitCtrl)
digitSizeAttr = ScalarAttribute('size', value=0.25, parent=digitSettingsAttrGrp)
digitSizeAttributes.append(digitSizeAttr)
# Set Finger
self.fingers[name] = []
self.fingers[name].append(firstDigitCtrl)
parent = firstDigitCtrl
numJoints = self.numJointsAttr.getValue()
if name == "thumb":
numJoints = 3
for i in xrange(2, numJoints + 2):
digitCtrl = Control(name + str(i).zfill(2), parent=parent, shape='sphere')
if i != numJoints + 1:
digitCtrl.scalePoints(Vec3(0.125, 0.125, 0.125))
digitCtrl.appendCurveData(triangleCtrl.getCurveData())
digitShapeCtrl = Control(name + 'Shp' + str(i).zfill(2), parent=self.guideCtrlHrcGrp, shape='circle')
digitShapeCtrl.setColor('yellow')
digitShapeCtrl.scalePoints(Vec3(0.175, 0.175, 0.175))
digitShapeCtrl.getVisibilityAttr().connect(self.ctrlShapeToggle)
digitCtrl.shapeCtrl = digitShapeCtrl
if i == 2:
digitShapeCtrl.translatePoints(Vec3(0.0, 0.125, 0.0))
else:
digitShapeCtrl.rotatePoints(0.0, 0.0, 90.0)
fingerGuideCtrls.append(digitShapeCtrl)
# Add size attr to all but last guide control
digitSettingsAttrGrp = AttributeGroup("DigitSettings", parent=digitCtrl)
digitSizeAttr = ScalarAttribute('size', value=0.25, parent=digitSettingsAttrGrp)
digitSizeAttributes.append(digitSizeAttr)
else:
digitCtrl.scalePoints(Vec3(0.0875, 0.0875, 0.0875))
digitCtrl.lockScale(True, True, True)
self.fingers[name].append(digitCtrl)
parent = digitCtrl
# ===========================
# Create Canvas Operators
# ===========================
# Add Finger Guide Canvas Op
fingerGuideCanvasOp = CanvasOperator(name + 'FingerGuideOp', 'Kraken.Solvers.Biped.BipedFingerGuideSolver')
self.addOperator(fingerGuideCanvasOp)
# Add Att Inputs
fingerGuideCanvasOp.setInput('drawDebug', self.drawDebugInputAttr)
fingerGuideCanvasOp.setInput('rigScale', self.rigScaleInputAttr)
# Add Xfo Inputs
fingerGuideCanvasOp.setInput('controls', self.fingers[name])
fingerGuideCanvasOp.setInput('planeSizes', digitSizeAttributes)
# Add Xfo Outputs
fingerGuideCanvasOp.setOutput('result', fingerGuideCtrls)
fingerGuideCanvasOp.setOutput('forceEval', firstDigitCtrl.getVisibilityAttr())
return firstDigitCtrl