2021-01-07 07:16:11 [Error] [carb.python] Failed to execute a command: CreatePrimCommand.
File "executing: Python 0...", line 3, in <module>
File "c:\users\rustr\appdata\local\ov\pkg\kit 100.1.0\_exts\omni.kit.commands\omni\kit\commands\command.py", line 177, in execute
return omni.kit.undo.execute(command, name, kwargs)
[...skipped...]
File "c:\users\rustr\appdata\local\ov\pkg\kit 100.1.0\_exts\omni.kit.commands\omni\kit\undo\undo.py", line 74, in execute
result = _execute(command, name, level, history_key)
File "c:\users\rustr\appdata\local\ov\pkg\kit 100.1.0\_exts\omni.kit.commands\omni\kit\undo\undo.py", line 314, in _execute
raise e
<class 'UnboundLocalError'> local variable 'e' referenced before assignment
Thank you for using Omniverse. Are you are just trying to create a prim (sphere) that can be displayed on the viewport? Looking for some background on your intent.
Not sure why that command is failing (we’ll take a look), but you probably want to use CreatePrimWithDefaultXformCommand.
A nice trick is to use the Command Utils extension to inspect and capture commands you are executing as you use the Kit UI. You can enable this extension from Extensions window:
Any commands you’ve executed (e.g. Create/Sphere) will show up in the command stack in this window. You can copy specific commands or the whole command stack as Python that’s executable in the script editor to your clipboard:
The scripting that you have problems with happens since you are using “Kit”. Kit requires additional scripting to build the infra needed to create prims. If you use “Create”, that infra is already present. Use the steps outlined in the previous response from @revl.