XR-FRAME修改gltf模型贴图的问题
<xr-asset-load type="gltf" asset-id="gltf-item" src="..."/>
...
<xr-gltf id="gltf1" model="gltf-item"></xr-gltf>
<xr-gltf id="gltf2" model="gltf-item"></xr-gltf>
<xr-gltf id="gltf3" model="gltf-item"></xr-gltf>
...
const gltfElement = this.scene.getElementById("gltf1");
const gltfModel = gltfElement.getComponent(xrFrameSystem.GLTF);
const textureAsset = await this.scene.assets.loadAsset({
type: 'texture',
src: '...'
});
for (const mesh of gltfModel.getPrimitivesByNodeName("tag")) {
mesh.material.setVector('u_specularFactor', xrFrameSystem.Vector3.createFromNumber(0, 0, 0));
mesh.material.setTexture('u_baseColorMap', textureAsset.value);
}
加载多个相同模型时,修改其中一个模型的贴图,其他模型的贴图也会被修改,如何做到只修改单个模型的贴图呢