Overview
The features and capabilities of Lens Studio can be extended through plugins. In fact, many of the presets, panels, and other behaviors in Lens Studio are made through a plugin. Plugins can be made by anyone, or downloaded from the Asset Library.
Lens Studio plugins can do many things, from adding new automation features like optimizing projects and automatically checking git status, to creating new types of presets that simplify repetitive tasks, to integrating external services into Lens Studio through HTTP requests and remote API calls (like the Figma plugin), and even introducing entirely new modes of creative channels (such as GenAi plugins that allow you to create textures and models using AI features).
Plugins is made by using the Editor API, which allows develoeprs to access certain Lens Studio features and extend its functionality to tailor different workflows. It uses JavaScript, similar to Lens scripting. Take a look at the development guide to learn more!
We are also constantly adding new features to our Editor API, so if you have exciting new ideas for plugins, or want to explore new possibilities, feel free to reach out!
Installing or Removing a Plugin
There are two ways to install a plugin:
- Asset Library: These are plugins that are downloadable like other assets in Lens Studio.
- Local Installation: These are plugins which you have the files for, and are added directly through your computer. Often because you are developing them, or beacuse it is a custom tailored plugin for your or your team's workflow.
Asset Library
The Asset Library can be accessed via the top-left corner of Lens Studio (looks like colorful boxes). The Asset Library is your one-stop-shop for all your Lens development needs, including plugins.
Once you have the Asset Library
open, locate the Plugin section on the left sidebar.
To install a plugin, hover over the asset, and click the Install
button.
For plugins offering multiple versions, you can find other available versions by clicking the three-dot icon in the top-right corner.
To uninstall a plugin that was installed through the Asset Library, click the three-dot icon in the corner menu and select the Remove button, which is located in the same menu as the Install another version
option.
Local Installation
Local installation is often used when actively developing a plugin or using plugins that are not available through the Asset Library yet.
To install a local plugin, navigate to the Preference
menu (Lens Studio -> Preferences) and select the Plugins
from the left sidebar of the Preferences
window.
Click the + Add New Location
button and select the directory containing the plugin's main folder.
When adding a directory to the Additional libraries
list, make sure not to select the directory that directly contains the module.json
file. Instead, choose a directory that is at least one level above the directory with the module.json
file.
In other words, the selected directory should be a parent or ancestor directory of the directory containing the module.json
file, not the direct directory itself.
The plugin will appear in the Installed Plugins
list below. Each plugin has a checkbox next to its name, which you can use to disable or enable the plugin. Disabling and then enabling a plugin will refresh it, allowing any changes made to its code to take effect.
To remove a plugin that was added through local installation, simply remove the directory from the Additional Libraries
list by clicking the x
button on the right side of the entry. If you want to temporarily disable the plugin without removing it, you can uncheck the checkbox next to the plugin's name.
Using a Plugin
Since a plugin is extending the behavior of Lens Studio, how it is activated can be various. Currently, there are five major types of plugins.
Core Service
Core service plugins run automatically when Lens Studio starts and do not require manual activation. These plugins may alter or add new features to Lens Studio, depending on the unique functionality provided by the installed plugin.
For example: in the Asset Library, you can find the Find Usage
plugin, which adds a contextual menu to the Asset Browser
panel, allowing you to find usage of the selected assets in the project.
Presets
Preset plugins add new preset types to the + Component
list, + Scene Object
list, or + Asset
list. There are three types of Preset plugins:
- Component Presets: These can be found by clicking the
+ Add Component
button in theInspector
panel of any scene object. - Scene Object Presets: These can be accessed by clicking the
+
button in the top-left corner of theScene Hierarchy
panel. - Asset Presets: These can be found by clicking the
+
button in the top-left corner of theAsset Browser
panel.
Panel, Dialog, or Screen Plugins
Panel, Dialog, and Screen plugins feature a user interface. To access these plugins, navigate to the Window menu on the status bar and select the newly added plugin entry. Clicking the plugin's name will launch its dedicated interface.
Developing Your Own Plugins
Creating your own plugins can significantly enhance your lens creation process and be a fun and rewarding experience. To get started, check out our comprehensive guide, Plugins Development section or explore the open-source example plugins we have provided.
You can also use the Yeoman Generator to accelerate your plugin development process.