Blender documentation regarding the use of dynamic texture in BGE ( http://wiki.blender.org/index.php/Do...I/VideoTexture) makes it clear that if necessary, we also have the ability to use a texture that already exists for reuse:
VideoTexture.Texture is the class that creates the Texture object that loads the dynamic texture on the GPU. The constructor takes one mandatory and three optional arguments:
The game object.
Material index as returned by VideoTexture.materialID(), 0 = first material by default.
Texture index in case of multi-texture channel, 0 = first channel by default.
In case of UV texture, this parameter should always be 0.
Reference to another Texture object of which we want to reuse the texture.
If we use this argument, we should not create any source on this texture and there is no need to refresh it either: the other Texture object will provide the texture for both materials/textures.
I am in version 2.66 and it's been a while since I try to replace as BGE, the texture of an object with that of another object, but it never works? Here is an excerpt of my script:
p1 = logic.getCurrentScene().objects['p1']
p2 = logic.getCurrentScene().objects['p2']
ID1 = texture.materialID(p1, "IM1.png")
ID2 = texture.materialID(p2, "IM2.png")
p2['p2'] = texture.Texture(p2, ID2)
p1['p1'] = texture.Texture(p1, ID1, 0, p2['p2'])
What to do please?
Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests