Yes of course!

I past the cleaned script that works for me.
If you have problems with the one made me know. If I find problems with and 
I corrected them I'll post an update.

It's just a version corrected and with a vocabulary adapted to my scripts. 
Otherwise it is the same as the link

#-----------------------------------------------------------------
#   REPEAT COMMAND
#-----------------------------------------------------------------

import pymel.core as pmc

_repeat_function = None
_args = None
_kwargs = None


def repeat_command():

    if _repeat_function is not None:
        _repeat_function(*_args, **_kwargs)


    def wrap(function):
        def wrapper(*args, **kwargs):

            global _repeat_function
            global _args
            global _kwargs

            _repeat_function = function
            _args = args
            _kwargs = kwargs

            commandToRepeat = ('python("%s.repeat_command()")' % __name__)

            ret = function(*args, **kwargs)

            pmc.repeatLast(addCommand=commandToRepeat, 
addCommandLabel=function.__name__)

            return ret
        return wrapper
    return wrap

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/7fc2fbae-3a95-46af-9c0e-25a895e606bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to