Forum

change_image() affects all scenes loaded from the same origin

26 August 2016 13:53 #11427
Hi,

we want to create an application in which it is possible to spawn an arbitary amount of objects and move them around. Lets say we are talking about sofas for a clear example. It should be possible to place the same type multiple times. It also should be possible to change the textures applied to it independant from all other sofas.

When we change the texture of an object, for example with…

change_image(scene02_obj, "some_text_name", new_image_path);

…it also has an effect on all other loaded sofas of that kind, although we explicitly passed the object instance that we want to modify.

The scenes are both loaded from the same url using data.load(). It seems that b4w notices that circumstance and tries to avoid to load the same resources multiple times. The object uses b4w_do_not_batch and b4w_dynamic_geometry. The blend4web Version is 16.07.

How can we achieve to load the same scene multiple times and swap only the texture of a certain scene?

Thanks!
@ VisCircle GmbH
26 August 2016 18:12 #11431
hi,

The scenes are both loaded from the same url using data.load(). It seems that b4w notices that circumstance and tries to avoid to load the same resources multiple times.
Yes, we use cache for node materials and the engine tries to share one texture between similar objects. However, we fixed the "change_image" method itself and it should work in any case from now.

We'll update our 16.08 developer preview tonight, so you can test it or just wait for a stable release on the next week.
Blend4Web Team
 
Please register or log in to leave a reply.