I’m trying to create an AnimationClip to change Mesh.material.map.offset values.
My goal is to obtain a material animation. What I tried so far is based on AnimationClipCreator.js:
let duration = 1000
let times = [0, duration / 2, duration],
values = [0,0, .5,.5, 0,0]
let trackName = 'node_name.material.map.offset'
let track = new THREE.VectorKeyframeTrack(trackName, times, values)
let clip = new THREE.AnimationClip('material_animation_name', duration, [track])
let mixer = new THREE.AnimationMixer(scene)
mixer.clipAction(clip).play()
I noticed that VectorKeyframeTrack is only used for Vector3 data, such as .position or .scale values. Can it be used also for Vector2 data like Texture.offset?
I also tried setting trackName as:
let trackName = 'node_name.material.map[offset]'
but what I get in the scene graph at that location is an interpolated Scalar value instead of a Vector2 value.
The scene graph of the scene variable is:
scene: Scene {
...,
children: Array(2) {
0: Bone { uuid: "ADBCD7D7-9431-48...", name: "bone_name", type: "Bone", ... },
1: SkinnedMesh { uuid: "56C8D82F-8E5B-47...", name: "node_name", type: "SkinnedMesh", ... }
},
...
}
Thanks in advance,
Stefano
.