Questions about USD Commands in Python


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:
import omni.usd
import omni.usd.commands
import omni.kit.commands

orig_path = “/World/Acacia”
stage = omni.usd.get_context().get_stage()

print(“Copying start”)

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)

print(“Copying finished”)


Hello @hippo_family! I’ve shared your post with the dev team for further assistance.

I believe this one was answer here: Failure of USD Commands in Python

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.