Basic tutorials on coding content creation?

I’m trying to dive, head first, into Omniverse Code. However I find it tricky as there doesn’t seem to be many tutorials out there.

I thought I should make a room generator where you can type in your measures and have a standard empty room generated with windows, doors floorboards etc. in the right places.

As far as I understand I should head to Omniverse Code, and I have found the template that creates a window with two buttons. What I miss is a tutorial showing the basics in content creating code. I managed to create a cube, but I have a problem to translate is more than once. Which libraries are involved.? Can anyone point me in the right direction?

Hi @laban. I created a tutorial series about programmatically creating content with USD. I think you might find it helpful for what you’re wanting to do: Hit the USD Books in this Metaverse Coding Series | by NVIDIA Omniverse | Medium

1 Like

Thanks. I started to watch and create at the same time, but it’s a bit overwhelming to begin with. I’m struggling with the simplest tasks. It seems like the way to go is to copy the commands from the commands window, but then everything begins with execute(‘some command name’).

Just renaming an object would be

omni.kit.commands.execute('MovePrims',
	paths_to_move={'/World/Cube_01': '/World/test'},
	on_move_fn=<function PrimNameModel.end_edit.<locals>.prim_renamed at 0x000001C6A6ABB798>,
	destructive=False)

It’s all very cumbersome. Isn’t there another API with shorter commands, something like SetPath, SetName, Rename or something? Maybe it would become more clear if I were to watch the entire series first. As of now I feel that I am heading off the wrong way. Is there an even more basic tutorial to begin with?

Hi @laban. You can use the USD API directly if you prefer. I do that too in the video series. The advantage of the Kit Commands is that it gives you the ability to undo. Here are some examples of using the USD API directly: USD — Omniverse Kit documentation

Ok. Will give it a try. Do you know right away how to rename an object? The search function in the doc doesn’t give much support.

Hi @laban. We have a Kit Command for that called MovePrim. You can see an example here: developer-office-hours/exts/maticodes.doh_2022_08_12/scripts/create_group_anywhere.py at df3da24da3fc86ffcb1de30cdfc279d3d5de3bbe · mati-nvidia/developer-office-hours · GitHub