However, I found that the USD commands cannot be executed without any warnings and errors.
I have used “CopyPrimCommand” as an example in the following script. Copying prim has been executed with 3 different commands, i.e. “omni.usd.duplicate_prim”, “omni.usd.commands.CopyPrimCommand”, and “omni.kit.commands.execute”. The USD command doesn’t work.
The script I have used:
Hi @hippo_family. omni.kit.commands.execute is the correct way to call the command.
Creating an object of the command like you did in the second case does not execute the command. You need to call the do() function of the command object. You generally don’t want to do that though because it bypasses the Command history.