|
@@ -145,20 +145,31 @@ Component({
|
|
|
// }
|
|
|
|
|
|
|
|
|
- // for (const mesh of othergltf.model.meshes) {
|
|
|
- // // mesh.material = newMat
|
|
|
- // console.warn('othergltf-m', mesh.name)
|
|
|
- // }
|
|
|
+ for (const mesh of othergltf.model.meshes) {
|
|
|
+ // mesh.material = newMat
|
|
|
|
|
|
- for (const mesh of gltf.getPrimitivesByNodeName('node_video1_-7064')) {
|
|
|
- mesh.material = newMat
|
|
|
- // console.warn('mesh1', mesh)
|
|
|
- }
|
|
|
- for (const mesh of gltf.getPrimitivesByNodeName('node_video2_-7072')) {
|
|
|
- mesh.material = newMat2
|
|
|
- // console.warn('mesh2', mesh)
|
|
|
+ if (String(mesh.name).includes('video1')) {
|
|
|
+ const videoMesh1 = gltf.getPrimitivesByMeshName(mesh.name)
|
|
|
+ console.warn('videoMesh1', mesh.name, videoMesh1[0].nodeName)
|
|
|
+ for (const mesh of gltf.getPrimitivesByNodeName(videoMesh1[0].nodeName)) {
|
|
|
+ mesh.material = newMat
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (String(mesh.name).includes('video2')) {
|
|
|
+ const videoMesh2 = gltf.getPrimitivesByMeshName(mesh.name)
|
|
|
+ console.warn('videoMesh2', mesh.name, videoMesh2[0].nodeName)
|
|
|
+ for (const mesh of gltf.getPrimitivesByNodeName(videoMesh2[0].nodeName)) {
|
|
|
+ mesh.material = newMat2
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ // for (const mesh of gltf.getPrimitivesByNodeName('node_video2_-7072')) {
|
|
|
+ // mesh.material = newMat2
|
|
|
+ // // console.warn('mesh2', mesh)
|
|
|
+ // }
|
|
|
+
|
|
|
},
|
|
|
handleItem2Loaded({
|
|
|
detail
|
|
@@ -198,7 +209,7 @@ Component({
|
|
|
}
|
|
|
}
|
|
|
if (this.animator1) {
|
|
|
- this.data.isStartPlay1 ? this.animator1.resume('dd2') : this.animator1.play('dd2')
|
|
|
+ this.data.isStartPlay1 ? this.animator1.resume('dd3') : this.animator1.play('dd3')
|
|
|
}
|
|
|
this.setData({
|
|
|
isStartPlay1: true
|
|
@@ -248,7 +259,7 @@ Component({
|
|
|
this.innerAudioContext1.pause()
|
|
|
}
|
|
|
if (this.animator1) {
|
|
|
- this.animator1.pause('dd2')
|
|
|
+ this.animator1.pause('dd3')
|
|
|
}
|
|
|
}
|
|
|
if (type === 2) {
|
|
@@ -265,6 +276,9 @@ Component({
|
|
|
// 事件的值即为`ARTracker`实例
|
|
|
const tracker = detail.value;
|
|
|
// 获取当前状态和错误信息
|
|
|
+
|
|
|
+ console.log('tracker', tracker)
|
|
|
+
|
|
|
const {
|
|
|
state,
|
|
|
errorMessage
|