omni.kit.file module

USD File interaction for Omniverse Kit.

omni.kit.file provides util functions to new/open/save/close USD files. It handles file picking dialog and prompt for unsaved stage.

Now also an extension2.0. This version is now depreciated

class omni.kit.file.CheckBoxStatus(checkbox, layer_identifier, layer_is_writable)

Bases: object

class omni.kit.file.Prompt(title, text, ok_button_text='OK', cancel_button_text=None, ok_button_fn=None, cancel_button_fn=None)

Bases: object

hide()
is_visible()
set_cancel_fn(on_cancel_button_clicked)
set_confirm_fn(on_ok_button_clicked)
set_text(text)
show()
class omni.kit.file.StageSaveDialog(has_dont_save_button=False, on_save_fn=None, on_dont_save_fn=None, on_cancel_fn=None)

Bases: object

is_visible()
show(layer_identifiers=None)
omni.kit.file.close(on_closed=None)
omni.kit.file.new(template=None)

Create a new USD stage. If currently opened stage is dirty, a prompt will show to let you save it.

omni.kit.file.open()

Bring up a file picker to choose a USD file to open. If currently opened stage is dirty, a prompt will show to let you save it.

omni.kit.file.open_stage(path)
omni.kit.file.prompt_if_unsaved_stage(job)

Check if current stage is dirty. If it’s dirty, it will ask if to save the file, then execute job. Otherwise it runs job directly.

omni.kit.file.reopen()

Reopen currently opened stage. If the stage is dirty, a prompt will show to let you save it.

omni.kit.file.save(on_save_done=None, exit=False)

Save currently opened stage to file. Will call Save As for a newly created stage

omni.kit.file.save_as(flatten, on_save_done=None)

Bring up a file picker to choose a file to save current stage to.

omni.kit.file.shutdown()
omni.kit.file.startup()