register_all_commands_in_module

omni.kit.commands.register_all_commands_in_module(module)

Register all Commands found in specified module.

Register all classes in module which inherit omni.kit.commands.Command.

Parameters

module – Module name or module object.

Returns

An accessor object that contains a function for every command to execute it. e.g. if you register the commands “Run” and “Hide” then the accessor behaves like:

class Accessor:
    @staticmethod
    def Run(\*\*kwargs):
        execute("Run", \*\*kwargs)
    @staticmethod
    def Hide(\*\*kwargs):
        execute("Hide", \*\*kwargs)

This gives you a nicer syntax for running your commands:

cmds = register_all_commands_in_module(module)
cmds.Run(3.14)
cmds.Hide("Behind the tree")