﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Doc%3A2.6%2FManual%2FGame_Engine%2FPython_API%2FVideoTexture</id>
	<title>Doc:2.6/Manual/Game Engine/Python API/VideoTexture - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Doc%3A2.6%2FManual%2FGame_Engine%2FPython_API%2FVideoTexture"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Python_API/VideoTexture&amp;action=history"/>
	<updated>2026-06-28T09:23:54Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Python_API/VideoTexture&amp;diff=106117&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Python_API/VideoTexture&amp;diff=106117&amp;oldid=prev"/>
		<updated>2018-06-28T19:45:07Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 19:45時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Python_API/VideoTexture&amp;diff=106116&amp;oldid=prev</id>
		<title>wiki&gt;Ndelgrosso: /* Download the demo */ Link Broken.</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Doc:2.6/Manual/Game_Engine/Python_API/VideoTexture&amp;diff=106116&amp;oldid=prev"/>
		<updated>2013-11-15T14:32:27Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Download the demo: &lt;/span&gt; Link Broken.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Page/Header|2.5|Doc:2.5/Manual/Game Engine/Python API/Bullet physics|Doc:2.5/Manual/Game Engine/Features}}&lt;br /&gt;
&lt;br /&gt;
=The VideoTexture module: bge.texture=&lt;br /&gt;
The &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; module allows you to manipulate textures during the game. Several sources for texture are possible: video files, image files, video capture, memory buffer, camera render or a mix of that. The video and image files can be loaded from the internet using an URL instead of a file name. In addition, you can apply filters on the images before sending them to the GPU, allowing video effect: blue screen, color band, gray, normal map. &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; uses FFmpeg to load images and videos. All the formats and codecs that FFmpeg supports are supported by &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt;, including but not limited to:&lt;br /&gt;
*AVI&lt;br /&gt;
*Ogg&lt;br /&gt;
*Xvid&lt;br /&gt;
*Theora&lt;br /&gt;
*dv1394 camera&lt;br /&gt;
*video4linux capture card (this includes many webcams)&lt;br /&gt;
*videoForWindows capture card (this includes many webcams)&lt;br /&gt;
*JPG&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
==Changes to VideoTexture in Blender 2.6==&lt;br /&gt;
The &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; module is now simply called &amp;lt;code&amp;gt;bge.texture&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
The principle is simple: first you identify an existing texture by object and name, then you create a new texture with dynamic content and swap the two textures in the GPU. The GE is not aware of the substitution and continues to display the object as always, except that you are now in control of the texture. At the end, the new texture is deleted and the old texture restored.&lt;br /&gt;
&lt;br /&gt;
The present page is a guide to the &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; module with simple examples.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
==Game preparation==&lt;br /&gt;
Before you can use the thing &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; module, you must have objects with textures applied appropriately.&lt;br /&gt;
&lt;br /&gt;
Imagine you want to have a television showing live broadcast programs in the game. You will create a television object and UV-apply a different texture at the place of the screen, for example “&amp;lt;code&amp;gt;tv.png&amp;lt;/code&amp;gt;”. What this texture looks like is not important; probably you want to make it dark grey to simulate power-off state. When the television must be turned on, you create a dynamic texture from a video capture card and use it instead of &amp;lt;code&amp;gt;tv.png&amp;lt;/code&amp;gt;: the TV screen will come to life.&lt;br /&gt;
&lt;br /&gt;
You have two ways to define textures that &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; can grab:&lt;br /&gt;
#Simple UV texture.&lt;br /&gt;
#Blender material with image texture channel.&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; works at texture level, it is compatible with all GE fancy texturing features: GLSL, multi-texture, custom shaders, etc.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
==First example==&lt;br /&gt;
Let’s assume that we have a game object with one or more faces assigned to a material/image on which we want to display a video.&lt;br /&gt;
&lt;br /&gt;
The first step is to create a &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object. We will do it in a script that runs once. It can be at the start of the game, the video is only played when you refresh the texture; we’ll come to that later. The script is normally attached to the object on which we want to display the video so that we can easily retrieve the object reference:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 import VideoTexture&lt;br /&gt;
 &lt;br /&gt;
 contr = GameLogic.getCurrentController()&lt;br /&gt;
 obj = contr.owner&lt;br /&gt;
 &lt;br /&gt;
 if not hasattr(GameLogic, 'video'):&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The check on “&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;” attribute is just a trick to make sure we create the texture only once.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Find material===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     matID = VideoTexture.materialID(obj, 'IMvideo.png')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;VideoTexture.materialID()&amp;lt;/code&amp;gt; is a handy function to retrieve the object material that is using &amp;lt;code&amp;gt;video.png&amp;lt;/code&amp;gt; as texture. This method will work with Blender material and UV texture. In case of UV texture, it grabs the internal material corresponding to the faces that are assigned to this texture. In case of Blender material, it grabs the material that has an image texture channel matching the name as first channel.&lt;br /&gt;
&lt;br /&gt;
The “&amp;lt;code&amp;gt;IM&amp;lt;/code&amp;gt;” prefix indicates that we’re searching for a texture name but we can also search for a material by giving the “&amp;lt;code&amp;gt;MA&amp;lt;/code&amp;gt;” prefix. For example, if we want to find the material called &amp;lt;code&amp;gt;VideoMat&amp;lt;/code&amp;gt; on this object, the code becomes:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     matID = VideoTexture.materialID(obj, 'MAVideoMat')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Create texture===&lt;br /&gt;
&amp;lt;code&amp;gt;VideoTexture.Texture&amp;lt;/code&amp;gt; is the class that creates the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object that loads the dynamic texture on the GPU. The constructor takes one mandatory and three optional arguments:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;gameObj&amp;lt;/code&amp;gt;&lt;br /&gt;
:The game object.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;materialID&amp;lt;/code&amp;gt;&lt;br /&gt;
:Material index as returned by &amp;lt;code&amp;gt;VideoTexture.materialID()&amp;lt;/code&amp;gt;, 0&amp;amp;nbsp;= first material by default.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;textureID&amp;lt;/code&amp;gt;&lt;br /&gt;
:Texture index in case of multi-texture channel, 0&amp;amp;nbsp;= first channel by default.&lt;br /&gt;
:In case of UV texture, this parameter should always be 0.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;textureObj&amp;lt;/code&amp;gt; &lt;br /&gt;
:Reference to another &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object of which we want to reuse the texture.&lt;br /&gt;
: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 &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object will provide the texture for both materials/textures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.video = VideoTexture.Texture(obj, matID)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Make texture persistent===&lt;br /&gt;
Note that we have assigned the object to a &amp;lt;code&amp;gt;GameLogic&amp;lt;/code&amp;gt; “&amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;” attribute that we create for the occasion. The reason is that the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object must be persistent across the game scripts. A local variable would be deleted at the end of the script and the GPU texture deleted at the same time. &amp;lt;code&amp;gt;GameLogic&amp;lt;/code&amp;gt; module object is a handy place to store persistent objects.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Create a source===&lt;br /&gt;
Now we have a &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object but it can’t do anything because it does not have any source. We must create a source object from one of the possible sources available in &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;VideoFFmpeg&amp;lt;/code&amp;gt;&lt;br /&gt;
:Moving pictures.&lt;br /&gt;
:Video file, video capture, video streaming.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;ImageFFmpeg&amp;lt;/code&amp;gt;&lt;br /&gt;
:Still pictures.&lt;br /&gt;
:Image file, image on web.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;ImageBuff&amp;lt;/code&amp;gt;&lt;br /&gt;
:Image from application memory.&lt;br /&gt;
:For computer generated images, drawing applications.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;ImageViewport&amp;lt;/code&amp;gt;&lt;br /&gt;
:Part or whole of the viewport (=rendering of the active camera displayed on screen).&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;ImageRender&amp;lt;/code&amp;gt;&lt;br /&gt;
:Render of a non active camera.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;ImageMix&amp;lt;/code&amp;gt;&lt;br /&gt;
:A mix of 2 or more of the above sources.&lt;br /&gt;
&lt;br /&gt;
In this example we use a simple video file as source. The &amp;lt;code&amp;gt;VideoFFmpeg&amp;lt;/code&amp;gt; constructor takes a file name as argument. To avoid any confusion with the location of the file, we will use &amp;lt;code&amp;gt;GameLogic.expandPath()&amp;lt;/code&amp;gt; to build an absolute file name, assuming the video file is in the same directory as the blend file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     movie = GameLogic.expandPath('//trailer_400p.ogg')&lt;br /&gt;
     GameLogic.video.source = VideoTexture.VideoFFmpeg(movie)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We create the video source object and assign it to the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; attribute to set the source and make it persistent: as the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object is persistent, the source object will also be persistent.&lt;br /&gt;
&lt;br /&gt;
Note that we can change the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; source at any time. Suppose we want to switch between two movies during the game. We can do the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.mySources[0] = VideoTexture.VideoFFmpeg('movie1.avi')&lt;br /&gt;
     GameLogic.mySources[1] = VideoTexture.VideoFFmpeg('movie2.avi')&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then assign (and reassign) the source during the game:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.video.source = GameLogic.mySources[movieSel]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Setup the source===&lt;br /&gt;
The &amp;lt;code&amp;gt;VideoFFmpeg&amp;lt;/code&amp;gt; source has several attributes to control the movie playback:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt;&lt;br /&gt;
:[start,stop] (''floats'').&lt;br /&gt;
:Set the start and stop time of the video playback, expressed in seconds from beginning. By default the entire video.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;repeat&amp;lt;/code&amp;gt;&lt;br /&gt;
:(''integer'').&lt;br /&gt;
:Number of video replay, -1 for infinite.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;framerate&amp;lt;/code&amp;gt;&lt;br /&gt;
:(''float'').&lt;br /&gt;
:Relative frame rate, &amp;lt;1.0 for slow, &amp;gt;1.0 for fast.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt;&lt;br /&gt;
:(''bool'').&lt;br /&gt;
:Set to True to activate fast nearest neighbour scaling algorithm.&lt;br /&gt;
:Texture width and height must be a power of 2. If the video picture size is not a power of 2, rescaling is required. By default &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; uses the precise but slow &amp;lt;code&amp;gt;gluScaleImage()&amp;lt;/code&amp;gt; function. Best is to rescale the video offline so that no scaling is necessary at runtime!&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;flip&amp;lt;/code&amp;gt;&lt;br /&gt;
:(''bool'').&lt;br /&gt;
:Set to True if the image must be vertically flipped.&lt;br /&gt;
:FFmpeg always delivers the image upside down, so this attribute is set to True by default.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;filter&amp;lt;/code&amp;gt;&lt;br /&gt;
:Set additional filter on the video before sending to GPU.&lt;br /&gt;
:Assign to one of &amp;lt;code&amp;gt;VideoTexture&amp;lt;/code&amp;gt; filter object. By default the image is send unchanged to the GPU. If an alpha channel is present in the video, it is automatically loaded and sent to the GPU as well.&lt;br /&gt;
&lt;br /&gt;
We will simply set the &amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; attribute to True because the &amp;lt;code&amp;gt;gluScaleImage()&amp;lt;/code&amp;gt; is really too slow for real time video. In case the video dimensions are already a power of 2, it has no effect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.video.source.scale = True&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Play the video===&lt;br /&gt;
We are now ready to play the video:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.video.source.play()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video playback is not a background process: it happens only when we refresh the texture. So we must have another script that runs on every frame and calls the &amp;lt;code&amp;gt;refresh()&amp;lt;/code&amp;gt; method of the &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; object:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 if hasattr(GameLogic, 'video'):&lt;br /&gt;
     GameLogic.video.refresh(True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the video source is stopped, &amp;lt;code&amp;gt;refresh()&amp;lt;/code&amp;gt; has no effect. The argument of &amp;lt;code&amp;gt;refresh()&amp;lt;/code&amp;gt; is a flag that indicates if the texture should be recalculated on next refresh. For video playback, you definitively want to set it to True.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
===Checking video status===&lt;br /&gt;
&lt;br /&gt;
Video source classes (such as VideoFFMpeg) have an attribute &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;. If video is playing, its value is 2, if it's stopped, it's 3. So in our example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 if GameLogic.video.source.status == 3:&lt;br /&gt;
     #video has stopped&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Advanced work flow===&lt;br /&gt;
True argument in &amp;lt;code&amp;gt;Texture.refresh()&amp;lt;/code&amp;gt; method simply invalidates the image buffer after sending it to the GPU so that on next frame, a new image will be loaded from the source. It has the side effect of making the image unavailable to Python. You can also do it manually by calling the &amp;lt;code&amp;gt;refresh()&amp;lt;/code&amp;gt; method of the source directly.&lt;br /&gt;
&lt;br /&gt;
Here are some possible advanced work flow:&lt;br /&gt;
*Use the image buffer in python (doesn't effect the Texture):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     GameLogic.video.refresh(False)&lt;br /&gt;
     image = GameLogic.video.source.image&lt;br /&gt;
     # image is a binary string buffer of row major RGBA pixels&lt;br /&gt;
     # ... use image&lt;br /&gt;
     # invalidates it for next frame&lt;br /&gt;
     GameLogic.video.source.refresh()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load image from source for python processing wihtout download to GPU:&lt;br /&gt;
     # note that we don't even call refresh on the Texture&lt;br /&gt;
     # we could also just create a source object without a Texture object&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
     image = GameLogic.video.source.image&lt;br /&gt;
     # ... use image&lt;br /&gt;
     GameLogic.video.source.refresh()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*If you have more than 1 material on the mesh and you want to modify a texture of one particular material, get its ID&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
matID=VideoTexture.materialID(gameobj,&amp;quot;MAmat.001&amp;quot;) &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
GLSL material can have more than 1 texture channel, identify the texture by the texture slot where it is defined, here 2&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
tex=VideoTexture.Texture(gameobj, matID, 2)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
==Advanced demos==&lt;br /&gt;
Here is a [http://www.graphicall.org/ftp/ben2610/VideoTextureDemo2video.blend demo] that demonstrates the use of two videos alternatively on the same texture. Note that it requires an additional video file which is the elephant dream teaser. You can replace with another other file that you want to run the demo.&lt;br /&gt;
&lt;br /&gt;
Here is a [http://www.graphicall.org/ftp/ben2610/VideoTextureDemo2videoMix.blend demo] that demonstrates the use of the &amp;lt;code&amp;gt;ImageMix&amp;lt;/code&amp;gt; source. &amp;lt;code&amp;gt;ImageMix&amp;lt;/code&amp;gt; is a source that needs sources, which can be any other &amp;lt;code&amp;gt;Texture&amp;lt;/code&amp;gt; source, like &amp;lt;code&amp;gt;VideoFFmpeg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ImageFFmpeg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ImageRender&amp;lt;/code&amp;gt;. You set them with &amp;lt;code&amp;gt;setSource()&amp;lt;/code&amp;gt; and their relative weight with &amp;lt;code&amp;gt;setWeight()&amp;lt;/code&amp;gt;. Pay attention that the weight is a short number between 0 and 255, and that the sum of all weights should be 255. &amp;lt;code&amp;gt;ImageMix&amp;lt;/code&amp;gt; makes a mix of all the sources according to their weights. The sources must all have the same image size (after reduction to the nearest power of 2 dimension). If they don’t, you get a Python error on the console.&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
{{Page/Footer|Doc:2.5/Manual/Game Engine/Python API/Bullet physics|Doc:2.5/Manual/Game Engine/Features}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game engine]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:API's]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Ndelgrosso</name></author>
		
	</entry>
</feed>