I’ve tried to use USD commands based on the following documents.
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:
orig_path = “/World/Acacia”
stage = omni.usd.get_context().get_stage()
omni.usd.duplicate_prim(stage=stage, prim_path=orig_path, path_to=orig_path+“_usd_dup”, duplicate_layers=False)
omni.usd.commands.CopyPrimCommand(path_from=orig_path, path_to=orig_path+“_usd_cmd”, duplicate_layers=False)
omni.kit.commands.execute(“CopyPrim”, path_from=orig_path, path_to=orig_path+“_kit_cmd”, duplicate_layers=False)