API Highlights
Animations
editor.playAnimation(name)
editor.toggleAnimation(name)
editor.playAllAnimations()
editor.stopAllAnimations()
editor.getCurrentAnimation()
editor.animationList()Post-Processing
editor.setPostProcessing({ name, effect: options })Camera
editor.setActiveCamera(camera)
editor.setDynamicCamera({ position: Vector3, target: Vector3 })Scene
editor.setActiveByName('MeshName')
editor.getMeshById('123')
editor.updateObjectData(node, newData)
editor.deleteModelPart(id)Materials
utilsMat.createMaterialFromAsset(asset)
utilsMat.updateMaterialProps(props)
utilsMat.updateMaterialTextures(texture)//Create custom shapes
import React from 'react'
import { useCustomObjects } from '...'
const AddObjectsPanel: React.FC = () => {
const { create } = useCustomObjects()
return (
<div>
<button onClick={() => create.plane()}>Add plane</button>
<button onClick={() => create.box('box-1')}>Add box with id</button>
<button onClick={() => create.sphere()}>Add sphere</button>
<button onClick={() => create.shadowPlane()}>Addshadow plane</button>
<button onClick={() => create.target()}>Add target</button>
</div>
)
}//Create custom lights
import React from 'react'
import { useCustomObjects } from '...'
const AddObjectsPanel: React.FC = () => {
const { create } = useCustomLights()
return (
<div>
<button onClick={() => create.pointLight()}>Add point</button>
<button onClick={() => create.hemisphereLight()}>Add hemi</button>
</div>
)
}//Create custom camera
import React from 'react'
import { useCustomObjects } from '...'
const AddObjectsPanel: React.FC = () => {
const { create } = useCustomCameras()
return (
<div>
<button onClick={() => create.perspective()}>Add perspective camera</button>
</div>
)
}Last updated on