A path in the filesystem, or Asset Manager. Useful for things like importing files into Lens Studio through the Editor.Model.AssetManager.

// Get access to the project's assetManager
const model = this.pluginSystem.findInterface(Editor.Model.IModel);
const assetManager = model.project.assetManager;

// Locate the shader pass we want to import
const resourceLoc = import.meta.resolve('Resources/myMesh.ss_graph');
const absGraphPath = new Editor.Path(resourceLoc);

// Import the shader pass
const pathInAssetManager = new Editor.Path('');
const meta = await assetManager.importExternalFileAsync(absolutePath, pathInAssetManager, Editor.Model.ResultType.Packed);

Constructors

  • Construct a new path object.

    Parameters

    • str: string

    Returns Path

Properties

extension: string

The extension of the file of the current path object.

fileName: Path

The name of the file, including its extension, in the current path object.

fileNameBase: string

The name of the file, without its extension, in the current path object.

isEmpty: boolean
parent: Path

A path to the parent folder of the current path object.

Methods

  • Returns a new path object relative to the rootPath.

    Parameters

    Returns Path

  • Whether the path object has a file extension in the end.

    Parameters

    • extension: string

    Returns boolean

  • Whether the current path is inside directory.

    Parameters

    Returns boolean

  • Returns a new path object relative to the rootPath.

    Parameters

    Returns Path

  • Rename the extension of the file.

    Parameters

    • newExtension: string

    Returns Path

  • Parameters

    • name: string

    Returns Path

  • Returns the current path as a string.

    Returns string