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


Python PoseConstraint.setConstrainee方法代码示例

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


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

示例1: buildXfoConnection

# 需要导入模块: from kraken.core.objects.constraints.pose_constraint import PoseConstraint [as 别名]
# 或者: from kraken.core.objects.constraints.pose_constraint.PoseConstraint import setConstrainee [as 别名]
    def buildXfoConnection(self, kConnection):
        """Builds the connection between the xfo and the connection.

        Arguments:
        kConnection -- Object, kraken connection to build.

        Return:
        True if successful.

        """

        source = kConnection.getSource()
        target = kConnection.getTarget()

        if source is None or target is None:
            raise Exception("Component connection '" + kConnection.getName() + "'is invalid! Missing Source or Target!")

        constraint = PoseConstraint('_'.join([target.getName(), 'To', source.getName()]))
        constraint.setMaintainOffset(True)
        constraint.setConstrainee(target)
        constraint.addConstrainer(source)
        dccSceneItem = self.buildPoseConstraint(constraint)
        self._registerSceneItemPair(kConnection, dccSceneItem)

        return None
开发者ID:jhodgson,项目名称:Kraken,代码行数:27,代码来源:base_builder.py

示例2: buildXfoConnection

# 需要导入模块: from kraken.core.objects.constraints.pose_constraint import PoseConstraint [as 别名]
# 或者: from kraken.core.objects.constraints.pose_constraint.PoseConstraint import setConstrainee [as 别名]
    def buildXfoConnection(self, componentInput):
        """Builds the constraint between the target and connection target.

        Args:
            componentInput (object): kraken component input to build connections for.

        Returns:
            bool: True if successful.

        """

        if componentInput.isConnected() is False:
            return False

        connection = componentInput.getConnection()
        connectionTarget = connection.getTarget()
        inputTarget = componentInput.getTarget()

        if connection.getDataType().endswith('[]'):
            if componentInput.getIndex() > len(connection.getTarget()) - 1:

                inputParent = componentInput.getParent()
                inputParentDecoration = inputParent.getNameDecoration()
                fullInputName = inputParent.getName() + inputParentDecoration + "." + componentInput.getName()

                raise Exception(fullInputName + " index ("
                                + str(componentInput.getIndex()) + ") is out of range ("
                                + str(len(connection.getTarget()) - 1) + ")!")

            connectionTarget = connection.getTarget()[componentInput.getIndex()]
        else:
            connectionTarget = connection.getTarget()

        constraint = PoseConstraint('_'.join([inputTarget.getName(), 'To', connectionTarget.getName()]))
        constraint.setMaintainOffset(True)
        constraint.setConstrainee(inputTarget)
        constraint.addConstrainer(connectionTarget)

        dccSceneItem = self.buildPoseConstraint(constraint)
        self._registerSceneItemPair(componentInput, dccSceneItem)

        return True
开发者ID:hoorayfor3d,项目名称:Kraken,代码行数:44,代码来源:builder.py

示例3: Locator

# 需要导入模块: from kraken.core.objects.constraints.pose_constraint import PoseConstraint [as 别名]
# 或者: from kraken.core.objects.constraints.pose_constraint.PoseConstraint import setConstrainee [as 别名]
from kraken import plugins
from kraken.core.objects.locator import Locator
from kraken.core.objects.constraints.pose_constraint import PoseConstraint
from kraken.core.traverser.traverser import Traverser

locA = Locator("locatorA")
locB = Locator("locatorB")

constraint = PoseConstraint("A to B")
constraint.addConstrainer(locB)
constraint.setConstrainee(locA)

trav = Traverser()
trav.addRootItem(locA)

def callback(**args):
    item = args.get('item', None)
    print 'Visited '+item.getDecoratedPath()

trav.traverse(itemCallback = callback)
开发者ID:AbedSHP,项目名称:Kraken,代码行数:22,代码来源:constraints.py


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