FileMenuExtension

class omni.kit.menu.file.scripts.file.FileMenuExtension

Bases: IExt

A class that extends the Omniverse Kit editor with file menu functionalities.

This class provides enhanced file operation capabilities within the Omniverse Kit editor’s file menu, including the ability to handle recent files, save and open scenes, and manage USD stage events. It is responsible for registering file actions, constructing the file menu, and updating the recent files list based on file events.

Methods

__init__()

Initializes the FileMenuExtension.

can_close()

Checks if the USD stage is in a state where it can be closed.

can_close_and_not_is_new_stage()

Checks if the USD stage can be closed and is not a new, unsaved stage.

can_open()

Checks if the USD stage is in a state where it can be opened.

can_save()

Checks if the USD stage is in a state where it can be saved.

is_new_stage()

Determines if the current USD stage is a new, unsaved stage.

on_shutdown()

Handles the shutdown event for the FileMenuExtension.

on_startup(ext_id)

Handles the startup event for the FileMenuExtension.

__init__()

Initializes the FileMenuExtension.

static can_close()

Checks if the USD stage is in a state where it can be closed.

Returns

True if the stage can be closed, False otherwise.

Return type

bool

static can_close_and_not_is_new_stage()

Checks if the USD stage can be closed and is not a new, unsaved stage.

Returns

True if the stage can be closed and is not new, False otherwise.

Return type

bool

static can_open()

Checks if the USD stage is in a state where it can be opened.

Returns

True if the stage can be opened, False otherwise.

Return type

bool

static can_save()

Checks if the USD stage is in a state where it can be saved.

Returns

True if the stage can be saved, False otherwise.

Return type

bool

static is_new_stage()

Determines if the current USD stage is a new, unsaved stage.

Returns

True if the stage is new and unsaved, False otherwise.

Return type

bool

on_shutdown()

Handles the shutdown event for the FileMenuExtension. It cleans up menus and deregisters actions.

on_startup(ext_id)

Handles the startup event for the FileMenuExtension. It sets up the file menu, recent files menu, and stage change event handlers.

Parameters

ext_id (str) – The identifier for the extension.