Type Alias: SaveFavouriteSceneAs()
SaveFavouriteSceneAs = (
sceneName
,favouriteCollectionIds
) =>Promise
<boolean
>
Function
Saves the current modular scene as a new favorite with a custom name.
This method captures the complete current state of a modular scene—including all components, their positions, configurations, and relationships—and saves it as a new favorite entry in the specified collections. This allows complex layouts to be saved and restored later, shared with colleagues, or used as starting points for similar designs.
Unlike saveFavouriteScene
, this method always creates a new entry rather than updating
an existing one, and requires providing a name for the new scene.
Parameters
sceneName
string
The display name for the saved scene
favouriteCollectionIds
string
[]
Array of collection IDs to save this scene to
Returns
Promise
<boolean
>
A promise that resolves to true if saving was successful, false otherwise
Example
// Save the current scene with a custom name when the user submits a form
document.getElementById('save-scene-form').addEventListener('submit', async (e) => {
e.preventDefault();
const sceneName = document.getElementById('scene-name-input').value.trim();
if (!sceneName) {
showNotification('Please enter a name for this scene', 'warning');
return;
}
// Get the selected collection IDs from checkboxes
const selectedCollections = Array.from(
document.querySelectorAll('input[name="collections"]:checked')
).map(cb => cb.value);
if (selectedCollections.length === 0) {
showNotification('Please select at least one collection', 'warning');
return;
}
const success = await window.mimeeqApp.actions.saveFavouriteSceneAs(
sceneName,
selectedCollections
);
if (success) {
showNotification(`Scene "${sceneName}" saved successfully`);
closeModal('save-scene-modal');
} else {
showNotification('Failed to save scene', 'error');
}
});
Emits
mimeeq-modular-save-scene This event is fired when Favourite Scene was updated or created, including shortcode and scene name