def buttonCommand(func, *args, **kwargs):
"""
Return a function that can be called which will execute
the given function with proper undo chunk handling.
"""
def wrapper():
cmds.undoInfo(openChunk=True)
try:
func(*args, **kwargs)
except Exception as e:
print(e)
finally:
cmds.undoInfo(closeChunk=True)
return wrapper
评论列表
文章目录