How can I choose multiple photos in one Lense and use them as different textures in different Materials?
I need to choose 3 texture files for my perfect Material.
I wanted to use 3 different Image-Picker-Textures and applied them to 3 Different Materials. I made a UI and tried to load different pictures – but this did not work: If I update one Image-Picker-Texture with a new local file, all other Textures change too.
How can I choose multiple (3 or more) local photos in one Lense and use them as different textures?
Thanks & greetings
Adrian
Try to use copyFrame() after selection to save the texture
Thanks: this sounds exactly like the info I was missing!
(I will check as soon as I can and give you a decent feedback)
Thanks again Rossiev, that worked!
Additionally there was a problem with the callback function of the image picker (as in the example at the bottom: https://lensstudio.snapchat.com/api/classes/ImagePickerTextureProvider/). When I stoped using it, things got better.
// @input Asset.Texture imagePickerTexture_01
//@input Component.MeshVisual meshVisual
// ...
// Script to hide the imagePicker and assign the texture
script.imagePickerTexture_01.control.hideImagePicker();
var textureCopy = script.imagePickerTexture_01.copyFrame();
script.meshVisual.mainPass.baseTex = textureCopy;