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