Save Selected doesn't echo in the Commands window

I need to replicate the behavior when selecting a Material and right-clicking “Save Selected” and saving as Material. Unfortunately, the Commands window is not echoing any of the commands called when executing that menu option.

Is there any way to know what function is being called in this instance? Or any other instance where nothing is output to the Command window?

Thanks for your question. So you are trying to get the code for saving an mdl ? Is that correct ?

Looking to save the material itself as usda



.

You want to save just one material as a usda file ? For what reason ? Normally you would save a material as a mdl. If you are looking to save all your materials in the looks folder as a single usd file, the easiest way is just to delete everything but the looks folder, then save the file as materials.usd

If you can explain your workflow, I can try to help, but I would not advise saving just one material as a usd file.

Hello! Have you found the relevant Python code? I would be very grateful if you could let me know.

Hello! If I want to export a specific prim as a USD and perform asset collection, similar to right-clicking ‘Save Selected’, my current requirement is to save each object in a complete USD scene as a separate USD file. I would greatly appreciate it if you could provide the corresponding code to implement this functionality.

Well like you said, you can just right click and use the “save selected”. That is the fastest way. However, normally, the workflow is the exact opposite. You have 15 objects, all separate usd files, and you use USD “Composer” (hence the name) to compose those 15 objects together into one usd scene. So you are trying to do this in reverse, and I am not understanding why. You already have a scene ready to go, but you want to break it down into each individual object ? For what reason ?