Hi, Is there any method to change texture dynamically from script file like this example in iOS?
Hi, you can change colors and whether the nodes are enables, but the issue with textures is that they won’t be saved to an effect unless they are used, and scripts doesn’t support downloading files.
There is likely a workaround that would work for you, can you explain your use case further?
Thank you for your reply,I achieved it by using multiple quads and then looping through all of them, enabling and disabling as needed.
Hello, could you please add a function to update the texture from the script? I am developing games in DeepAr that involves face tracking, and there is a frequent need to update the textures. The current method of achieving this by enabling and disabling nodes has become a very tedious task.
Wouldn’t it be easier to add a function where we can pass the path of the texture relative to the resources directory as a string, and pre-import the textures into resources as usual?
For example, manually import the texture image (background.png) in DeepAr using the import resource menu. Then, update the texture through the script API using the following function:
Utility.changeParameter('bg', "MeshRenderer", 'texture1',"background.png" );
Thank you!
Unfortunately, no since that would interfere with effect optimisation which removes all unused textures.
A trick we have used internally is to load all of the textures in as a PNG sequence animation and use triggers from a script to switch between them