rojo/.cursor/rules/roblox/reference/engine/classes/Plugin.yaml
2026-02-02 12:08:47 -06:00

1014 lines
31 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: Plugin
type: class
memory_category: Instances
summary: ''
description: |
`Plugin` is the main object responsible for creating custom Studio widgets,
plugin toolbars, plugin buttons, and more. The `Plugin` object can be accessed
through the `Global.RobloxGlobals.plugin` global reference in a `Class.Script`
that is executed as a plugin.
code_samples:
- Plugin-Global-Pass
- Plugin-Global-Receive
inherits:
- Instance
descendants: []
tags:
- NotCreatable
deprecation_message: ''
properties:
- name: Plugin.CollisionEnabled
summary: |
Returns whether the user has enabled **Collisions** in Studio's toolbar.
description: |
Returns whether the user has enabled **Collisions** in Studio's toolbar.
code_samples: []
type: boolean
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: false
can_save: false
capabilities: []
- name: Plugin.DisableUIDragDetectorDrags
summary: ''
description: ''
code_samples: []
type: boolean
tags: []
deprecation_message: ''
security:
read: RobloxScriptSecurity
write: RobloxScriptSecurity
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities: []
- name: Plugin.GridSize
summary: |
Returns the grid snapping size the user has set in Studio.
description: |
Returns the grid snapping size the user has set in Studio's toolbar. Note
that this property may have slight rounding errors; for example it may be
`0.0099999997764826` for a user setting of `0.01`, or `0.4000000059604645`
for a user setting of `0.4`.
code_samples: []
type: float
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Data
serialization:
can_load: false
can_save: false
capabilities: []
- name: Plugin.IsDebuggable
summary: ''
description: ''
code_samples: []
type: boolean
tags: []
deprecation_message: ''
security:
read: RobloxScriptSecurity
write: RobloxScriptSecurity
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities: []
methods:
- name: Plugin:Activate
summary: |
Sets the state of the calling plugin to activated.
description: |
This method sets the state of the calling plugin to activated. Activating
the plugin allows mouse control through the
`Class.Plugin:GetMouse()|GetMouse()` method.
At any given time, there are either 0 or 1 activated plugins. Activating a
plugin will deactivate all other plugins and they will receive a
`Class.Plugin.Deactivation|Deactivation` event.
#### See Also
- `Class.Plugin:IsActivatedWithExclusiveMouse()|IsActivatedWithExclusiveMouse()`
which returns `true` if the plugin is currently active with an exclusive
mouse, after having been activated via this method.
- `Class.Plugin.Unloading|Unloading` which fires immediately before the
plugin is unloaded or reloaded via uninstallation, deactivation, or
updating.
code_samples: []
parameters:
- name: exclusiveMouse
type: boolean
default:
summary: |
A boolean specifying whether to activate the plugin with exclusive
mouse. If `true`, a `Class.PluginMouse` can be retrieved via
`Class.Plugin:GetMouse()|GetMouse()`.
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:CreateDockWidgetPluginGuiAsync
summary: |
Creates a `Class.DockWidgetPluginGui` given a
`Datatype.DockWidgetPluginGuiInfo`.
description: |
This method creates a new `Class.DockWidgetPluginGui` from the given
`Datatype.DockWidgetPluginGuiInfo`. The first parameter, `pluginGuiId`,
should be a unique and consistent string. It is used to save the state of
the widget's dock state and other internal details.
code_samples:
- DockWidgetPluginGui-Hello-World-Example
parameters:
- name: pluginGuiId
type: string
default:
summary: |
A unique and consistent identifier used to storing the widget's dock
state and other internal details.
- name: dockWidgetPluginGuiInfo
type: DockWidgetPluginGuiInfo
default:
summary: |
Describes the `Class.DockWidgetPluginGui` to create (initial state,
size, etc).
returns:
- type: DockWidgetPluginGui
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:CreateDockWidgetPluginGui
summary: |
Creates a `Class.DockWidgetPluginGui` given a
`Datatype.DockWidgetPluginGuiInfo`.
description: ''
code_samples: []
parameters:
- name: pluginGuiId
type: string
default:
summary: |
A unique and consistent identifier used to storing the widget's dock
state and other internal details.
- name: dockWidgetPluginGuiInfo
type: DockWidgetPluginGuiInfo
default:
summary: |
Describes the `Class.DockWidgetPluginGui` to create (initial state,
size, etc).
returns:
- type: DockWidgetPluginGui
summary: ''
tags:
- Yields
- Deprecated
deprecation_message: |
This method has been superseded by
`Class.Plugin:CreateDockWidgetPluginGuiAsync()|CreateDockWidgetPluginGuiAsync()`.
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:CreatePluginAction
summary: |
Creates a `Class.PluginAction` which represents a generic performable
action in Studio with no directly‑associated `Class.PluginToolbarButton`.
description: |
This method creates a `Class.PluginAction` which represents a generic
performable action in Studio with no directly‑associated
`Class.PluginToolbarButton`.
See also `Class.Plugin:CreatePluginMenu()|CreatePluginMenu()` which
creates a Studio `Class.PluginMenu` that can display a list of
`Class.PluginAction|PluginActions`.
code_samples:
- creating-a-pluginaction
parameters:
- name: actionId
type: string
default:
summary: |
Must be a unique string that identifies this PluginAction from others.
- name: text
type: string
default:
summary: |
The displayed name of the action.
- name: statusTip
type: string
default:
summary: |
The displayed description of the action.
- name: iconName
type: string
default:
summary: |
The name of the icon used to display the plugin.
- name: allowBinding
type: boolean
default: true
summary: |
Whether the `Class.PluginAction` will be hidden from Studio's
shortcuts view. Useful for contextual actions. Defaults to true.
returns:
- type: PluginAction
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:CreatePluginMenu
summary: |
Creates a new plugin menu.
description: |
This function creates a new `Class.PluginMenu` which is a context menu
that can be shown in Studio that displays a list of
`Class.PluginAction|PluginActions` and also supports submenus.
code_samples:
- creating-a-pluginaction-and-pluginmenu
parameters:
- name: id
type: string
default:
summary: |
Unique ID for the menu.
- name: title
type: string
default:
summary: |
The text to be displayed when used as a submenu.
- name: icon
type: string
default:
summary: |
The icon to be displayed when used as a submenu.
returns:
- type: PluginMenu
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:CreateToolbar
summary: |
Creates a new `Class.PluginToolbar` with the given name.
description: |
This method creates a new `Class.PluginToolbar` with the given name. The
toolbar can then be used to create plugin buttons.
code_samples:
- Plugin-CreateToolbar1
parameters:
- name: name
type: string
default:
summary: |
The visible text on the toolbar, labeling the group of buttons
contained within.
returns:
- type: PluginToolbar
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:Deactivate
summary: |
Deactivates the plugin.
description: |
Deactivates the plugin. This will disengage the associated
`Class.PluginMouse` if it has been activated.
#### See Also
- `Class.Plugin:Activate()|Activate()` which sets the state of the calling
plugin to activated.
- `Class.Plugin.Deactivation|Deactivation` which fires when the plugin is
deactivated.
- `Class.Plugin.Unloading|Unloading` which fires immediately before the
plugin is unloaded or reloaded via uninstallation, deactivation, or
updating.
code_samples: []
parameters: []
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:GetJoinMode
summary: |
Returns the `Enum.JointCreationMode` the user has set in Studio's toolbar.
description: |
Returns the `Enum.JointCreationMode` the user has set in Studio's toolbar.
code_samples: []
parameters: []
returns:
- type: JointCreationMode
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:GetMouse
summary: |
Returns a `Class.Mouse` that can be used while the plugin is active.
description: |
This method returns a `Class.PluginMouse` that can be used while the
plugin is active through `Class.Plugin:Activate()|Activate()`.
code_samples:
- Plugin-GetMouse1
parameters: []
returns:
- type: PluginMouse
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:GetSelectedRibbonTool
summary: |
Returns the currently selected `Enum.RibbonTool`.
description: |
This method returns the currently selected `Enum.RibbonTool`.
code_samples:
- Plugin-GetSelectedRibbonTool1
parameters: []
returns:
- type: RibbonTool
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:GetSetting
summary: |
Retrieves a previously stored value with the given key, or `nil` if the
given key doesn't exist.
description: |
Retrieves a previously stored value with the given key, or `nil` if the
given key doesn't exist.
Because multiple instances of the same plugin can run simultaneously (for
example, if multiple Studio windows are open), you shouldn't depend on
this value staying the same over time. The other plugin instances can
update the setting at any time.
This call can silently fail and return `nil` if multiple instances of the
same plugin are actively reading and writing data. If your plugin expects
to write to settings frequently, you should double-check the returned
value from this call after a short while to distinguish between a setting
being temporarily unavailable and a setting not existing.
code_samples:
- Plugin-GetSetting1
parameters:
- name: key
type: string
default:
summary: ''
returns:
- type: Variant
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:GetStudioUserId
summary: |
Returns the Studio user's userId if they're logged in, otherwise
returns 0.
description: |
Returns the Studio user's userId if they're logged in, otherwise
returns 0.
code_samples: []
parameters: []
returns:
- type: int64
summary: ''
tags:
- Deprecated
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:ImportFbxAnimationAsync
summary: |
Prompts the user to open a `.fbx` animation file that can be loaded onto
the `rigModel`, then proceeds to insert the animation as a
`Class.KeyframeSequence` in the `Class.Workspace`.
description: |
This function prompts the user to open a `.fbx` animation file that can be
loaded onto the `rigModel`, then proceeds to insert the animation as a
`Class.KeyframeSequence` in the `Class.Workspace`.
code_samples: []
parameters:
- name: rigModel
type: Instance
default:
summary: ''
- name: isR15
type: boolean
default: true
summary: ''
returns:
- type: Instance
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:ImportFbxAnimation
summary: |
Prompts the user to open a `.fbx` animation file that can be loaded onto
the `rigModel`, then proceeds to insert the animation as a
`Class.KeyframeSequence` in the `Class.Workspace`.
description: ''
code_samples: []
parameters:
- name: rigModel
type: Instance
default:
summary: ''
- name: isR15
type: boolean
default: true
summary: ''
returns:
- type: Instance
summary: ''
tags:
- Yields
- Deprecated
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:ImportFbxRigAsync
summary: |
Prompts the user to open a `.fbx` file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the `Class.Workspace`.
description: |
Prompts the user to open a `.fbx` file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the `Class.Workspace`.
code_samples: []
parameters:
- name: isR15
type: boolean
default: true
summary: ''
returns:
- type: Instance
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:ImportFbxRig
summary: |
Prompts the user to open a `.fbx` file, uploads the individual components
of the model as meshes, and generates a character rig for use in
animation, which is loaded into the `Class.Workspace`.
description: ''
code_samples: []
parameters:
- name: isR15
type: boolean
default: true
summary: ''
returns:
- type: Instance
summary: ''
tags:
- Yields
- Deprecated
deprecation_message: |
This method has been superseded by
`Class.Plugin:ImportFbxRigAsync()|ImportFbxRigAsync()`.
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:Intersect
summary: |
Intersects the given parts and returns the resulting
`Class.IntersectOperation`.
description: |
Intersects the given parts and returns the resulting
`Class.IntersectOperation`.
code_samples: []
parameters:
- name: objects
type: Instances
default:
summary: ''
returns:
- type: Instance
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:IsActivated
summary: |
Returns `true` if this plugin is currently active, after having been
activated via the `Class.Plugin:Activate()|Activate()` function.
description: |
This function returns true if this plugin is currently active, after
having been activated via the `Class.Plugin:Activate()|Activate()`
function.
code_samples: []
parameters: []
returns:
- type: boolean
summary: |
A boolean indicating whether the plugin is currently active.
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:IsActivatedWithExclusiveMouse
summary: |
Returns `true` if this plugin is currently active with an exclusive mouse.
description: |
This function returns `true` if this plugin is currently active with an
exclusive mouse, after having been activated via the
`Class.Plugin:Activate()|Activate()` function. If this returns `true`, a
`Class.PluginMouse` can be retrieved via
`Class.Plugin:GetMouse()|GetMouse()`.
#### See Also
- `Class.Plugin.Deactivation|Deactivation` which fires when the plugin is
deactivated.
- `Class.Plugin.Unloading|Unloading` which fires immediately before the
plugin is unloaded or reloaded via uninstallation, deactivation, or
updating.
code_samples: []
parameters: []
returns:
- type: boolean
summary: |
Whether this plugin is currently active with an exclusive mouse.
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:Negate
summary: |
Negates the given parts and returns the resulting
`Class.NegateOperation|NegateOperations`.
description: |
Negates the given parts and returns the resulting
`Class.NegateOperation|NegateOperations`.
code_samples: []
parameters:
- name: objects
type: Instances
default:
summary: ''
returns:
- type: Instances
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:OpenScript
summary: |
Used to open the given script instance in an editor window, in Roblox
studio, at the given line. If no line is given as an argument it will
default to 1.
description: |
Used to open the given script instance in an editor window, in Roblox
studio, at the given line. If no line is given as an argument it will
default to 1.
code_samples:
- Plugin-OpenScript1
parameters:
- name: script
type: LuaSourceContainer
default:
summary: ''
- name: lineNumber
type: int
default: 1
summary: ''
returns:
- type: ()
summary: ''
tags:
- Deprecated
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:OpenWikiPage
summary: |
Opens the context help window to the wiki page that `url` links to.
description: |
Opens the context help window to the wiki page that `url` links to.
code_samples:
- Plugin-OpenWikiPage1
parameters:
- name: url
type: string
default:
summary: ''
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:PromptForExistingAssetIdAsync
summary: |
Opens a window in Roblox Studio which prompts the user to select an asset
based on the `assetType` specified.
description: |
Opens a window in Roblox Studio which prompts the user to select an asset
based on the `assetType` specified. Returns what asset ID was selected, or
`-1` if the window was closed.
code_samples: []
parameters:
- name: assetType
type: string
default:
summary: ''
returns:
- type: int64
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:PromptForExistingAssetId
summary: |
Opens a window in Roblox Studio which prompts the user to select an asset
based on the `assetType` specified.
description: ''
code_samples: []
parameters:
- name: assetType
type: string
default:
summary: ''
returns:
- type: int64
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:PromptSaveSelectionAsync
summary: |
Prompts the user to save their current selection with the specified file
name.
description: |
Prompts the user to save their current selection with the specified file
name. Returns `true` if the user did save the file.
code_samples: []
parameters:
- name: suggestedFileName
type: string
default:
summary: ''
returns:
- type: boolean
summary: ''
tags:
- Yields
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:PromptSaveSelection
summary: |
Prompts the user to save their current selection with the specified file
name.
description: ''
code_samples: []
parameters:
- name: suggestedFileName
type: string
default:
summary: ''
returns:
- type: boolean
summary: ''
tags:
- Yields
- Deprecated
deprecation_message: |
This method has been superseded by
`Class.Plugin:PromptSaveSelectionAsync()|PromptSaveSelectionAsync()`.
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:SaveSelectedToRoblox
summary: |
Opens an upload window for the user's current selection.
description: |
Opens an upload window for the user's current selection.
code_samples: []
parameters: []
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:SelectRibbonTool
summary: |
Activates the specified Roblox Studio tool.
description: |
Activates the specified Roblox Studio tool. If the tool opens a window,
the position parameter specifies where it should be shown on the screen.
An object must be selected in order for this to work correctly. Also note
that altering the scale fields of the `position` property will not affect
the dialog popups.
code_samples: []
parameters:
- name: tool
type: RibbonTool
default:
summary: ''
- name: position
type: UDim2
default:
summary: ''
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:Separate
summary: |
Separates the given `Class.UnionOperation|UnionOperations` and returns the
resulting parts.
description: |
Separates the given `Class.UnionOperation|UnionOperations` and returns the
resulting parts.
code_samples: []
parameters:
- name: objects
type: Instances
default:
summary: ''
returns:
- type: Instances
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:SetSetting
summary: |
Stores a given value for later use under the given key. The value will
persist even after Studio is closed.
description: |
Stores a given value for later use under the given key. The value will
persist even after Roblox Studio is closed. These settings are saved in
`.json` format as a map with string keys. Arrays are automatically
converted to maps by converting the numeric keys to strings first.
Note that the `.json` format imposes additional restrictions, including
the following characters which can corrupt the settings file:
- Backslashes (`\`) in keys or values, in particular escaped quotes
(`\"`).
- Newlines (`\n`) in keys.
- Quotes (`"`) in keys.
- Periods (`.`) in keys.
This call can silently fail if multiple instances of the same plugin are
actively reading and writing data. If your plugin expects to write to
settings frequently, you may check that the data has been properly written
by calling `Class.Plugin:GetSetting()|GetSetting()`.
code_samples:
- Plugin-SetSetting1
parameters:
- name: key
type: string
default:
summary: ''
- name: value
type: Variant
default:
summary: ''
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:StartDrag
summary: |
Starts a drag action given a dictionary of parameters.
description: |
This method initiates a drag action using a dictionary of parameters. The
parameters are as follows:
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Sender</code></td>
<td>string</td>
<td><code>""</code></td>
<td>
Identifies the source of the drag action to the drop target
</td>
</tr>
<tr>
<td><code>MimeType</code></td>
<td>string</td>
<td><code>""</code></td>
<td>
The MIME type of <code>Data</code>.
</td>
</tr>
<tr>
<td><code>Data</code></td>
<td>string</td>
<td><code>""</code></td>
<td>
Information about the drag action, for example what is being dragged. Should be used by the drop target.
</td>
</tr>
<tr>
<td><code>MouseIcon</code></td>
<td><code>Datatype.Content</code></td>
<td><code>""</code></td>
<td>
The icon to use for the mouse cursor during the drag. If empty, uses the default cursor.
</td>
</tr>
<tr>
<td><code>DragIcon</code></td>
<td><code>Datatype.Content</code></td>
<td><code>""</code></td>
<td>
An image to render under the mouse cursor during the drag. This should represent the item being dragged.
</td>
</tr>
<tr>
<td><code>HotSpot</code></td>
<td><code>Datatype.Vector2</code></td>
<td><code>Datatype.Vector2.new(0, 0)</code></td>
<td>
The pixel offset from the top-left where the cursor should "hold" the <code>DragIcon</code>.
</td>
</tr>
</tbody>
</table>
See also `Class.PluginGui.PluginDragEntered`,
`Class.PluginGui.PluginDragMoved`, `Class.PluginGui.PluginDragDropped`,
and `Class.PluginGui.PluginDragLeft`.
code_samples:
- plugin-drag-and-drop
parameters:
- name: dragData
type: Dictionary
default:
summary: ''
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
- name: Plugin:Union
summary: |
Unions the given parts and returns the resulting `Class.UnionOperation`.
description: |
Unions the given parts and returns the resulting `Class.UnionOperation`.
code_samples: []
parameters:
- name: objects
type: Instances
default:
summary: ''
returns:
- type: Instance
summary: ''
tags: []
deprecation_message: ''
security: PluginSecurity
thread_safety: Unsafe
capabilities: []
events:
- name: Plugin.Deactivation
summary: |
Fired when the plugin is deactivated.
description: |
Fired when the `Class.Plugin` is deactivated. This occurs when either the
plugin code calls `Class.Plugin:Deactivate()|Deactivate()`, or because
some other plugin called `Class.Plugin:Activate()|Activate()`, which
forces all other plugins to lose their active state.
See also `Class.Plugin.Unloading|Unloading` which fires immediately before
the plugin is unloaded or reloaded via uninstallation, deactivation, or
updating.
code_samples: []
parameters: []
tags: []
deprecation_message: ''
security: PluginSecurity
capabilities: []
- name: Plugin.Unloading
summary: |
Fires immediately before the `Class.Plugin` stops running.
description: |
This event fires immediately before the `Class.Plugin` stops running.
Plugins are unloaded when disabled, uninstalled, about to be updated, or
when the place is closing.
It enables a plugin to clean up after itself before its scripts stop
running, e.g. to remove unnecessary instances from the `Class.DataModel`.
If a plugin does not clean up properly, the old copies will remain. When
this occurs, users may be forced to close and reopen the place which is a
bad user experience.
Plugin-related instances such as
`Class.PluginToolbarButton|PluginToolbarButtons`,
`Class.DockWidgetPluginGui|DockWidgetPluginGuis`, and
`Class.PluginGui|PluginGuis` are automatically cleaned up when the plugin
is unloaded so there is no need to remove them.
code_samples: []
parameters: []
tags: []
deprecation_message: ''
security: PluginSecurity
capabilities: []
callbacks: []