in packages/layers/marker/src/Marker.ts [246:299]
show(duration = 1000) {
const timeline = this.timeline
if (!timeline) {
console.warn('timeline not ready')
return
}
if (this._object3d) {
traverse(this._object3d, (mesh) => {
if (IR.isRenderable(mesh)) {
mesh.material.opacity = 0.0
mesh.material.alphaMode = 'BLEND'
}
})
}
if (this._html) {
this.element.style.opacity = '0.0'
}
this.visible = true
timeline.addTrack({
id: 'Marker Show',
startTime: timeline.currentTime,
duration: duration,
onStart: () => {},
onEnd: () => {
if (this._object3d) {
traverse(this._object3d, (mesh) => {
if (IR.isRenderable(mesh)) {
mesh.material.opacity = this._matrOpMap.get(mesh.material) ?? 1.0
mesh.material.alphaMode = this._meshAlphaModes.get(mesh) || ('OPAQUE' as const)
}
})
}
if (this._html) {
this.element.style.opacity = '1.0'
}
this.visible = true
this.updateElement()
},
onUpdate: (t, p) => {
if (this._object3d) {
traverse(this._object3d, (mesh) => {
if (IR.isRenderable(mesh)) {
mesh.material.opacity = (this._matrOpMap.get(mesh.material) ?? 1.0) * p
}
})
}
if (this._html) {
this.element.style.opacity = p.toString()
}
},
})
}