Interface: Actions
Configurator related actions. You can call them to either interact with scene or configuration or get/process some data from observers
AugmentedReality
generateAR
generateAR:
GenerateAR
Trigger generation of AR model and get shortcode to it
getARShortCodeData
getARShortCodeData:
GetARShortCodeData
Get data for AR short code
Param
AR short code
Param
If true
, in case paths to models are not yet generated it will return subscription which will resolve with said paths.
regenerateAR
regenerateAR:
RegenerateAR
Trigger re-generation of AR model and get shortcode to it in case if generation failed
Param
Already generated AR data
showAR
showAR:
ShowAR
Open current scene in AR. For desktop application opens modal with generated QR code/link with short code for given scene.
On mobile device sets window.location.href
to generated url for AR app.
Fires
@mimeeq-internal-show-ar
Authentication
havePermissions
havePermissions:
HavePermissions
Check in ConfigurationStore
if user posses any of passed permissions
Param
Array of permission to check
Basket
prepareCartImage
prepareCartImage:
PrepareCartImage
Returns relative path to CDN for cart product image. In case of error returns null
Param
Base64 of image
Param
Cart id
Param
Cart item id
triggerFinishEvent
triggerFinishEvent:
TriggerFinishEvent
Trigger finish button events
Param
Configurator variant. Can be basket
or selector
. Depending on event will dispatch different mimmeq event.
basket
- triggers @mimeeq-add-to-cart
event, selector
- triggers mimeeq-select-product
, other will dispatch mimeeq-show-summary
.
All events emit with payload details
object.
CameraControl
decreaseZoom
decreaseZoom:
DecreaseZoom
Decrease the zoom level of a 3D scene camera by a configurable amount or a default value, by adjusting the radius of the camera.
Param
Amount to adjust the radius of the camera.
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Disable scrolling on canvas. This function modifies the behavior of the camera and input controls in the Babylon.js scene to prevent users from scrolling or zooming the canvas.
In case you want to change camera zoom please use increaseZoom
, decreaseZoom
or setZoom
methods.
It also sets global variable on window.freezeScroll
which is used in useBabylon hook.
increaseZoom
increaseZoom:
IncreaseZoom
Increase the zoom level of a 3D scene camera by a configurable amount or a default value, by adjusting the radius of the camera.
Param
Amount to adjust the radius of the camera.
restoreCameraPosition
restoreCameraPosition:
RestoreCameraPosition
At 3d restore active camera position to initial state or to provided settings.
Param
custom camera position
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Use this to set new canvas as target for all interactions. You can only manipulate one canvas at a time so this should be your primary canvas in most cases.
Param
Canvas element to attach events to
setZoom
setZoom:
SetZoom
Set specific zoom value for the scene. Retrieves the active camera from the Babylon.js scene and sets new radius of the camera.
Param
New zoom value
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Re-enable scrolling on canvas. Undo modifications done by freezeCanvasScrolling,
restores the original scrolling and zooming behavior of the canvas, allowing the user to interact with the 3D scene as intended.
It also sets global variable on window.freezeScroll
to false, which is used in useBabylon()
hook.
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Register new canvas to babylon scene views. It will be using the same camera as primary canvas.
Param
Canvas element to be registered
zoomOut
zoomOut:
ZoomOut
Zoom out scene to see whole product. Dispatches applyCameraZoomAll
webGl
state task.
Fires
@mimeeq#mimeeq-3d-zoom-out-scene
Canvas
freezeCanvasScrolling
freezeCanvasScrolling:
FreezeCanvasScrolling
Disable scrolling on canvas. This function modifies the behavior of the camera and input controls in the Babylon.js scene to prevent users from scrolling or zooming the canvas.
In case you want to change camera zoom please use increaseZoom
, decreaseZoom
or setZoom
methods.
It also sets global variable on window.freezeScroll
which is used in useBabylon hook.
registerSceneCanvasView
registerSceneCanvasView:
RegisterSceneCanvasView
Register new canvas to babylon scene views. It will be using the same camera as primary canvas.
Param
HTMLCanvas element to be registered
setSceneInputCanvas
setSceneInputCanvas:
SetSceneInputCanvas
Use this to set new canvas as target for all interactions. You can only manipulate one canvas at a time so this should be your primary canvas in most cases.
Param
Canvas element to attach events to
unfreezeCanvasScrolling
unfreezeCanvasScrolling:
UnfreezeCanvasScrolling
Re-enable scrolling on canvas. Undo modifications done by freezeCanvasScrolling,
restores the original scrolling and zooming behavior of the canvas, allowing the user to interact with the 3D scene as intended.
It also sets global variable on window.freezeScroll
to false, which is used in useBabylon()
hook.
unregisterSceneCanvasView
unregisterSceneCanvasView:
UnregisterSceneCanvasView
Register new canvas to babylon scene views. It will be using the same camera as primary canvas.
Param
Canvas element to be registered
Exporters
exportGlb
exportGlb:
ExportGLB
Export scene to glb. It triggers browser download action and returns true
Fires
@mimeeq#mimeeq-3d-before-export-scene
Fires
@mimeeq#mimeeq-3d-after-export-scene
exportObj
exportObj:
ExportOBJ
Export scene to obj. It triggers browser download action and returns true. Under the hood it uses exportScene()
function with mode parameter 2.
Fires
@mimeeq#mimeeq-3d-before-export-scene
Fires
@mimeeq#mimeeq-3d-after-export-scene
exportStl
exportStl:
ExportSTL
Export scene to stl. It triggers browser download action and returns true
Fires
@mimeeq#mimeeq-3d-before-export-scene
Fires
@mimeeq#mimeeq-3d-after-export-scene
saveImage
saveImage:
SaveImage
Trigger current scene screenshot download. Default extension is .jpg
and width in pixels is 3072px
.
*
Fires
@mimeeq#mimeeq-3d-after-export-image *
Fires
@mimeeq#mimeeq-3d-before-export-image *
Param
Extension to save image with Extension to save image with, default is .jpg
*
Param
Expected image width in pixels. Height will prevail current canvas ratio. Default is 3072px
*
Param
Background color for JPEG image. If not value is provided it will use current canvas background *
showExportImageModal
showExportImageModal:
ShowExportImageModal
Open image export modal. Under the hood uses useToggle()
hook.
Fires
@mimeeq-internal-show-export-image
showExportModal
showExportModal:
ShowExportModal
Open model export modal. Under the hood uses useToggle()
hook.
Fires
@mimeeq-internal-show-export
showExportPDF
showExportPDF:
ShowExportPDF
Open PDF generator modal. Under the hood uses useToggle()
hook to handle modal visibility.
Fires
@mimeeq-internal-show-export-pdf
Favourites
createFavouriteCollection
createFavouriteCollection:
CreateFavouriteCollection
Create new favourite collection
Param
Name of the collection
Param
Type of the collection
Fires
@mimeeq#mimeeq-favourites-add-collection
getFavouriteCollections
getFavouriteCollections:
GetFavouriteCollections
Returns list of all available/existing favourite collections for current user. Dispatches SET_FAV_COLLECTIONS
redux action.
getFavouriteItems
getFavouriteItems:
GetFavouriteItems
Returns list of all items in favourites for current user (private and public). Dispatches SET_FAVOURITES
redux action
openSaveSceneAs
openSaveSceneAs:
OpenSaveSceneAs
Trigger to open Save Scene as modal on modular product. Under the hood uses useToggle()
hook.
Fires
@mimeeq-internal-show-modular-save-as
saveFavouriteConfiguration
saveFavouriteConfiguration:
SaveFavouriteConfiguration
Update favourite configuration (only for regular products).
Retrieves favourite collections from store, filters exisitng favourite collection state (if exists) and updates it selectively (removes redundant items and puts the new ones).
Posts data (favourites toPut
and toDelete
) to favoriteService
/update-favourite-in-configurator
endpoint. Calls internally getFavouriteItems()
function ro update app state
Param
Configuration code to update
Param
Favourite collection ids
Fires
@mimeeq#mimeeq-favourites-remove-product
Fires
@mimeeq#mimeeq-favourites-add-product
saveFavouriteScene
saveFavouriteScene:
SaveFavouriteScene
Update actually loaded scene with current state. It checks if entry exists by given shortcode by calling matchFavuorite()
. If given entry doesn't exists it returns false.
If it exists it calls getFavouriteItems()
function to update app state,updateImageModular()
function to update scene image and returns true
Fires
@mimeeq#mimeeq-modular-save-scene
saveFavouriteSceneAs
saveFavouriteSceneAs:
SaveFavouriteSceneAs
Save current scene under new name. Calls favouriteService
/add-to-favourites
endpoint.
Dispatches SET_LOADED_SCENE_NAME
Redux action after successful call and returns true.
Before calling favouriteService
creates product short code calling productService
/create-short-code
endpoint. If call fails returns false
.
Param
Scene name
Param
Favourite collection ids
Fires
@mimeeq#mimeeq-modular-save-scene
History
goBack
goBack:
HistoryGoBack
Revert last change in configurator. Dispatches SET_CURRENT_HISTORY_ITEM
Redux action.
Fires
@mimeeq#mimeeq-history-go-back
Fires
@mimeeq#mimeeq-app-url-change
Fires
@mmq-app-url-change-sandbox
redo
redo:
HistoryRedo
Redo next history action in configurator. Calls updateModularHistory()
if modular and dispatches SET_CURRENT_HISTORY_ITEM
Redux action.
Fires
@mimeeq#mimeeq-history-go-forward
Fires
@mimeeq#mimeeq-app-url-change
Fires
@mmq-app-url-change-sandbox
reset
reset:
HistoryReset
Go back to initial configuration in configurator. Dispatches CLEAR_HISTORY
Redux action.
Fires
@mimeeq#mimeeq-app-url-change
Fires
@mimeeq#mimeeq-history-reset
Fires
@mmq-app-url-change-sandbox
Hotspots
get3dInformationTemplate
get3dInformationTemplate:
Get3dInformationTemplate
Get data for 3d information template connected to passed meshId
Param
If of mesh we want to display template for
Modular
markOptionModular
markOptionModular:
MarkOptionModular
Select option at modular on currently selected product(s). *
Fires
@mimeeq#mimeeq-modular-select-option-multiple *
Fires
@mimeeq#mimeeq-modular-select-option *
Param
Option object to select *
Param
Id of block *
Param
Type of widget the block is using *
Param
If true
it will try to match selected option in other blocks within this block group
*
Param
Block name, it's used to run autosync rule *
openFinishModal
openFinishModal:
OpenFinishModal
Call it to open list of all elements on scene and tabs.
Checks validity of modal elements with checkModularConfigValidity()
and uses useToggle()
under the hood.
Fires
@mimeeq#mimeeq-show-modular-summary
ModularControl
cancelOperations
cancelOperations:
CancelOperations
Cancel all active operations on models like adding new, clone or move.
Fires
@mimeeq#mimeeq-modular-abort-adding
checkCanMove
checkCanMove:
CheckCanMove
Check if passed instance can be moved to other place on the scene
Param
ID of instance to check
chooseProductToAdd
chooseProductToAdd:
ChooseProductToAdd
Select passed product as currently being added to scene. It will display add icons on all places you can insert this item.
clearScene
clearScene:
ClearScene
Remove all resources from scene and start from the scratch.
Dispatches RESET_MODULAR
, CLEAR_MODULAR_PRICES
, CLEAR_PRODUCTS
, SET_LOADED_SHORTCODE
(with null argument), CLEAR_MODULAR_HISTORY
(with undefined
argument) Redux actions.
If there were settings for modular, dispatches mimeeq-internal-clear-scene
event product starter config (first time). Otherwise dispatches CLEAR_SCENE
Redux action.
Fires
@mimeeq#mimeeq-modular-clear-scene
copyStyles
copyStyles:
CopyStyles
Activate style copying from currently selected element
Fires
@mimeeq#mimeeq-modular-set-copy-styles
deselectAllModels
deselectAllModels:
DeselectAllModels
Deselect all models on the scene.
Dispatches DELECT_ALL
webGl task.
Fires
@mimeeq#mimeeq-modular-unselect-all
enableClone
enableClone:
EnableClone
Enable clone of currently selected model. Only one product can have active clone at once so activating it for new model will deactivate it for other.
Under the hood it checks allowClone
product settings prop.
If cloning is possible dispatches UPDATE_MODULAR_STATE
Redux action and calls selectSnappingPoint()
function which handles cloning logic.
Fires
@mimeeq#mimeeq-modular-set-clone
enableMove
enableMove:
EnableMove
Enable move of currently selected model. Only one product can have active move at once so activating it for new model will deactivate it for other.
Fires
@mimeeq#mimeeq-modular-set-move
enableReplace
enableReplace:
EnableReplace
Enable replace mode in which it shows list of products which can replace selected element while keeping all connections in place
Fires
@mimeeq#mimeeq-modular-set-replace
flipProduct
flipProduct:
FlipProduct
Flip/rotate selected product to use different snapping point connection
Fires
@mimeeq#mimeeq-modular-flip-product
getBoundingBoxPosition2d
getBoundingBoxPosition2d:
GetBoundingBoxPosition2d
Get bounding box position for passed element
Param
ID of element to get bounding for
getModularShareUrl
getModularShareUrl:
GetModularShareUrl
Generate link to current modular configurator. In not modular configurator returns null
Param
If true
, it will return shortCode only instead of full url
hoverProductForAction
hoverProductForAction:
HoverProductForAction
Show add icons on all places you can place passed item
openLoadSceneModal
openLoadSceneModal:
OpenLoadSceneModal
Trigger this to open Scene picker. Uses scene from myScene
state and useToggle()
hook.
Fires
@mimeeq-internal-load-scene
pasteStyles
pasteStyles:
PasteStyles
Paste styles from style source to currently selected element
removeSelected
removeSelected:
RemoveProducts
Remove all selected products from scene.
Checks if general settings allow to delete products (isDisableDelete
and allowRemove
props) and if product was not auto inserted checkIsAutoInserted()
.
Dispatches REMOVE_PRODUCTS
Redux actions with product ids.
Fires
@mimeeq#mimeeq-modular-remove-product
toggleApplyOptionsForAll
toggleApplyOptionsForAll:
ToggleApplyOptionsForAll
Toggle state for applying all selected options for all products on the scene
toggleApplyOptionsForInstances
toggleApplyOptionsForInstances:
ToggleApplyOptionsForInstances
Toggle state for applying all selected options for all instances of passed product on scene
Param
ID of product to change state for
toggleGrid
toggleGrid:
ToggleGrid
Toggle grid on scene.
Dispatches SET_SCENE_SETUP
and SHOW_GRID
Redux actions.
Fires
@mimeeq#mimeeq-modular-show-grid
Fires
@mimeeq#mimeeq-modular-hide-grid
toggleSlide
toggleSlide:
ToggleSlide
Activate/deactivate slide for currently selected product. Take a note not all products has slide available.
Fires
@mimeeq#mimeeq-modular-set-slide
triggerFinishEvent
triggerFinishEvent:
TriggerFinishEvent
Trigger finish button events
Param
Configurator variant. Can be basket
or selector
. Depending on event will dispatch different mimmeq event.
basket
- triggers @mimeeq-add-to-cart
event, selector
- triggers mimeeq-select-product
, other will dispatch mimeeq-show-summary
.
All events emit with payload details
object.
OptionSelection
filterOptions
filterOptions:
FilterOptions
Filter list of options against selected filters
Param
List of block options
Param
List of selected filters
markOption
markOption:
MarkOption
Select single option
Param
Option object to select
Param
Id of block
Param
Type of widget the block is using
Param
If true
it will try to match selected option in other blocks within this block group
Param
Block name of the block
Fires
@mimeeq#mimeeq-select-option
Fires
@mimeeq#mimeeq-app-url-change
markOptionByBlockNameAndOptionCode
markOptionByBlockNameAndOptionCode:
MarkOptionByBlockNameAndOptionCode
Marks option by block name and option code.
Param
Block name of block which option is a part of
Param
Code of option to be selected
Fires
@mimeeq#mimeeq-select-option
Fires
@mimeeq#mimeeq-app-url-change
prepareFilterOptions
prepareFilterOptions:
PrepareFilterOptions
Prepare list of available filters with count of affected options
Param
List of all filters configured for customer
Param
List of available options
Param
List of currently selected filters
toggleApplyOptionsForAll
toggleApplyOptionsForAll:
ToggleApplyOptionsForAll
Toggle state for applying all selected options for all products on the scene
toggleApplyOptionsForInstances
toggleApplyOptionsForInstances:
ToggleApplyOptionsForInstances
Toggle state for applying all selected options for all instances of passed product on scene
Param
ID of product to change state for
OptionSelection
markOptionModular
markOptionModular:
MarkOptionModular
Select option at modular on currently selected product(s). *
Fires
@mimeeq#mimeeq-modular-select-option-multiple *
Fires
@mimeeq#mimeeq-modular-select-option *
Param
Option object to select *
Param
Id of block *
Param
Type of widget the block is using *
Param
If true
it will try to match selected option in other blocks within this block group
*
Param
Block name, it's used to run autosync rule *
Other
addItemToCart
addItemToCart:
AddItemToCart
Adds an item to the specified cart.