Skip to main content

Managers

window.expivi.managers.* provides access to various managers that control different aspects of Expivi's viewer.

API Methods​

MethodDescriptionReturn Type
resolveMaterialGroupsResolves and returns all available material groupsPromise<any>
resolveOffsetGroupsResolves and returns all offsetting nodes inside the productPromise<any>
resolveMaterialsResolves and returns all loaded materials inside the productPromise<any>
resolveTexturesResolves and returns all loaded media modelsPromise<any>
info

window.expivi.managers is meant to be used only as read-only. All interactions with the API are required to take place through window.expivi methods.

resolveMaterialGroups​

window.expivi.managers.resolveMaterialGroups returns an array of all available material groups with corresponding materials within each group that can be applied/selected on each group.

PropertyDescriptionType
idID of the groupnumber
hashUnique hashstring
nameHuman-readable name of the groupstring
group_idUnique group namestring
material_group_skuSKU used for the material groupstring
generate_codeDefines whether this group is used in the bill of materialsboolean
catalogue_idID of the product this group belongs tonumber
materials(Optional) Materials inside the group that can be selectedMaterialGroupRefModel[]
MaterialGroupRefModel​
PropertyDescriptionType
idReference ID used to select the materialnumber
skuSKU of the materialstring
name(Optional) Name presented to the end-userstring
price(Optional) Price applied when this material is selectednumber
thumbnail(Optional) Thumbnail of the materialstring
thumbnail_url(Optional) Full path to the thumbnailstring
default_selectedWhether this material is the default selected inside the groupboolean
material_idThe material ID being referencednumber
material_name(Optional) Material name being referencedstring
visible(Optional) Whether the material is visible in the listboolean

resolveOffsetGroups​

window.expivi.managers.resolveOffsetGroups returns an array of all offsetting nodes inside the product node.

PropertyDescriptionType
idID of the groupnumber
hashUnique hashstring
offset_idUnique group namestring
offset_vec_xOffset in X axisnumber
offset_vec_yOffset in Y axisnumber
offset_vec_zOffset in Z axisnumber
matrixOffset’s initial matrixnumber
rotation(Optional) Applied rotation on the offsetTHREE.Quaternion
levels(Optional) Stacked offsets in X, Y, Z axis{[key: number]: THREE.Vector3}
visible(Optional) Whether the node is visibleboolean

resolveMaterials​

window.expivi.managers.resolveMaterials returns an array of all loaded materials inside the product.

note

A complete list of material properties are out of scope of this documentation.

resolveTextures​

window.expivi.managers.resolveTextures returns an object of all loaded media models.

PropertyDescriptionType
idID of the media filenumber
nameName of the media filestring
source_urlComplete path to the source of media filestring
lod0Highest level of detail of the image media (optional)string
lod0_urlFull path to lod0string
lod1Medium level of detail of the image media (optional)string
lod1_urlFull path to lod1string
lod2Low level of detail of the image media (optional)string
lod2_urlFull path to lod2string
widthWidth of the source image filenumber
heightHeight of the source image filenumber
uv_scale_xScale used to down/upscale width to power of two sizenumber
uv_scale_yScale used to down/upscale height to power of two sizenumber
resource_folder_idThe ID of the virtual folder containing the medianumber