ZBrushCentral

Zplugin:USD Format:Save set save location through zscript

Hi people of zbrushcentral!

My goal is to save out a bunch of subtools into a couple of different .usd files using zscript.

I’ve created a zscript that loops through folders and hides / unhides them in order to export their content as a .usd file with the new Zbrush USD Format plugin. However I ran into issues when trying to trigger the Zplugin:USD Format:Save button.
Since I’ve previously exported .obj I instinctively went to the [FileNameSetNext, #filepath] routine in order to pick a save location for the file. However when I ran [IPress, Zplugin:USD Format:Save] a filebrowser popped up. This isn’t a huge problem in itself since I can close it by running [IKeyPress, 13, [IPress, Zplugin:USD Format:Save]] in order to close it. Unfortunately the filepath of the dialog isn’t the same as the one set by FileNameSetNext .

Is there an alternative way to set the export filepath of a USD file? Or is there a completely different way to achive what I’m trying to do, like calling USD Format plugin content though ZFileUtils or something similar?

Thank you for reading :slight_smile:

hi @ErikEast
Unfortunately at the moment you IPress on on a different plugin( Zplugin:USD Format:Save), the hand pass to that script and your script stop his process.
So as long as you import and all the code run from your own script that, works fine.

Hope it helps
Nicolas

Thank you for your answer @facelessmindz
Ok so if I understand it correctly. You can’t click other plugins interfaces through your own.
Is there any way other way to access the functions Zplugin:USD Format:Save triggers? So exporting USD without using the plugin buttons? Or can USD export from Zbrush currently only be done manually?

I give a look at the directory where all stuff about USD format plugin is stored. it seems to use the goz format, you have some compiled plugin with zsc format. but it exactly the same as if you run it via you script. you can’t to defined the filepath. i check usd_format.exe in my terminal but there is no help at all, and passing file as argument do not works too.
so if you can use another file format and convert to usd using a different toolset as USD iis open source and you can get the code on [github].(https://github.com/PixarAnimationStudios/USD)

That’s unfortunate. I’m currently using a solution like you are suggesting. Was hoping to move to using USD directly from Zbrush. Hopefully we will be able to in the future. Thank you for your help @facelessmindz!

I agree that this is quite unfortunate.

I would love to be able to do this via ZScripting - has anything changed since to be able to set the export path and perform the export automatically via script without dialogs?