def one_undo(func):
"""Decorator - guarantee close chunk.
type: (function) -> function
"""
@wraps(func)
def wrap(*args, **kwargs):
# type: (*str, **str) -> None
try:
cmds.undoInfo(openChunk=True)
return func(*args, **kwargs)
except Exception as e:
raise e
finally:
cmds.undoInfo(closeChunk=True)
return wrap
评论列表
文章目录