API Documentation
General
init
Initializes Unlimited3D library.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| options | Object | Required | Following options object fields are required. You can find them on platform, in publish menu, after solution was published. |
| options.distID | string | Required | ID of distribution. |
| options.solution3DName | string | Required | Name of solution. |
| options.projectName | string | Required | Name of project that campaign belongs to. |
| options.solution3DID | string | Required | ID of solution. |
| options.container3D | string | Required | ID of html element to which canvas will be attached The rest of the fields are not required, but can be passed to customize behaviour. |
| options.collectAnalytics | boolean | Optional | Determines whether analytics will be collected. NOTE: Impression and load time analytics are always collected, regardless of this option. |
| options.onPointerClick | eventCallback | Optional | Called whenever user clicks on the scene. First and only parameter is an array of objects in format. |
| options.onPointerMove | eventCallback | Optional | Called whenever user moves mouse around the scene. First and only parameter is an array of objects in format. |
| options.onLoadingChanged | eventCallback | Optional | Called when loading of models and textures has changed. First and only parameter is an object contain information about loading status. |
| options.onCameraInteraction | eventCallback | Optional | Called when user moves camera using mouse or touch. |
| options.onTrigger | eventCallback | Optional | Called when user triggers an action. |
| options.render | boolean | Required | Should 3D scene be rendered immediately or not. |
| configuration | Object | Required | Configuration object is used for loading custom (saved) options before scene is loaded. It is either in format from examples or newer format returned by getConfigJSON call. |
| callback | initCallback | Optional | Called after action is completed. |
Examples
var options = {
distID: '1',
solution3DName: 'My_solution',
projectName: 'My_project',
solution3DID: '1',
containerID: 'container3d_replace',
onLoadingChanged: function (loading) {};
Unlimited3D.init(options,{},function(e))};
// With configuration
var configuration = {
camera: 'CameraName',
cameraControl: { autoRotate: true},
viewport: 'ViewportName',
renderer: 'RendererName',
lights: {
show: ['LightName'],
hide: ['LightName'],
override: ['LightName'],
},
annotations: {
show: ['AnnotationName'],
hide: ['AnnotationName'],
override: ['AnnotationName'],
materials: {
'MaterialName': ['AnnotationName'],
},
},
parts: {
show: ['PartName', 'model_name_1.fbx:RootNode'],
hide: ['PartName', 'model_name_2.fbx:RootNode'],
override: ['PartName'],
materials: {
'MaterialName': ['PartName'],
},
},
materials: {
'MaterialName': {
color: '#ffffff',
},
},
switchMaterials: {
'MaterialToHide': 'MaterialToShow',
},
};
Unlimited3D.init(options, configuration, function(e) {});
var options = {
distID: '1',
solution3DName: 'My_solution',
projectName: 'My_project',
solution3DID: '1',
containerID: 'container3d_replace',
onLoadingChanged: function(loading) {
loadingBar.style.width = loading.progress + "%";
},
onTrigger: (e) => {
if (e.type === 'PointerClicked') {
const objectData = e.data[0];
if (objectData) {
Unlimited3D.isFeedbackMarker({ name: objectData.name }, (r) => {
if (r) {
Unlimited3D.removeFeedbackMarker({ name: objectData.name }, (r1) => { console.log(r1); });
} else {
Unlimited3D.createFeedbackMarker({
name: 'Feedback',
targetName: objectData.name,
targetType: objectData.type,
material: null,
position: [...objectData.position],
radius: 2,
radiusMode: 'Relative',
color: '#00af00',
}, (r2) => { console.log(r2); });
}
});
}
}
}
};
Unlimited3D.init(options, {},function(error, status){
if (error || !status) {
console.log(error);
return;
}
});
dispose
Explicitly releases library freeing all it's resources.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
render
Renders 3D scene. If scene is already rendered, it will be destroyed and rendered again.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.render((error) => { console.log('success'); });
enableAnalitycsCollection
Enables collecting of analitycs information.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| enable | boolean | Optional | If collecting is enabled, default is true. |
| callback | noResultCallback | Optional | Called after action is completed. |
activateRenderer
Sets specified renderer as active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of renderer. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateRenderer({ name: 'Renderer_name1' });
isActiveRenderer
Checks if specified renderer is active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of renderer. |
| callback | isActiveRendererCallback | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isActiveRenderer({ name: 'Renderer1' }, (error, result) => { console.log(error, result); });
getSnapshot
Gets snapshot image of current render.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| width | number | Optional | Width of rendered image. |
| height | number | Optional | Height of rendered image. |
| method | string | Optional | 'hires' or 'legacy', default is 'hires'. |
| result | string | Optional | 'blob', 'url' or 'base64', default is 'url'. |
| callback | getSnapshotCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getSnapshot({ width: 1280, height: 720, result: "base64" }, (error, result) => { console.log(result); });
Distribution Info
getDistributionInfo
Gets distribution information objects for solution.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| solution3DID | string | Required | Solution ID. |
| callback | getDistributionInfoCallback | Optional | Called after action is completed. |
Examples
Unlimited3d.getDistributionInfo({ solution3DID: 1 }, (e, info) => console.log(info));
getLatestDistributionInfo
Gets latest distribution information for solution.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| solution3DID | string | Required | Solution ID. |
| callback | getLatestDistributionInfoCallback | Optional | Called after action is completed. |
Examples
Unlimited3d.getLatestDistributionInfo({ solution3DID: 1 }, (e, info) => console.log(info));
Analytics
sendAnalytics
Sends analytics data
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| type | string | Required | type of analytics data |
| rest | any | Required | rest arguments |
| callback | noResultCallback | Required | [callback] - Called after action is completed. |
Material
getMaterial
Gets name of active material for the provided part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| part | string | Required | Part name. |
| callback | getMaterialCallback | Optional | Called after action is completed. |
Examples
// Returns 'Material name'
Unlimited3D.getMaterial({ part: 'partName' }, (error, result) => { console.log(error, result); });
getPartsWithMaterial
Gets names of parts with the specified material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| callback | getPartsWithMaterialCallback | Optional | Called after action is completed. |
Examples
// [
// {
// type: 'part',
// shortName: 'Material short name',
// name: 'Material name'
// }
// ]
Unlimited3D.getPartsWithMaterial({ material: 'MaterialName' }, (error, result) => { console.log(error, result); });
getAnnotationsWithMaterial
Gets names of annotations with the specified material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| callback | getAnnotationsWithMaterialCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// type: 'annotation',
// shortName: 'Annotation Short Name',
// name: 'Annotation Name'
// }
// ]
Unlimited3D.getAnnotationsWithMaterial({ material: 'MaterialName' }, (error, result) => { console.log(error, result); });
getAvailableMaterials
Gets all available materials.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableMaterialsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "Matname-Mat"
// shortName: "Matname-Mat"
// type: "material"
// }
// ]
Unlimited3D.getAvailableMaterials((error, result) => { console.log(error, result); });
changeMaterial
Sets material to specified parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Names of parts. |
| material | string | Required | Name of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeMaterial({ parts: ['PartName'], material: 'MaterialName' });
changeMaterials
Sets materials to specified parts as defined by partObjects.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| partObjects | Array.<Object> | Required | Set specified material on provided parts. |
| partObjects[].parts | Array.<string> | Required | Names of parts. |
| partObjects[].material | string | Required | Name of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeMaterials({ partObjects: [ {parts: ['Part1','Part2'], material: 'Mat1'} ] });
applyMaterialToAllParts
Applies specified material to all parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.applyMaterialToAllParts({ material: 'MaterialName' });
switchMaterials
Sets material to newMaterial for all parts that have oldMaterial as active material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| oldMaterial | string | Required | name of material that should be changed. |
| newMaterial | string | Required | Name of material that is set. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.switchMaterials({ oldMaterial: 'OldMaterialName', newMaterial: 'NMaterialName' });
changeMaterialColor
Sets color of specified material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| color | string | Required | Color can be hex string, 'rgb(r, g, b)' string where values are in range 0...255, 'cmyk(c, m, y, k)' string where values are in range 0...100 or 'pantone(name)' string where name is one of Pantone color names. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
// hex
Unlimited3D.changeMaterialColor({material : "material_name", color: '#ffffff' });
// rgb
Unlimited3D.changeMaterialColor({material : "material_name", color: 'rgb(255, 255, 255)' });
// cmyk
Unlimited3D.changeMaterialColor({material : "material_name", color: 'cmyk(4, 5, 6, 10)' });
// pantone
Unlimited3D.changeMaterialColor({material : "material_name", color: 'pantone(2150 C)' });
changeMaterialOptions
Sets options for specified material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| options | Object | Required | Material options. |
| options.color | string | Optional | Hex value of material color. |
| options.opacity | number | Optional | Opacity value of material. |
| options.transparent | boolean | Optional | If material is transparent. |
| metalness | number | Optional | Metalness value of material. |
| roughness | number | Optional | Roughness value of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeMaterialOptions({ material: 'material_name1', options: { color: '#fff' } });
changeMaterialsOptions
Sets options for specified materials.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| materials | Array.<string> | Required | Names of materials. |
| options | Object | Required | Material options. |
| options.color | string | Optional | Hex value of material color. |
| options.opacity | number | Optional | Opacity value of material. |
| options.transparent | boolean | Optional | If material is transparent. |
| metalness | number | Optional | Metalness value of material. |
| roughness | number | Optional | Roughness value of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeMaterialsOptions({ materials: ['material_name1', 'material_name2'], options: { color: '#fff' } });
cloneMaterial
Clones specified material as a shallow copy (textures between cloned and original material are shared).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of the material to clone. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.cloneMaterial({ material: 'Mat-name' });
getMaterialMapTransform
Gets texture transform values of current material map type.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| mapType | string | Required | Type of map (only diffuseMap is currently fully supported). |
| callback | getMaterialMapTransformCallback | Optional | Called after action is completed. |
Examples
// Returns
// {
// centerU: 0.5
// centerV: 0.5
// offsetU: 0
// offsetV: 0
// repeatU: 1
// repeatV: 1
// rotation: 0
// }
Unlimited3D.getMaterialMapTransform({ material: 'Material01', mapType: 'diffuseMap' }, (error, result) => { console.log(error, result); });
changeMaterialMap
Sets material map of specified type to specified texture.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material. |
| texture | string | Required | Name of texture to set. |
| mapType | string | Required | type of map. Only diffuseMap map type is currently fully supported. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeMaterialMap({ material: 'Material01', texture: 'Texture01', mapType: 'diffuseMap' }, (error) => { console.log(error); });
changeGroupMaterial
Changes group material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| groupObjects | Array.<string> | Required | Array of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeGroupMaterial({
groupObjects : ['name1','name2','name2']
});
Annotation
changeAnnotationMaterial
Sets specified material to specified annotations.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| annotations | Array.<string> | Required | Names of annotations for which material should be set. |
| material | string | Required | Name of material. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeAnnotationMaterial({ annotations: ['Anno1', 'Anno2'], material : 'MaterialName' });
showAnnotations
Shows annotations specified as annotationObjects on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| annotationObjects | Array.<Object> | Required | Set specified material on provided annotations. |
| annotationObjects[].annotations | Array.<string> | Required | Names of annotations. |
| annotationObjects[].material | string | Optional | Name of material. If specified, it will be set for all annotations in partObjects before parts are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showAnnotations({
annotationObjects: [
{
annotations: ['Anno3'],
material: 'MaterialName'
}
]
});
hideAnnotations
Hides specified annotations on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| annotations | Array.<string> | Required | Names of annotations. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.hideAnnotations({ annotations: ['Anno1', 'Anno2'] });
showOnlyAnnotations
Shows annotations specified as annotationObjects on scene, hides all other annotations.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| annotationObjects | Array.<Object> | Required | Set specified material on provided annotations. |
| annotationObjects[].annotations | Array.<string> | Required | Names of annotations. |
| annotationObjects[].material | string | Optional | Name of material. If specified, it will be set for all annotations in annotationObjects before annotations are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showOnlyAnnotations({
annotationObjects:[
{
annotations: ['Anno3'],
material: 'MaterialName'
}
]
});
getAvailableAnnotations
Gets available annotations.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableAnnotationsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'AnnotationName',
// shortName: 'AnnotationName',
// type: 'annotation'
// }
// ]
Unlimited3D.getAvailableAnnotations((error, result) => { console.log(result); });
setAnnotationTransformationProperties
Sets transform properties of annotations.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Names of annotation. |
| position | Array.<number> | Optional | Position of annotation as array of 3 numbers. |
| scale | Array.<number> | Optional | Scale of annotation as array of 3 numbers. |
| rotation | Array.<number> | Optional | Rotation of annotation as array of 3 numbers. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setAnnotationTransformationProperties({
name: 'annotation_name',
position: [10, 10, 5],
scale: [14, 13, 7],
rotation: [90, 45, 45]
});
getAnnotationPosition
Gets position of specified annotation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of annotation. |
| callback | getAnnotationPositionCallback | Optional | Called after action is completed. |
Examples
// Returns
[0, 0, 0]
Unlimited3D.getAnnotationPosition((error, result) => { console.log(result); });
annotationFadeEffect
Fades active annotations in or out based on number of visible annotations and their distance to the camera. Uses annotation material opacity.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| visibleCount | Number | Required | Number of annotations that will be visible at once. Default is 2. |
| fadeDuration | Number | Required | Duration of the fading animation in miliseconds. Default is 500ms. |
| easing | String | Required | Easing function used for the fading animation. Default is Quadratic.InOut. |
| enabledAnnotations | Array.<String> | Required | Array containing names of annotations to be affected by the effect. If empty, all annotations are affected. Default is an empty array. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.annotationFadeEffect({visibleCount=2, fadeDuration = 500, easing = "Quadratic.InOut", enabledAnnotations = []})
Texture
createTextureFromImage
Creates texture with specified initial options from external image url.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| url | string | Required | url of image. |
| name | string | Required | Name of created texture. If already exists, -num suffix is added. |
| options | Object | Optional | initial options for texture. |
| options.encoding | string | Optional | Texture encoding, could be 'sRGBEncoding' or 'LinearEncoding'. Default is 'sRGBEncoding'. |
| options.format | string | Optional | Texture format, could be 'RGBAFormat' or 'RGBFormat'. Default is 'RGBAFormat'. |
| options.flipY | boolean | Optional | If texture should be flipped by Y axis. Default is true. |
| options.wrapS | string | Optional | Texture wrapping by X axis. Could be 'ClampToEdgeWrapping', 'RepeatWrapping' or 'MirroredRepeatWrapping'. Default is 'RepeatWrapping'. |
| options.wrapT | string | Optional | Texture wrapping by Y axis. Could be 'ClampToEdgeWrapping', 'RepeatWrapping' or 'MirroredRepeatWrapping'. Default is 'RepeatWrapping'. |
| options.minFilter | string | Optional | Texture minifying filter. |
| options.magFilter | string | Optional | Texture magnifying filter. |
| options.premultiplyAlpha | boolean | Optional | If alpha should be premultiplied. |
| options.extension | string | Optional | Texture file extension to determine texture type if url doesn't contain it. |
| options.isEquirectangular | boolean | Optional | If texture should be used as panorama environment texture. |
| callback | createTextureFromImageCallback | Optional | Called after action is completed. |
Examples
// Returns
// {
// name: 'Texture Name'
// shortName: "Texture Short Name"
// type: "texture"
// }
Unlimited3D.createTextureFromImage({ url: 'some url', name: 'Texture1' }, (error, result) => { console.log(error, result); });
getAvailableTextures
Gets textures that are previously created using createTextureFromImage call.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableTexturesCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'Texture Name'
// shortName: 'Texture Short Name'
// type: 'texture'
// }
// ]
Unlimited3D.getAvailableTextures((error, result) => { console.log(error, result); });
getTextureTransform
Gets texture transform values.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| texture | string | Required | Name of texture. |
| callback | getTextureTransformCallback | Optional | Called after action is completed. |
Examples
// {
// centerU: 0.5
// centerV: 0.5
// offsetU: 0
// offsetV: 0
// repeatU: 1
// repeatV: 1
// rotation: 0
// }
Unlimited3D.getTextureTransform({ texture: 'Texture01' }, (error, result) => { console.log(error, result); });
changeTextureTransform
Sets specified texture transform values.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| texture | string | Required | Name of texture. |
| transform | Object | Required | transform values. |
| transform.offsetU | number | Optional | Offset value by U axis. |
| transform.offsetV | number | Optional | Offset value by V axis. |
| transform.repeatU | number | Optional | Repeat value by U axis. |
| transform.repeatV | number | Optional | Repeat value by V axis. |
| transform.centerU | number | Optional | Center value by U axis. |
| transform.centerV | number | Optional | Center value by V axis. |
| transform.rotation | number | Optional | Rotation value in degrees. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeTextureTransform({ texture: 'Texture01', transform: {
centerU: 0.5,
centerV: 0.5,
offsetU: 0,
offsetV: 0,
repeatU: 1,
repeatV: 1,
rotation: 0,
}}, (error) => { console.log(error); });
resetTextureTransform
Resets transform values for specified texture to default values.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| texture | string | Required | Name of texture. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.resetTextureTransform({ texture: 'Texture01' }, (error) => { console.log(error); });
Part
hideParts
Hides specified model parts from scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Names of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.hideParts({ parts: ['PartName'] });
showParts
Shows parts specified as partObjects on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| partObjects | Array.<Object> | Required | Set specified material on provided parts. |
| partObjects[].parts | Array.<string> | Required | Names of parts. |
| partObjects[].material | string | Optional | Name of material. If specified, it will be set for all parts in partObjects before parts are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showParts({
partObjects: [
{
parts: ['PartName1', 'PartName2'],
material: 'MatName1',
},
{
parts: ['PartName3', 'PartName4'],
}
]
});
showAllParts
Shows all parts on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showAllParts();
showOnlyParts
Shows only parts specified by partObjects on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| partObjects | Array.<Object> | Required | Set specified material on provided parts. |
| partObjects[].parts | Array.<string> | Required | Names of parts. |
| partObjects[].material | string | Optional | Name of material. If specified, it will be set for all parts in partObjects before parts are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showOnlyParts({
partObjects: [
{
parts: ['PartName1', 'PartName2'],
material: 'MatName1',
},
{
parts: ['PartName3', 'PartName4'],
}
]
});
getAvailableParts
Gets available parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailablePartsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'PartName',
// shortName: 'PartNode',
// type: 'part'
// }
// ]
Unlimited3D.getAvailableParts((error, result) => { console.log(error, result); });
getVisibleParts
Gets visible parts on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getVisiblePartsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'PartName',
// shortName: 'PartNode',
// type: 'part'
// }
// ]
Unlimited3D.getVisibleParts((error, result) => { console.log(error, result); });
getHiddenParts
Gets hidden parts on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getHiddenPartsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'PartName',
// shortName: 'PartNode',
// type: 'part'
// }
// ]
Unlimited3D.getHiddenParts((error, result) => { console.log(error, result); });
isPartVisible
Checks if a part is visible.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| part | string | Required | Name of part. |
| callback | isPartVisibleCallback | Optional | Called after action is completed. |
Examples
// Returns
true
Unlimited3D.isPartVisible({ part: 'part_name' }, (error, result) => { console.log(result); });
getPartPosition
Gets part position.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of part. |
| callback | getPartPositionCallback | Optional | Called after action is completed. |
Examples
// Returns
// [0, 0, 0]
Unlimited3D.getPartPosition({ name: 'PartName' }, (e, r) => { console.log(r); });
getPartRotation
Gets part Rotation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of part. |
| callback | getPartRotationCallback | Optional | Called after action is completed. |
| error | Object | null | Required | null if successful, otherwise error object. |
| result | Array.<Object> | Required | Part rotation if successful (in XYZ order). |
Examples
// Returns
// [0, 0, 0]
Unlimited3D.getPartRotation({ name: 'PartName' }, (e, r) => { console.log(r); });
setPartTransformationProperties
Sets transformations (position, rotation, scale) of specified part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of part. |
| position | Array.<number> | Optional | Position value. |
| rotation | Array.<number> | Optional | Rotation value as quaternion. |
| scale | Array.<number> | Optional | Scale value. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setPartTransformationProperties({
name: 'PartName',
position: [1.2, 1, 1],
scale: [1, 1, 2]
});
getPartCenter
Gets part center.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of part. |
| callback | getPartCenterCallback | Optional | Called after action is completed. |
Examples
// Returns
// [0, 0, 0]
Unlimited3D.getPartCenter({ name: 'PartName' }, (error, result) => { console.log(result); } );
Selection
selectParts
Selects specified parts. Parts must be selectable.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Names of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.selectParts(['PartName1', 'PartName2']);
selectAllPartsExcept
Selects all but specified parts. Parts must be selectable.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Names of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.selectAllPartsExcept(['PartName1', 'PartName2']);
getSelectedParts
Gets currently selected parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getSelectedPartsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'SelectedName',
// shortName: 'SelectedName',
// type: 'part'
// }
// ]
Unlimited3D.getSelectedParts((error, result) => { console.log(result); });
getSelectedAnnotations
Gets currently selected annotations.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getSelectedAnnotations | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'Annotation Name',
// shortName: 'Annotation Short Name',
// type: 'annotation'
// }
// ]
Unlimited3D.getSelectedAnnotations((error, result) => { console.log(result); });
isPartSelected
Checks if part is selected.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| part | string | Required | Name of part. |
| callback | isPartSelected | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isPartSelected({ part: 'part_name' }, (error, result) => { console.log(result); });
getSelectable
Gets all selectable objects.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getSelectableCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'SelectableName',
// shortName: 'SelectableName',
// type: 'part'
// }
// ]
Unlimited3D.getSelectable((error, result) => { console.log(result); });
getSelectableParts
Gets all selectable parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getSelectablePartsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: 'SelectableName',
// shortName: 'SelectableName',
// type: 'part'
// }
// ]
Unlimited3D.getSelectableParts((error, result) => { console.log(result); });
addSelectable
Adds selectable parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| partNames | Array.<string> | Required | Names of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.addSelectable({ partNames : ['PartName1','PartName2','PartName3'] });
setSelectable
Sets selectable parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| partNames | Array.<string> | Required | Names of parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setSelectable({ partNames : ['PartName1','PartName2','PartName3'] });
setAllSelectable
Sets all parts as selectable.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setAllSelectable();
Camera
activateCamera
Sets specified camera as active on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera. |
| preventDefault | boolean | Optional | Prevents camera from jumping to default position when activated. Default is false. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateCamera({ name: 'Camera_1' });
activateCameraControl
Sets specified camera controls as active on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera controls. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateCameraControl({ name:'CC_name1' });
isActiveCamera
Checks if specified camera is active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera. |
| callback | isActiveCameraCallback | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isActiveCamera({ name: 'Camera_name1' }, (error, result) => { console.log(error, result); });
isActiveCameraControl
Checks if specified camera controls are active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera controls. |
| callback | isActiveCameraControlCallback | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isActiveCameraControl({ name: 'Camera Mobile control' }, (error, result) => { console.log(error, result); });
enableAutoRotate
Enables or disables current camera’s auto rotation around target.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| enable | boolean | Optional | If auto rotate is enabled. Default is true. |
| callback | noResultCallback | Optional | Called after action is completed. |
setAutoRotateSpeed
Changes speed of current camera auto rotation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| speed | number | Optional | Speed of rotation. Default is 1. |
| callback | noResultCallback | Optional | Called after action is completed. |
getAvailableCameras
Gets available cameras.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableCamerasCallback | Optional | Called after action is completed. |
getCameraPosition
Gets camera position.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getCameraPositionCallback | Optional | Called after action is completed. |
setCameraPosition
Sets position of currently active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| position | any | Optional | Position as array of 3 values. Default is [0, 0, 0]. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setCameraPosition({ position: [1, 2, 1] });
getCameraTarget
Gets target of current active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getCameraTargetCallback | Optional | Called after action is completed. |
Examples
// Returns
// [0, 0.6, 0]
Unlimited3D.getCameraTarget(function(error, result) { console.log(result); });
setCameraTarget
Sets target of currently active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| target | any | Optional | Target as array of 3 values. Default is [0, 0, 0]. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setCameraTarget({ target : [0, 3, 0] });
getCameraOptions
Gets camera options for currently active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getCameraOptionsCallback | Optional | Called after action is completed. |
Examples
// Returns
// {
// far: 347.1001387305146,
// fov: 35,
// maxDistance: 6,
// minDistance: 1.5,
// near: 0.01
// }
Unlimited3D.getCameraOptions( (error, result) => console.log(result) );
setCameraOptions
Sets options for currently active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| number | any | Optional | fov - Field of view, angle of camera view vertically. |
| number | any | Optional | near - Near clipping plane distance. |
| number | any | Optional | far - Far clipping plane distance. |
| number | any | Optional | minDistance - Minimum distance that camera can be zoomed in. |
| number | any | Optional | maxDistance - Maximum distance that camera can be zoomed out. |
| callback | noResultCallback | Optional | Called after action is completed. |
updateCameraToScene
Updates camera position, near, far, minDistance and maxDistance based on current scene and camera fov (field of view).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| distanceFactor | any | Optional | factor that is multiplied with calculated camera distance, default is 1.0 |
| callback | noResultCallback | Optional | Called after action is completed. |
resetCameraPosition
Resets camera position.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.resetCameraPosition({ name:'camera_name' });
resetCameraTarget
Resets camera target of active camera.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.resetCameraTarget();
enableCameraControls
Enables camera controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| enable | boolean | Optional | Should camera controls be enabled, default is true. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.enableCameraControls({ enable : false });
updateCameraControl
Updates camera control.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of camera control. |
| minAzimuthAngle | number | Optional | Minimum azimuth angle. |
| maxAzimuthAngle | number | Optional | Maximum azimuth angle. |
| minPolarAngle | number | Optional | Minimum polar angle. |
| maxPolarAngle | number | Optional | Maximum polar angle. |
| panSpeed | number | Optional | Pan speed. |
| minDistance | number | Optional | Minimum distance. |
| maxDistance | number | Optional | Maximum distance. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.updateCameraControl({
name: 'Contol_name',
minAzimuthAngle : 1.1,
maxAzimuthAngle : 1.5,
minPolarAngle : 1.0,
maxPolarAngle : 2.0,
panSpeed : 5.5,
minDistance: 1.1,
maxDistance: 1.5
});
getRealtimeCameraPosition
Gets camera position realtime position at any given time.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getRealtimeCameraPositionCallback | Optional | Called after action is completed. |
updateSceneLayout
Recalculates camera position and target in order to fit selected part or parts within the camera frustum.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<String> | Required | Array of part names to be focused on by the camera. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.updateSceneLayout({ parts: ['part1', 'part2'] });
Viewport
isActiveViewport
Checks if specified viewport is active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of viewport. |
| callback | isActiveViewportCallback | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isActiveViewport({ name: 'Viewport1' }, (error, result) => { console.log(error, result); });
activateViewport
Sets specified viewport as active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of viewport. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateViewport({ name: "ViewportName" });
changeBackgroundColor
Changes background color and background opacity of scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| viewport | string | Required | Name of viewport. |
| color | string | Optional | Background color value, default is '#ffffff'. |
| opacity | number | Optional | Background opacity, default is 1. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeBackgroundColor({ viewport: "Viewer", color: "#cccccc", opacity: 0.5 });
changeGlobalEnvMap
Change global environment map.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| textureName | string | Required | Name of previously created environment texture. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeGlobalEnvMap({ textureName: 'Texture1' });
changeGlobalEnvMapIntensity
Change global environment map intensity.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| intensity | number | Optional | Intensity value, default is 1.0. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeGlobalEnvMapIntensity({ intensity: 0.5 });
enableGlobalAOMap
Enable global ambient occlusion map.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| enable | boolean | Optional | if ambient occlusion map should be enabled, default is true. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.enableGlobalAOMap({ enable: false });
Light
isVisibleLight
Checks if specified light is visible in the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of light. |
| callback | isVisibleLightCallback | Optional | Called after action is completed. |
Examples
// Returns
// true
Unlimited3D.isVisibleLight({ name: 'Light1' }, (error, result) => { console.log(error, result); });
showLights
Shows specified lights on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| lights | Array.<string> | Required | Names of lights. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showLights({ lights:['Light1', 'Light2'] });
hideLights
Hides specified lights on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| lights | Array.<string> | Required | Names of lights. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.hideLights({ lights:['Light1', 'Light2'] });
showOnlyLights
Shows only specified lights and hides all other lights.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| lights | Array.<string> | Required | Names of lights. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showOnlyLights( { lights: ['light_name1','light_name2'] } );
createLight
Creates a new light entity.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| light | string | Required | Name of the new light entity. |
| options | Object | Optional | Light creation options. |
| options.type | string | Optional | Type of light to be created ('Directional', 'Hemisphere', 'Spot', etc.) |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.createLight({light: "NewLight", options:{type: "Directional"}}, (e,r)=>console.log(e,r))
updateLight
Updates options of light entity.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| light | string | Required | Name of the light entity. |
| options | Object | Optional | Light options. |
| options.position | Array.<number> | Optional | Array of x, y and z values for light position. |
| options.target | Array.<number> | Optional | Array of x, y and z values for light target. |
| options.color | string | Optional | Hex String of the light color. |
| options.castShadow | boolean | Optional | If custom part casts shadows to other parts (default false). |
| options.intensity | number | Optional | Intensity of the light. |
| options.radius | number | Optional | Radius of the light. |
Examples
Unlimited3D.updateLight({light: "Test123", options:{color: "#FF0000"}}, (e,r)=>console.log(e,r))
3D Text
changeTextOptions
Sets 3D text options.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| textName | string | Required | Name of 3D text. |
| options | Object | Optional | Object containing specified options. |
| options.text | string | Optional | Text content. |
| options.horAlignment | string | Optional | Horizontal alignment of 3D text. |
| options.verAlignment | string | Optional | Vertical alignment of 3D text. |
| options.fontUrl | string | Optional | url of TTF font file. |
| options.size | number | Optional | Size of 3D text. Mesh scale should be used instead. |
| options.height | number | Optional | Height of 3D text. |
| options.bevelEnabled | number | Optional | If bevel (smoother edges) is enabled. |
| options.bevelThickness | number | Optional | Thickness of bevel part of 3D text. |
| options.bevelSize | number | Optional | Size of bevel part of 3D text. |
| options.bevelOffset | number | Optional | Offset of bevel part of 3D text. |
| options.bevelSegments | number | Optional | Number of segments for bevel part of 3D text. |
| options.curvePoints | Array.<number> | Optional | Points (as 3 numbers each) of curve that 3D text should follow, if it's empty array, curve is not used. |
| options.curveSegments | number | Optional | Number of segments in 3D text. |
| options.curveOffset | number | Optional | Offset of 3D text on the curve, default is 0. |
| options.curvePreview | boolean | Optional | If preview of curve with given points is shown. |
| options.curveRotate | number | Optional | Rotation of text on the curve, default is 0. |
| callback | noResultCallback | Optional | Called after action is completed. |
getTextInfo
Gets info about specified 3D text geometry.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| textName | any | Required | Name of 3D text. |
| callback | getTextInfo | Optional | Called after action is completed. |
Custom Part
showCustomParts
Shows custom parts specified as customPartObjects on scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| customPartObjects | Array.<Object> | Required | Set specified material on provided custom parts. |
| customPartObjects[].customParts | Array.<string> | Required | Names of custom parts. |
| customPartObjects[].material | string | Optional | Name of material. If specified, it will be set for all custom parts in customPartObjects before custom parts are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
hideCustomParts
Hides specified custom parts on the scene.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| customParts | Array.<string> | Required | Names of custom parts. |
| callback | noResultCallback | Optional | Called after action is completed. |
showOnlyCustomParts
Shows only custom parts specified as customPartObjects on scene, other custom parts are hidden.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| customPartObjects | Array.<Object> | Required | Set specified material on provided custom parts. |
| customPartObjects[].customParts | Array.<string> | Required | Names of custom parts. |
| customPartObjects[].material | string | Optional | Name of material. If specified, it will be set for all custom parts in customPartObjects before custom parts are shown. |
| callback | noResultCallback | Optional | Called after action is completed. |
getAvailableCustomParts
Gets available custom parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableCustomPartsCallback | Optional | Called after action is completed. |
setCustomPartTransformationProperties
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Names of custom part. |
| options | Object | Optional | Transform options. |
| options.position | Array.<number> | Optional | Position of custom part as array of 3 numbers. |
| options.scale | Array.<number> | Optional | Scale of custom part as array of 3 numbers. |
| options.rotation | Array.<number> | Optional | Rotation of custom part as array of 3 numbers. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setCustomPartTransformationProperties({
name: 'custom_part_name',
options: {
position: [10, 10, 5],
scale: [14, 13, 7],
rotation: [90, 45, 45],
},
});
createCustomPart
Creates a new custom part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| customPart | string | Required | Name of the new custom part. |
| options | Object | Optional | Custom Part creation options. |
| options.type | string | Optional | Type of custom part to be created ('Plane', 'Sphere', etc.) |
| options.material | string | Optional | Existing material to be applied to the new custom part. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.createCustomPart({customPart: "NewCustomPartName", options:{type: "Plane", material: "Default"}}, (e,r)=>console.log(e,r))
updateCustomPart
Updates options of custom part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| customPart | string | Required | Name of the custom part. |
| options | Object | Optional | Custom part options. |
| options.position | Array.<number> | Optional | Array of x, y and z values for position. |
| options.rotation | Array.<number> | Optional | Array of x, y and z values for rotation. |
| options.scale | Array.<number> | Optional | Array of x, y and z values for scale. |
| options.frustumCulled | boolean | Optional | If custom part is frustum culled (default true). |
| options.receiveShadow | boolean | Optional | If custom part receives shadows from the scene (default false). |
| options.castShadow | boolean | Optional | If custom part casts shadows to other parts (default false). |
| options.renderOrder | number | Optional | Render order of custom part (default is 0). |
Examples
Unlimited3D.updateCustomPart({customPart: "customPartName", options: {position:[0, 0, -0.1]}},(e,r)=>console.log(e,r))
Action
getAvailableTransitions
Gets info about available modifier transitions.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableTransitionsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "TransitionName"
// shortName: "TransitionName"
// targetType: "camera"
// type: "transition"
// }
// ]
Unlimited3D.getAvailableTransitions(function(error, result) { console.log(result); });
getAvailableModifiers
Gets info about available modifiers.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableModifiersCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "ModifierName"
// shortName: "ModifierName"
// type: "modifier"
// }
// ]
Unlimited3D.getAvailableModifiers(function(error, result) { console.log(result); });
activateModifier
Activates specified modifier.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| modifier | string | Required | Name of modifier to activate. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateModifier({ modifier: "NameOfModifier" });
activateTransition
Activates specified transition.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| transition | string | Required | Name of transition to activate. |
| target | string | Optional | Name of transition target. If not specified, transition will use previously defined target. |
| duration | number | Optional | Duration of transition in milliseconds. |
| config | Object | Optional | Object containg properties of transition to change depending on transition type. Example: position, scale |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
onPointerClick: function(objectsClick) {
if(objectsClick.length>0 && objectsClick[0].type == 'annotation') {
if( objectsClick[0].shortName == 'AnnotationName' ){
Unlimited3D.activateTransition({transition: 'NameOfTransition'});
}
}
}
Unlimited3D.activateTransition({transition: 'NameOfTransition'});
deactivateTransition
Deactivates transition if it is currently active.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| transition | string | Required | Name of transition to deactivate. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.deactivateTransition({transition: 'NameOfTransition'});
activateObjectControl
Activates object controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateObjectControl();
deactivateObjectControl
Deactivates object controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.deactivateObjectControl();
updateObjectControls
Updates object controls options.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| mode | string | Optional | 'Rotate' or 'Translate', default is 'Rotate'. |
| targetOnSelection | boolean | Optional | If target should be changed when part is selected. |
| minPolarAngle | number | Optional | Minimal vertical angle. |
| maxPolarAngle | number | Optional | Maximal vertical angle. |
| minAzimuthAngle | number | Optional | Minimal horizontal angle. |
| maxAzimuthAngle | number | Optional | Maximal horizontal angle. |
| dampingFactor | number | Optional | Damping factor after dragging. |
| draggingDampingFactor | number | Optional | Damping factor while dragging. |
| polarRotateSpeed | number | Optional | Vertical rotate speed. |
| azimuthRotateSpeed | number | Optional | Horizontal rotate speed. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.updateObjectControls({
name: 'object_name',
mode: 'Rotate',
maxDistance : 10.2,
minDistance : 2.6,
zoomEnabled : true,
zoomSpeed : 5.1,
rotationSpeed : 10.6,
rotationSpeedTouch : 1.1,
horizontalRotationEnabled : false,
verticalRotationEnabled : true,
});
setObjectControlTarget
Sets target part for object controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| target | string | Required | Name of target part. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setObjectControlTarget({ target: 'TargetName' });
Overlay
activateOverlayControls
Activates overlay controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateOverlayControls();
deactivateOverlayControls
Deactivates overlay controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.deactivateOverlayControls();
setActiveOverlayEntryForOverlayControls
Sets active overlay entry for overlay controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlayEntry | string | Required | Name of active overlay entry. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setActiveOverlayEntryForOverlayControls({ overlayEntry: 'OverlayEntryName' });
getActiveOverlayEntryForOverlayControls
Gets active overlay entry for overlay controls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getActiveOverlayEntryForOverlayControlsCallback | Optional | Called after action is completed. |
Examples
// Returns
// {
// name: "OverlayEntryName"
// shortName: "OverlayEntryName"
// type: "overlayEntry"
// }
Unlimited3D.getActiveOverlayEntryForOverlayControls();
setOverlayEntryFilter
Sets overlay entries that are managed by overlay controls, if null then all entries are managed. This filter is reset to null if target part is changed.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlayEntryFilter | Array.<string> | null | Required | array of names of overlay entries or null. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setOverlayEntryFilter({ overlayEntryFilter: ['OverlayEntryName1', 'OverlayEntryName2'] });
updateOverlayControls
Updates overlay controls options.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| resolution | number | Optional | Resolution of texture rendered by overlay controls. |
| targetOnSelection | boolean | Optional | If target should be changed when part is selected. |
| frameFillColor | string | Optional | Color of frame that represents boundaries of overlay entry. |
| frameOpacity | string | Optional | Opacity of frame that represents boundaries of overlay entry. |
| frameWidth | number | Optional | Width of frame that represents boundaries of overlay entry. |
| showSideBounds | boolean | Optional | If side bounds for lateral scaling are enabled. |
| boundFillColor | string | Optional | Fill color of symbols on the corners of boundaries. |
| boundStrokeColor | string | Optional | Stroke color of symbols on the corners of boundaries. |
| boundScale | number | Optional | Scale of symbols on the corners of boundaries. |
| boundFillScale | number | Optional | Scale of fill part of symbols relative to whole symbols on the corners of boundaries. |
| boundShape | string | Optional | Shape of bound symbol. Can be 'square' or 'circle'. Default is 'square'. |
| backgroundColor | string | Optional | Color of area for active overlay entry. |
| backgroundOpacity | number | Optional | Opacity of area for active overlay entry. |
| colorPickEnabled | boolean | Optional | If color picking trigger is enabled (OverlayControlsColor trigger). |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.updateOverlayControls({ frameFillColor: '#ff0000', backgroundOpacity: 0.1 });
setOverlayControlsTarget
Sets overlay controls target part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| target | string | null | Required | target part, null to remove existing target. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setOverlayControlsTarget({ target: 'PartName' });
getOverlaySnapshot
Gets snapshot of overlay with uv map of given part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| saveEnabled | boolean | Optional | If result image should be saved as file. |
| outputFileName | string | Optional | File name of saved image, saveEnabled must be true. |
| overlay | string | Required | Name of overlay for which to create snapshot. |
| parts | Array.<string> | Optional | If present, uv map of parts will be drawn in the background (only one part is currently supported). |
| resolution | number | Optional | Resolution of created image (for example, 1024) |
| backgroundColor | string | Optional | Color of background of created image. |
| backgroundOpacity | number | Optional | Opacity of background of created image. |
| showUVs | boolean | Optional | If uv lines are shown. |
| showUVEdges | boolean | Optional | If uv edges are shown. |
| uvColor | string | Optional | Color of uv map of created image. |
| uvOpacity | number | Optional | Opacity of uv map of created image if present. |
| uvEdgeColor | string | Optional | Color of edges of uv map of created image. |
| uvEdgeWidth | number | Optional | Width of uv edge lines. |
| callback | getOverlaySnapshotCallback | Optional | Called after action is completed. |
getAvailableOverlays
Gets available overlays.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableOverlaysCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// entries: [
// {
// name: "Overlay Entry Name",
// shortName: "Overlay Entry Short Name",
// type: "overlayEntry",
// }
// ],
// name: "Overlay Name",
// shortName: "Overlay Short Name",
// type: "overlay"
// }
// ]
Unlimited3D.getAvailableOverlays((error, result) => console.log(result));
getPartOverlays
Gets overlays for specified part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| part | string | Required | Part name. |
| callback | getPartOverlaysCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// entries: [
// {
// name: "Overlay Entry Name",
// shortName: "Overlay Entry Short Name",
// type: "overlayEntry",
// }
// ],
// name: "Overlay Name",
// shortName: "Overlay Short Name",
// type: "overlay"
// }
// ]
Unlimited3D.getPartOverlays({ part: 'PartName' }, (error, result) => console.log(result));
setOverlayToPart
Sets overlay to specified part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay to set. |
| part | string | Required | Part name. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setOverlayToPart({ overlay: 'OverlayName, part: 'PartName' }, (error) => console.log(error));
setOverlayEntriesToOverlay
Sets overlay entries to overlay.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay to set entries to. |
| entries | Array.<string> | Required | Array of overlay entries to be set to overlay (order: back to front). |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setOverlayEntriesToOverlay({overlay:'overlayName', entries:['overlayEntryName1', 'overlayEntryName2', 'overlayEntryName3']}, (e,r)=>{console.log(e,r)})
removeOverlayFromPart
Removes overlay from specified part.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay to set. |
| part | string | Required | Part name. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.removeOverlayFromPart({ overlay: 'OverlayName, part: 'PartName' }, (error) => console.log(error));
updateOverlay
Updates options of overlay.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay to set. |
| overlayEntry | string | Required | Name of overlay entry to set. |
| options | Object | Optional | Overlay options. |
| options.fontUrl | string | Optional | Url to font to use for overlay text. |
| options.imageUrl | string | Optional | Url to use as image for overlay. |
| options.text | string | Optional | Text to display in overlay. |
| options.dFontColor | string | Optional | Color of text in hex. |
| options.fontScale | number | Optional | Scale of the font. Minimum value 0.0. |
| options.fontWeight | string | Optional | Font Weight. Possible values: 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'. |
| options.fontSpacing | number | Optional | Font Spacing. Minimum value 1.0. |
| options.fontStyle | string | Optional | Font style. Possible values: 'normal' 'italic', 'oblique'. |
| options.enabled | boolean | Optional | Is overlay item enabled. |
| options.opacity | number | Optional | Opacity of overlay item. Possible values [0.0, 1.0]. |
| options.flipH | boolean | Optional | Flips the overlay texture horizontally. |
| options.flipV | boolean | Optional | Flips the overlay texture vertically. |
| options.scalingMode | string | Optional | Scale overlay values : 'scaleToFit', 'scaleToFill' and 'fill', 'fill' is default value. |
| options.scalingAlignment | Array.<string> | Optional | Array of two values that determines horizontal and vertical alignment of overlay if scaling mode is scaleToFit or scaleToFill. First value should be 'left', 'center' or 'right', second value 'up', 'center' or 'down'. |
| options.scale | Array.<number> | Optional | Scale accept two parameters in array, first is on X-axis and Y-axis. |
| options.tiling | any | Optional | ... |
| options.repeat | any | Optional | ... |
| options.padding | number | Optional | Padding on overlay. |
| options.offset | Array.<number> | Optional | Moves image on object part. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.updateOverlay({
overlay: 'OverlayName',
overlayEntry: 'Image',
options: { imageUrl: 'url-to-image' }
});
Unlimited3D.updateOverlay({
overlay: 'OverlayName',
overlayEntry: 'Text',
options: {
text: 'Hello',
fontUrl: 'url-to-font',
dFontColor: '#000000',
fontScale: 0.2,
fontWeight: 'normal',
fontSpacing: 0.0,
enabled: true,
}
});
Unlimited3D.updateOverlay({
overlay: 'OverlayName',
overlayEntry: 'Image',
options: {
scalingMode: 'scaleToFill',
scalingAlignment: ['center', 'down']
}
});
getOverlayConfig
Gets current overlay configuration for given overlay and it's overlay entry.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay. |
| overlayEntry | string | Required | Name of overlay entry. |
| callback | getOverlayConfigCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getOverlayConfig({
overlay: 'overlay1',
overlayEntry: 'overlayEntry1'
}, (error, result) => { console.log(result); });
getOverlayOverlayEntries
Gets available overlay entries in specified overlay.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay. |
| callback | getOverlayOverlayEntriesCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "Overlay Entry Name",
// shortName: "Overlay Entry Short Name",
// type: "overlayEntry"
// }
// ]
Unlimited3D.getOverlayOverlayEntries({ overlay: 'Overlay01' }, (error, result) => { console.log(result); });
getOverlaysWithOverlayEntry
Gets overlays that contain given overlay entry.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlayEntry | string | Required | Name of overlay entry. |
| callback | getOverlaysWithOverlayEntryCallback | Optional | Called after action is completed. |
Examples
// [
// {
// name: "Overlay Name",
// shortName: "Overlay Short Name",
// type: "overlay"
// }
// ]
Unlimited3D.getOverlaysWithOverlayEntry({ overlayEntry: 'Overlay Entry name' }, () => {});
getAvailableOverlayEntries
Gets all available overlay entries.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableOverlayEntriesCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "Overlay Entry Name",
// shortName: "Overlay Entry Short Name",
// type: "overlayEntry"
// }
// ]
Unlimited3D.getAvailableOverlayEntries(() => {});
addEntryToOverlay
Add entry to overlay. If index is not specified entry will be added to end.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay to which entry should be added. |
| overlayEntry | string | Required | Name of overlay entry to add. |
| index | number | Optional | Index of the overlay entry. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.addEntryToOverlay({ overlay: 'overlay_name', overlayEntry: 'overlayEntry_name', index : 5 });
removeEntryFromOverlay
Remove entry from overlay.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| overlay | string | Required | Name of overlay from which entry should be removed. |
| overlayEntry | string | Required | Name of overlay entry to remove. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.removeEntryFromOverlay({ overlay: 'overlay_name', overlayEntry: 'overlayEntry_name' });
createOverlayEntry
Creates new overlay entry.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| type | string | Required | Can be 'Text' or 'Image'. |
| name | string | Required | Name of overlay entry. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.createOverlayEntry({ type: 'Text', name: 'overlayEntry_name' }, (e, r) => console.log(e, r));
Model
getModelPosition
Gets model position.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of model. |
| callback | getModelPositionCallback | Optional | Called after action is completed. |
Examples
// Returns
// [0, 0, 0]
Unlimited3D.getModelPosition({ name: 'ModelName' }, (e, r) => { console.log(r); });
setModelPosition
Sets position of model.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of model. |
| position | Array.<number> | Optional | Position value. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setModelPosition({ name: 'ModelName', position: [1, 0, 0] });
showModels
Shows specified models.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| models | Array.<string> | Required | Names of models to show. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showModels({ models: ['ModelName1', 'ModelName2'] });
hideModels
Hides specified models.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| models | Array.<string> | Required | Names of models to hide. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.hideModels({ models: ['ModelName1', 'ModelName2'] });
showOnlyModels
Shows only specified models while the rest are hidden.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| models | Array.<string> | Required | Names of models to show. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.showOnlyModels({ models: ['ModelName1', 'ModelName2'] });
Unclassified
cloneModel
Clones given model.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| model | string | Required | Name of the model to be cloned. |
| callback | cloneModelCallback | Required | Called after action is completed, returns cloned model data. |
setConfigLogEnabled
Sets if configuration will be logged for upcoming calls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| value | boolean | Required |
Decoration
activateDecorationOnParts
Activates decoration on parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Parts on which to apply decoration. |
| decoration | string | Optional | Decoration to use. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateDecorationOnParts({ parts : ['part_name'], decoration : 'decoration _name' });
deactivateDecorationFromParts
Deactivates decoration on parts.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| parts | Array.<string> | Required | Parts from which to remove decoration. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.deactivateDecorationFromParts({ parts : ['part_name1', 'part_name2'] });
Animation
getAvailableAnimationSets
Gets all available animation sets.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAvailableAnimationSetsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// name: "AnimationSet"
// shortName: "AnimationSet"
// type: "animationSet"
// }
// ]
Unlimited3D.getAvailableAnimationSets( (error, result) => console.log(result));
getAvailableAnimationStates
Gets all available animation states.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | getAvailableAnimationStatesCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// type: 'animationState',
// shortName: 'State Short Name',
// name: 'State Name',
// animationSetName: 'Set Name',
// animationSetShortName: 'Set Short Name'
// }
// ]
Unlimited3D.getAvailableAnimationStates({ animationSet: 'AnimationSet1' }, (error, result) => console.log(result));
getAvailableAnimationTransitions
Gets all available animation transitions.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | getAvailableAnimationTransitionsCallback | Optional | Called after action is completed. |
Examples
// Returns
// [
// {
// type: 'animationTransition',
// shortName: 'Transition Short Name',
// name: 'Transition Name',
// animationSetName: 'Set Name',
// animationSetShortName: 'Set Short Name'
// }
// ]
Unlimited3D.getAvailableAnimationTransitions(
{ animationSet: 'animation_set_name' },
(error,result) => console.log(result) )
);
playAnimationSet
Play animation set.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.playAnimationSet({ animationSet: 'animation_set_name' });
stopAnimationSet
Stop animation set.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.stopAnimationSet({ animationSet: 'animation_set_name' });
isAnimationSetPlaying
Is animation set playing.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | isAnimationSetPlayingCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.isAnimationSetPlaying({ animationSet: 'animation_set_name' }, (error, result) => { console.log(result); });
activateAnimationState
Activates animation state.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| animationState | string | Required | Name of animation state. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateAnimationState({
animationSet: 'AnimationSet1',
animationState: 'AnimationState1'
});
activateAnimationTransition
Activates animation transition.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| animationTransition | string | Required | Name of animation transition. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.activateAnimationTransition({
animationSet: 'AnimationSet1',
animationTransition: 'AnimationTransition1'
});
getCurrentAnimationState
Gets current animation state.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | getCurrentAnimationStateCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getCurrentAnimationState({ animationSet: 'animation_set_name' }, (error,result) => console.log(result));
getCurrentAnimationTransition
Gets current animation transition.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| animationSet | string | Required | Name of animation set. |
| callback | getCurrentAnimationStateCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getCurrentAnimationTransition({ animationSet: 'animation_set_name' }, (error,result) => console.log(result));
setMorphTarget
Sets Morph target value for a given model name and morph target name.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| model | String | Required | Name of the target model that contains morph target. |
| morphTarget | String | Required | Name of the morph target whose value needs changing. |
| value | Number | Required | Value to be set to this morph target. Values range is 0-1. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setMorphTarget({ model: 'modelName', morphTarget: 'morphTargetName', value: 0.5 });
getModelMorphTargets
Gets names of morph targets available in a model.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| model | string | Required | Name of model to be queried for morph targets. |
| callback | getModelMorphTargetsCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getModelMorphTargets({ model: 'modelName' }, (error, result) => { console.log(error, result); });
isAnimatedMaterialMap
Checks if material map is animated texture
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material which map is checked. |
| mapType | string | Required | Type of material map. |
| callback | isAnimatedMaterialMapCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.isAnimatedMaterialMap({ material: 'materialName', mapType: 'alphaMap' }, (error, result) => { console.log(error, result); });
getAnimatedMaterialMapCurrent
Gets relative value of current frame in [0., 1.] range.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material for which map is queried. |
| mapType | string | Required | Type of material map. |
| callback | getAnimatedMaterialMapCurrentCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.getAnimatedMaterialMapCurrent({ material: 'materialName', mapType: 'alphaMap' }, (error, result) => { console.log(error, result); });
setAnimatedMaterialMapCurrent
Sets relative value of current frame in [0., 1.] range.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material for which map is queried. |
| mapType | string | Required | Type of material map. |
| value | number | Required | Relative frame value in range [0., 1.] |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.setAnimatedMaterialMapCurrent({ material: 'materialName', mapType: 'alphaMap', value: 0.4 }, (error, result) => { console.log(error, result); });
playAnimatedMaterialMap
Plays animated material map from the current frame.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material for which map is queried. |
| mapType | string | Required | Type of material map. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.playAnimatedMaterialMap({ material: 'materialName', mapType: 'alphaMap' }, (error, result) => { console.log(error, result); });
pauseAnimatedMaterialMap
Pauses animated material map at the current frame.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material for which map is queried. |
| mapType | string | Required | Type of material map. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.pauseAnimatedMaterialMap({ material: 'materialName', mapType: 'alphaMap' }, (error, result) => { console.log(error, result); });
stopAnimatedMaterialMap
Stops animated material map and resets current frame.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| material | string | Required | Name of material for which map is queried. |
| mapType | string | Required | Type of material map. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.stopAnimatedMaterialMap({ material: 'materialName', mapType: 'alphaMap' }, (error, result) => { console.log(error, result); });
Feedback
createFeedbackMarker
Creates new feedback marker.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of feedback marker. |
| targetName | string | Required | Name of the object on top of which feedback should be created, it can be used to calculate marker size. |
| targetType | string | Required | Type of the object on top of which feedback should be created, it can be used to calculate marker size. |
| material | string | Optional | Custom material that will be user instead of single color material. |
| position | Array.<number> | Optional | Position where marker will be created. |
| radius | number | Optional | Radius of marker, how value will be applied depends on radiusMode. |
| radiusMode | string | Required | Mode to determine the size of marker. |
| color | string | Required | Color of marker material. |
| callback | createFeedbackMarkerCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.createFeedbackMarker({
name: 'Marker',
targetName: 'Part Name,
targetType: 'part',
material: 'Material',
position: [0, 0, 0],
radius: 1.0,
radiusMode: 'Absolute',
color: '#ffffff',
}, (e, marker) => console.log(marker));
removeFeedbackMarker
Removes feedback marker.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of feedback marker. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.removeFeedbackMarker({ name:"name_marker" });
isFeedbackMarker
Is object with specified name feedback marker.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| name | string | Required | Name of feedback marker. |
| callback | isFeedbackMarkerCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.isFeedbackMarker({ name: 'FeedbackMarkerName' }, (error,result) => { console.log(result); });
getAllFeedbackMarkers
Gets names of all available feedback markers.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getAllFeedbackMarkersCallback | Optional | Called after action is completed. |
Examples
// Returns
// {
// names: [
// 'Feedback Marker',
// ],
// }
Unlimited3D.getAllFeedbackMarkers((error ,response) => { console.log(error ,response); });
Export & AR
exportToGLB
Exports current scene to GLB. Export should be previously allowed in solution.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| options | Object | Optional | Export options. |
| options.meshNodes | Array.<string> | Optional | List of mesh nodes to export, otherwise all active nodes are exported. |
| options.overlaysVisible | boolean | Optional | if overlays are exported. |
| options.decalsVisible | boolean | Optional | if decals are exported. |
| options.decalsOffsetFactor | number | Optional | offset factor for decals to avoid z-fighting. |
| options.convertImages | boolean | Optional | convertImages to given format, default is false. |
| options.imageFormat | string | Optional | format of converted images, default is 'png'. |
| options.imageQuality | number | Optional | quality of converted images, default is 1.0. |
| options.imageSizeLimit | number | Optional | maximum size of converted images (size is dimensions for square textures), default is null. |
| options.flipYtoUV | boolean | Optional | flip images based on uv settings, default is false. |
| options.materialColorToLinear | boolean | Optional | convert material color to linear. Default is true. |
| callback | exportToGLBCallback | Optional | Called after action is completed. |
getConfigJSON
Exports current scene configuration to JSON object. It can be used at init to load current scene state. Configuration currently doesn't support immediate API calls such as animation or transition calls.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| callback | getConfigJSONCallback | Optional | Called after action is completed. |
exportToUSDZ
Exports current scene to USDZ. Export should be previously allowed in solution.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| options | Object | Optional | Export options. |
| options.meshNodes | Array.<string> | Optional | List of mesh nodes to export, otherwise all active nodes are exported. |
| options.overlaysVisible | boolean | Optional | if overlays are exported. |
| options.decalsVisible | boolean | Optional | if decals are exported. |
| options.decalsOffsetFactor | number | Optional | offset factor for decals to avoid z-fighting. |
| callback | exportToUSDZCallback | Optional | Called after action is completed. |
toggleAR
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| device | String | Required | Target device. Currently supported options are 'ios' and 'android'. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.toggleAR({ device: 'android' });
xr
Toggles Live Augmented Reality (AR) on the fly. This method generates an AR experience from the configured scene without needing predefined AR files. It supports cross-platform functionality, handling iOS, Android, and desktop devices. The method determines the device type and executes the appropriate AR process.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| options | Object | Optional | Configuration options for the AR session. |
| options.forceDevice | string | Optional | Manually specifies the device type to be used. Valid values are 'ios', 'android', 'visionpro', and 'desktop'. If not specified, the device type is determined automatically. |
| options.parts | Array.<string> | Optional | List of parts to include in the AR session. |
| options.landingPage | Object | Optional | Customization options for the AR landing page. |
| options.landingPage.body | Object | Optional | Styles for the landing page body. |
| options.landingPage.logo | Object | Optional | Configuration for the landing page logo, including styles. |
| options.landingPage.spinner | Object | Optional | Configuration for the landing page spinner, including styles and text styles. |
| options.landingPage.button | Object | Optional | Configuration for the landing page button, including text and styles. |
| callback | xrCallback | Optional | A callback function that is called upon completion of the AR session. |
Examples
// Initiate an AR session on an Android device with specific parts
Unlimited3D.xr({ forceDevice: 'android', parts: ['part1', 'part2'] });
// Initiate an AR session with a customized landing page. URLs for assets need to be public links.
Unlimited3D.xr({
landingPage: {
body: { background: '#fff' },
logo: { styles: { backgroundImage: 'url(./custom-logo.png)' } },
spinner: { styles: { backgroundImage: 'url(./custom-spinner.gif)' } },
button: { text: 'Start AR Experience', styles: { background: '#f00' } }
}
});
getConfigLogEnabled
If configuration is logged for upcoming API calls.
Postprocessing
changeBloomOptions
Changes values for Bloom Postprocessing effect.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| chainName | String | Required | Name of the postprocessing chain to be affected. |
| options | String | Required | Object containing options to be changed as key-value pairs. Allowed keys are 'blIntensity', 'blLuminanceThreshold', 'blLuminanceSmoothing' and 'blRadius'. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changeBloomOptions({ chainName: 'POST PROCESSING', options: { blIntensity: 3 } } );
changePostprocessingOptions
Changes values Postprocessing chain.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| chainName | String | Required | Name of the postprocessing chain to be affected. |
| options | String | Required | Object containing options to be changed. Options are named in upper case, just like on the platform. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.changePostprocessingOptions({
chainName: 'POST PROCESSING',
options: {
"DOF": {
Enabled: true,
FocalLength: 1
},
"COLOR ADJUSTMENT": {
Enabled: false,
}
},
}, (error, result) => { console.log(error, result) });
enablePostProcessing
Enable or disable postprocessing.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
| enable | boolean | Optional | if ambient occlusion map should be enabled, default is true. |
| callback | noResultCallback | Optional | Called after action is completed. |
Examples
Unlimited3D.enablePostProcessing({ enable: false });