本文整理汇总了Python中pymel.internal.pmcmds.setParent函数的典型用法代码示例。如果您正苦于以下问题:Python setParent函数的具体用法?Python setParent怎么用?Python setParent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setParent函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: pop
def pop(self):
"""
set the default parent to the parent of this layout
"""
p = self.parent()
cmds.setParent(p)
return p
开发者ID:eahneahn,项目名称:pymel,代码行数:7,代码来源:uitypes.py
示例2: __exit__
def __exit__(self, type, value, traceback):
global _withParentStack
_withParentStack.pop()
if _withParentStack:
parent = _withParentStack[-1]
else:
parent = self.pop()
while parent and objectTypeUI(parent) == u'rowGroupLayout':
parent = parent.pop()
cmds.setParent(parent)
开发者ID:eahneahn,项目名称:pymel,代码行数:10,代码来源:uitypes.py
示例3: __exit__
def __exit__(self, type, value, traceback):
p = self.parent()
#Ensure we set the parent back to a layout not some ui element
# like say a button which does not accept children
if not cmds.layout(p, exists=True):
p = p.parent()
#However we want to be careful not to attach to a rowGroupLayout(textFieldButtonGrp etc)
# in this case set the parent to the rowGroupLayout's parent
if cmds.objectTypeUI(p) == u'rowGroupLayout':
p = p.parent()
cmds.setParent(p)
return p
开发者ID:adamcobabe,项目名称:pymel,代码行数:13,代码来源:uitypes.py
示例4: __exit__
def __exit__(self, type, value, traceback):
global _withParentMenuStack
_withParentMenuStack.pop()
if _withParentMenuStack:
cmds.setParent(_withParentMenuStack[-1], menu=True)
else:
parent = self
while True:
parent = parent.parent()
try:
cmds.setParent(parent, menu=True)
except RuntimeError:
continue
break
开发者ID:tbarbieri,项目名称:pymel,代码行数:14,代码来源:uitypes.py
示例5: menu
def menu(*args, **kwargs):
"""
Modifications
- added ability to query parent
"""
if _versions.current() < _versions.v2011:
# on create only
if not ( kwargs.get('query', False) or kwargs.get('q', False) ) \
and not ( kwargs.get('edit', False) or kwargs.get('e', False) ) \
and not ( kwargs.get('parent', False) or kwargs.get('p', False) ):
kwargs['parent'] = cmds.setParent(q=1)
if ( kwargs.get('query', False) or kwargs.get('q', False) ) \
and ( kwargs.get('parent', False) or kwargs.get('p', False) ):
name = unicode(args[0])
if '|' not in name:
try:
name = _findLongName(name, 'menu')
except ValueError:
name = _findLongName(name, 'popupMenu')
return name.rsplit('|',1)[0]
result = cmds.menu(*args, **kwargs)
if ( kwargs.get('query', False) or kwargs.get('q', False) ) \
and ( kwargs.get('itemArray', False) or kwargs.get('ia', False) ) \
and result is None:
result = []
return result
开发者ID:CountZer0,项目名称:pymel,代码行数:29,代码来源:windows.py
示例6: setParent
def setParent(*args, **kwargs):
"""
Modifications
- returns None object instead of the string 'NONE'
"""
import uitypes
result = cmds.setParent(*args, **kwargs)
if kwargs.get('query', False) or kwargs.get('q', False):
if result == 'NONE':
result = None
else:
result = uitypes.PyUI(result)
return result
开发者ID:CountZer0,项目名称:pymel,代码行数:13,代码来源:windows.py
示例7: menu
def menu(*args, **kwargs):
"""
Modifications
- added ability to query parent
"""
if _versions.current() < _versions.v2011:
# on create only
if not ( kwargs.get('query', False) or kwargs.get('q', False) ) \
and not ( kwargs.get('edit', False) or kwargs.get('e', False) ) \
and not ( kwargs.get('parent', False) or kwargs.get('p', False) ):
kwargs['parent'] = cmds.setParent(q=1)
if ( kwargs.get('query', False) or kwargs.get('q', False) ) \
and ( kwargs.get('parent', False) or kwargs.get('p', False) ):
name = unicode(args[0])
if '|' not in name:
name = _findLongName(name, 'menu')
return name.rsplit('|',1)[0]
return cmds.menu(*args, **kwargs)
开发者ID:kinetifex,项目名称:pymel,代码行数:20,代码来源:windows.py
示例8: menu
def menu(*args, **kwargs):
"""
Modifications
- added ability to query parent
"""
if _versions.current() < _versions.v2011:
# on create only
if (
not (kwargs.get("query", False) or kwargs.get("q", False))
and not (kwargs.get("edit", False) or kwargs.get("e", False))
and not (kwargs.get("parent", False) or kwargs.get("p", False))
):
kwargs["parent"] = cmds.setParent(q=1)
if (kwargs.get("query", False) or kwargs.get("q", False)) and (
kwargs.get("parent", False) or kwargs.get("p", False)
):
name = unicode(args[0])
if "|" not in name:
name = _findLongName(name, "menu")
return name.rsplit("|", 1)[0]
return cmds.menu(*args, **kwargs)
开发者ID:simulus,项目名称:pymel,代码行数:23,代码来源:windows.py
示例9: makeDefault
def makeDefault(self):
"""
set this layout as the default parent
"""
cmds.setParent(self, menu=True)
开发者ID:eahneahn,项目名称:pymel,代码行数:5,代码来源:uitypes.py
示例10: currentParent
def currentParent():
"shortcut for ``ui.PyUI(setParent(q=1))`` "
return _uitypes.PyUI(cmds.setParent(q=1))
开发者ID:simulus,项目名称:pymel,代码行数:3,代码来源:windows.py
示例11: __exit__
def __exit__(self, type, value, traceback):
p = self.parent()
cmds.setParent(p,menu=True)
return p
开发者ID:simulus,项目名称:pymel,代码行数:4,代码来源:uitypes.py
示例12: __enter__
def __enter__(self):
cmds.setParent(self,menu=True)
return self
开发者ID:simulus,项目名称:pymel,代码行数:3,代码来源:uitypes.py
注:本文中的pymel.internal.pmcmds.setParent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论