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


Python Control.jsonDecode方法代码示例

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


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

示例1: construct

# 需要导入模块: from kraken.core.objects.control import Control [as 别名]
# 或者: from kraken.core.objects.control.Control import jsonDecode [as 别名]

#.........这里部分代码省略.........
            item = AttributeGroup(jsonData['name'])

        elif "BoolAttribute" in jsonData['__typeHierarchy__']:
            item = BoolAttribute(jsonData['name'])

        elif "ScalarAttribute" in jsonData['__typeHierarchy__']:
            item = ScalarAttribute(jsonData['name'])

        elif "IntegerAttribute" in jsonData['__typeHierarchy__']:
            item = IntegerAttribute(jsonData['name'])

        elif "StringAttribute" in jsonData['__typeHierarchy__']:
            item = StringAttribute(jsonData['name'])

        elif "ComponentInput" in jsonData['__typeHierarchy__']:
            item = ComponentInput(jsonData['name'])

        elif "ComponentOutput" in jsonData['__typeHierarchy__']:
            item = ComponentOutput(jsonData['name'])

        # ============
        # Constraints
        # ============
        elif "OrientationConstraint" in jsonData['__typeHierarchy__']:
            item = OrientationConstraint(jsonData['name'])

        elif "PoseConstraint" in jsonData['__typeHierarchy__']:
            item = PoseConstraint(jsonData['name'])

        elif "PositionConstraint" in jsonData['__typeHierarchy__']:
            item = PositionConstraint(jsonData['name'])

        elif "ScaleConstraint" in jsonData['__typeHierarchy__']:
            item = ScaleConstraint(jsonData['name'])

        elif "BaseConstraint" in jsonData['__typeHierarchy__']:
            item = BaseConstraint(jsonData['name'])


        # ==========
        # Operators
        # ==========
        elif "KLOperator" in jsonData['__typeHierarchy__']:
            item = KLOperator(jsonData['name'])

        # ============
        # Scene Items
        # ============
        elif "Group" in jsonData['__typeHierarchy__']:
            item = Group(jsonData['name'])

        elif "Null" in jsonData['__typeHierarchy__']:
            item = Null(jsonData['name'])

        elif "Chain" in jsonData['__typeHierarchy__']:
            item = Chain(jsonData['name'])

        elif "Joint" in jsonData['__typeHierarchy__']:
            item = Joint(jsonData['name'])

        elif "Container" in jsonData['__typeHierarchy__']:
            item = Container(jsonData['name'])

        elif "Curve" in jsonData['__typeHierarchy__']:
            item = Curve(jsonData['name'])

        elif "HierarchyGroup" in jsonData['__typeHierarchy__']:
            item = HierarchyGroup(jsonData['name'])

        elif "Joint" in jsonData['__typeHierarchy__']:
            item = Joint(jsonData['name'])

        elif "Layer" in jsonData['__typeHierarchy__']:
            item = Layer(jsonData['name'])

        elif "Locator" in jsonData['__typeHierarchy__']:
            item = Locator(jsonData['name'])

        elif "SceneItem" in jsonData['__typeHierarchy__']:
            item = SceneItem(jsonData['name'])

        else:
            raise Exception("KrakenLoader does not support the given type:" + jsonData['__typeHierarchy__'])

        # Before registering or decoding, set the parent so that the full name contains the entire path.
        if len(self.parentItems) > 0:
            item.setParent(self.parentItems[-1])

        self.registerItem(item)
        # Store the item as the parent item before decoding the object
        # which in turn decodes the children items.
        self.parentItems.append(item)

        item.jsonDecode(self, jsonData)

        # Pop the parent item stack, which reverts the current parent item
        # to the previous value.
        self.parentItems.pop()

        return item
开发者ID:Leopardob,项目名称:Kraken,代码行数:104,代码来源:kraken_loader.py


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