Class Project

The Project class manages load and unloading a project as well as other helper APIs to interact with a project.

Constructors

Accessors

  • get company(): string
  • The company that owns the project.

    Returns string

  • get hasAdministorUserRole(): boolean
  • Determines if the current user is an administrator on the project.

    Returns boolean

  • get hasDeploymentUserRole(): boolean
  • Determines if the current user has the deployment role on the project.

    Returns boolean

  • get hasEditorUserRole(): boolean
  • Determines if the current user is an editor on the project.

    Returns boolean

  • get isCloudSynced(): boolean
  • Determines if any project is currently loaded and it is cloud synchronized.

    Returns boolean

  • get isInitialCheckoutCompleted(): boolean
  • Determines if the initial project checkout is completed.

    Returns boolean

  • get isLoaded(): boolean
  • Determines if any project is currently loaded.

    Returns boolean

  • get title(): string
  • The currently loaded project title/name.

    Returns string

  • get uuid(): UUID
  • The currently loaded project UUID.

    Returns UUID

Methods

  • Contains a new project in the provided folder.

    Parameters

    • path: string

      Absolute path to the folder to create the project in. Name of this folder will be used as the project's name.

    Returns void

  • Creates a new local project that represents a RSX cloud project.

    Parameters

    • projectUUID: Const<UUID>

      The cloud project UUID.

    Returns void

  • Gets the default local path for storing RSX cloud projects.

    Returns FilePath

  • Gets the local path for a cloud project with the given project UUID.

    Parameters

    • projectUUID: Const<UUID>

      The web project UUID.

    Returns FilePath

  • Checks did we make any modifications to the scene since it was last saved.

    Returns boolean

    True if the scene was never saved, or was modified after last save.

  • Checks does the folder at the provided path contain a valid project.

    Parameters

    • path: string

      Absolute path to the root project folder.

    Returns boolean

    True if the folder contains a valid project.

  • Loads the project at the specified path. This method executes asynchronously.

    Parameters

    • projectFilePath: string

      Absolute path to the project's root folder.

    • OptionalcloudProject: CloudProject

    Returns boolean

  • Marks the current project dirty (requires saving in order for changes not to be lost).

    Returns void

  • Called by the runtime to update the project states.

    Returns void

  • Invoked by the runtime when the editor initialized.

    Returns void

  • Saves all data in the currently open project.

    Parameters

    • OptionalisSavingSettings: boolean

      If true, project settings will be saved as well.

    • OptionalisSavingScenes: boolean

    Returns boolean

  • Checks if any resource is modified and opens a dialog to save them if any. Once the user saves any resources he wishes, the next callback will be called. If the user choses to cancel, next will not be invoked.

    Parameters

    • next: (() => void)

      Callback to trigger when the user decides to continue.

        • (): void
        • Returns void

    • OptionalcustomMessage: string

      A custom message to be displayed on the window.

    • OptionalparentWindow: EditorWindow

      The parent window on which the dialog will be attached, will be the main window if null.

    Returns void

  • Changes the project state displayed on the status bar.

    Parameters

    • modified: boolean

      Whether to display the project as modified or not.

    Returns void

  • Unloads the currently loaded project, without making any checks or requiring confirmation.

    Returns boolean

Events

onLoad: Event<[], void>

Triggered after a new project is loaded.

onSave: Event<[], void>

Triggered right before the project is being saved.

onInitialCheckoutCompleted: Event<[], void>

Triggered when the initial checkout was completed.

The project might not be fully loaded yet.

onUnload: Event<[], void>

Triggered right before the project is unloaded.