本文整理汇总了Python中kraken.core.objects.control.Control.setParent方法的典型用法代码示例。如果您正苦于以下问题:Python Control.setParent方法的具体用法?Python Control.setParent怎么用?Python Control.setParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kraken.core.objects.control.Control
的用法示例。
在下文中一共展示了Control.setParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct
# 需要导入模块: from kraken.core.objects.control import Control [as 别名]
# 或者: from kraken.core.objects.control.Control import setParent [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