Managers
window.expivi.managers.*
provides access to various managers that control different aspects of Expivi's viewer.
API Methods
Method | Description | Return Type |
---|---|---|
resolveMaterialGroups | Resolves and returns all available material groups | Promise<any> |
resolveOffsetGroups | Resolves and returns all offsetting nodes inside the product | Promise<any> |
resolveMaterials | Resolves and returns all loaded materials inside the product | Promise<any> |
resolveTextures | Resolves and returns all loaded media models | Promise<any> |
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.
Property | Description | Type |
---|---|---|
id | ID of the group | number |
hash | Unique hash | string |
name | Human-readable name of the group | string |
group_id | Unique group name | string |
material_group_sku | SKU used for the material group | string |
generate_code | Defines whether this group is used in the bill of materials | boolean |
catalogue_id | ID of the product this group belongs to | number |
materials | (Optional) Materials inside the group that can be selected | MaterialGroupRefModel[] |
MaterialGroupRefModel
Property | Description | Type |
---|---|---|
id | Reference ID used to select the material | number |
sku | SKU of the material | string |
name | (Optional) Name presented to the end-user | string |
price | (Optional) Price applied when this material is selected | number |
thumbnail | (Optional) Thumbnail of the material | string |
thumbnail_url | (Optional) Full path to the thumbnail | string |
default_selected | Whether this material is the default selected inside the group | boolean |
material_id | The material ID being referenced | number |
material_name | (Optional) Material name being referenced | string |
visible | (Optional) Whether the material is visible in the list | boolean |
resolveOffsetGroups
window.expivi.managers.resolveOffsetGroups
returns an array of all offsetting nodes inside the product node.
Property | Description | Type |
---|---|---|
id | ID of the group | number |
hash | Unique hash | string |
offset_id | Unique group name | string |
offset_vec_x | Offset in X axis | number |
offset_vec_y | Offset in Y axis | number |
offset_vec_z | Offset in Z axis | number |
matrix | Offset’s initial matrix | number |
rotation | (Optional) Applied rotation on the offset | THREE.Quaternion |
levels | (Optional) Stacked offsets in X, Y, Z axis | {[key: number]: THREE.Vector3} |
visible | (Optional) Whether the node is visible | boolean |
resolveMaterials
window.expivi.managers.resolveMaterials
returns an array of all loaded materials inside the product.
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.
Property | Description | Type |
---|---|---|
id | ID of the media file | number |
name | Name of the media file | string |
source_url | Complete path to the source of media file | string |
lod0 | Highest level of detail of the image media (optional) | string |
lod0_url | Full path to lod0 | string |
lod1 | Medium level of detail of the image media (optional) | string |
lod1_url | Full path to lod1 | string |
lod2 | Low level of detail of the image media (optional) | string |
lod2_url | Full path to lod2 | string |
width | Width of the source image file | number |
height | Height of the source image file | number |
uv_scale_x | Scale used to down/upscale width to power of two size | number |
uv_scale_y | Scale used to down/upscale height to power of two size | number |
resource_folder_id | The ID of the virtual folder containing the media | number |