def repeat_command(function):
def wrapper(*args, **kwargs):
modules = ''
arguments = args
if [x for x in ['cls', 'self'] if x in function.func_code.co_varnames]:
arguments = args[1:]
modules = '%s.' % args[0]
args_string = ''
if args:
for each in arguments:
args_string = '%s, ' % each
kwargs_string = ''
if kwargs:
for key, item in kwargs.iteritems():
kwargs_string = '%s=%s, ' % (key, item)
ret = function(*args, **kwargs)
repeat_command = '%s%s(%s%s)' % (modules, function.__name__, args_string, kwargs_string)
if not args_string == '' and not kwargs_string == '':
repeat_command = '%s%s(%s, %s)' % (modules, function.__name__, args_string, kwargs_string)
pmc.repeatLast(addCommand='import qdTools\n%s\n' % repeat_command, addCommandLabel='qdCommand')
# try:
# pm.callLastCommand('python("import qdTools;%s")' % repeat_command)
# except:
# pass
return ret
return wrapper
'python("import qdTools;%s")' % repeat_command--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/16534d51-4209-4ce5-882f-2b8dbf976d38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def repeat_command(function):
def wrapper(*args, **kwargs):
modules = ''
arguments = args
if [x for x in ['cls', 'self'] if x in function.func_code.co_varnames]:
arguments = args[1:]
modules = '%s.' % args[0]
args_string = ''
if args:
for each in arguments:
args_string = '%s, ' % each
kwargs_string = ''
if kwargs:
for key, item in kwargs.iteritems():
kwargs_string = '%s=%s, ' % (key, item)
ret = function(*args, **kwargs)
repeat_command = '%s%s(%s%s)' % (modules, function.__name__, args_string, kwargs_string)
if not args_string == '' and not kwargs_string == '':
repeat_command = '%s%s(%s, %s)' % (modules, function.__name__, args_string, kwargs_string)
# pmc.repeatLast(addCommand='import qdTools\n%s\n' % repeat_command, addCommandLabel='qdCommand')
try:
pm.callLastCommand('python("import qdTools;%s")' % repeat_command)
except:
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3f639559-31c4-47fa-a7a7-630fe4cf1ab6%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/25df65fe-98e3-47ec-a654-1d0a3bf60f73%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7fc2fbae-3a95-46af-9c0e-25a895e606bd%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8c4690d9-7689-474c-92dc-89db526034b9%40googlegroups.com.