Skip to content
Discussion options

You must be logged in to vote

Based on the documentation for the omni.kit.window.file module, you can use the save_as() function to achieve the same result as the "Save Flattened As" option in the GUI.

The save_as() function takes a flatten parameter, which is a boolean. By setting flatten=True, you can save the current stage as a single, flattened USD file.

Here's the function signature:
omni.kit.window.file.save_as(flatten, on_save_done: Callable[[bool, str], None] | None = None)
For a simple script, you would likely use it like this:

import omni.kit.window.file

# This will bring up a file picker dialog to choose where to save
omni.kit.window.file.save_as(flatten=True)

For more information, you can refer to the of…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dongzhue
Comment options

Answer selected by dongzhue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants