Flutter plugin: changeParamter for texture change in background segmentation

Hi, I would like to use our filter for background segmentation with the Flutter plugin and change the background texture.
Currently I tried following function call:

deepArController.changeParameter(gameObject: 'Background', component: 'MeshRenderer', parameter: 's_texColor', newParameter: base64String);

Is the gameObject parameter reffering to the node in the filter?
is ‘s_texColor’ the correct value for the parameter?
What type should the newParameter be? A file path, a base64 string, file object or something else?

Best,
Tobi

1 Like

Hi Tobi

For this use case the newParameter should be a path string to the new image,
gameObject is indeed the node name and the parameter should match the internal texture name, this will depend on the sharer used.

Could you share the effect in question so I can help you check if s_texColor is correct?

hi @jelena I tried this solution, but the background was not changed in my part. I tried galaxy_background.deepar
As an effect, that’s why I put the pram like this

 _deepArController.changeParameter(
          gameObject: 'Background',
          component: 'MeshRenderer',
          parameter: 's_texColor',
          newParameter: "assets/prames/Galaxy.jpg");

and it not working
can you help me in that please

This would be correct for an experted background template available in the new studio.

Can you share the exact galaxy_background.deepar file you have, there have been multiple versions.

Or you could export the background template from the new studio as an effect?

i have open it in deep ar studio and check properties and I also change image to anther image ther result is image put as effect in foreground i donot know why , and also export new one from studio but its same result

@jelena please check this

It looks okay on the screenshot can you send the actual effect it looks to be an older version

Hi Jelena,

I’ve checked and s_texColor is the correct parameter for us. You can find our filter attached.
Unfortunately the path string to the new image is not working, the background stays the same texture. I did a little editing in the Flutter plugin and could achieve the texture change with an UIImage for iOS.
It would be very nice to achieve the same with only the path string and no changes in the Flutter plugin, but I don’t know how that is possible.
If it’s not possible, I will provide a PR to enable it.

background_segmentation.deepar.zip (2.6 KB)

@tobsnti can you share with me what did you do in flutter

s_texColor is correct for that effect. I will check with the flutter team. Is it possible you don’t have permission to access assets/prames/Galaxy.jpg or the file location is incorrect?