ME.setShadow() recreate the shadow on demand and returns a promise. This is automatically called upon loading the asset. Options can be passed to manually configure the shadow:
opacity: the opacity of the shadow for a translucent effect - Float
darkness: the strength of the darkest point of the shadow - Float
blur: the amount of blurring of the shadow. - Float
visible: wether or not to show the shadow. Similar to ME.enableShadow(true) - Boolean
spaced: adds space between the model and shadow for a floaing effect. Similar to ME.enableShadow(true,true) - Boolean
ME.setShadowBlur() shorthand to change the shadow blur.
ME.setShadowOpacity() shorthand to change the shadow opacity.
ME.setShadowDarkness() shorthand to change the shadow darkness.
ME.getShadow() returns the current shadow settings as an object.
ME.getShadowBlur() returns the current shadow blur.
ME.getShadowOpacity() returns the current shadow opacity.
ME.getShadowDarkness() returns the current shadow darkness.
Custom lighting support. Pass a lighting Object via customLightingData (options) or setLighting({customLightingData: {...} }) to create bespoke lightings.
ME.reset(bool) reset all settings back to the initially loaded state. Pass true to reset to the API directed settings, and false to reset to the .create directed settings.
Variants support. Variants allow multiple material configurations to be preloaded in an asset. New methods are:
ME.getVariants() returns all available variants in the asset, if any.
ME.getVariant() returns the currect active variant.
ME.setVariant({variant: str, render: bool}) activates the passed variant and optionally renders a new frame
Animation support. Start, stop and pause animations baked in the asset.
ME.startAnimation(bool), starts the animation with optional loop Boolean
ME.stopAnimation(), stops the animation and resets to the first frame
ME.pauseAnimation(), pauses the animation on the current frame. Resume by calling ME.startAnimation()
Customise loader via options:
loaderLogo: The loaderscreen image uri - string
loaderByline: Text shown under the loader progress bar. - string
loaderColor: Max two css colors for the loader progress bar color gradient. Passing just one color results in solid color - Commaseparated string of hexidecimal colors
loader: Pass false to disable the loader altogether - Boolean
Explicitly set Viewer width and height via options:
width: width of the Viewer - css value
height: height of the Viewer - css value
ME.setAmbientIntensity(float). Set the ambientIntensity of the lighting separate from ME.setLighting().
ME.setAutoRotateSpeed(float). Set the autorotate speed separate from ME.enableAutoRotate().
ME.setOpacity(float). Set the Viewer background opacity separate from ME.setBackground().
ME.getObjects(). Report all loaded asset objects name and texturesize.
ME.getObjectNames(). Report the names of all loaded asset objects.
ME.getObject(name). Report a specific object from the loaded asset by name.
Improvement internal: moved ME.scene scope to ME._scene.
Improvement: change setCameraPosition to accept relative zoom level
IMPORTANT: setCameraPosition requires an object now to allow for single param changes. See setCameraPosition()
Improvement: Updated THREE to r153. This has an immediate effect on colormanagement.
IMPORTANT: Colorspace defaults to SRGB now, which means any occurences of color.convertSRGBToLinear() in your app should be removed to prevent incorrect use of color.
Smart loading; the viewer does not load if it is not visible to the end user (via visibility hidden, display none or height/width of 0). This behaviour can be turned off by passing forceLoad: true or data-force-load="true" as an option. See forceLoad.
Added requestRender() method to force a frame render. See requestRender().
Added resizeViewer() method to force recalculation of the Viewer's dimensions. See resizeViewer().
Added cameraZoomLevel option, which sets the initial relative zoom distance based on asset size. See cameraZoomLevel.