diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-04-20 12:23:22 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-04-20 12:23:22 +0400 |
commit | dd2080f5c4809522393155776574e15a696f1a3f (patch) | |
tree | 926fff56837550621322749feab8f7efcb8823d1 /source/gameengine/PyDoc/VideoTexture.py | |
parent | b52eddd95a5dd68a98520be0de211e08d991e868 (diff) |
BGE EPY Docs: PhysicsConstraints and fixes in other modules
PhysicsConstraints module documented by Jean-François (Ninja Goliath) based on GameKit 2nd ed.
Thanks for the initiative and the great help!
General advice for anyone helping with EpyDocs:
* use :: instead of : to keep the indentation correct,
* use B{} for clarity when needed (e.g. createConstraints)
Adding F13 to F19 to complement Matt's recent commit
* There are other (not so important) functions in PhysicsConstraints module that are not exposed in the documentation right now.
The generated page is temporarily here, if someone want to review it:
http://blenderecia.orgfree.com/blender/tmp/PhysicsConstraints-module.html
Diffstat (limited to 'source/gameengine/PyDoc/VideoTexture.py')
-rw-r--r-- | source/gameengine/PyDoc/VideoTexture.py | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/source/gameengine/PyDoc/VideoTexture.py b/source/gameengine/PyDoc/VideoTexture.py index 73809a7a15c..186d621557f 100644 --- a/source/gameengine/PyDoc/VideoTexture.py +++ b/source/gameengine/PyDoc/VideoTexture.py @@ -1,32 +1,38 @@ # $Id$ """ -The VideoTexture module allows you to manipulate textures during the game. +The VideoTexture 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. +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. +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. + VideoTexture uses FFmpeg to load images and videos. All the formats and codecs -that FFmpeg supports are supported by VideoTexture, including but not limited to: +that FFmpeg supports are supported by VideoTexture, including but not limited to:: - * AVI - * Ogg - * Xvid - * Theora - * dv1394 camera - * video4linux capture card (this includes many webcams) - * videoForWindows capture card (this includes many webcams) - * JPG + * AVI + * Ogg + * Xvid + * Theora + * dv1394 camera + * video4linux capture card (this includes many webcams) + * videoForWindows capture card (this includes many webcams) + * JPG The principle is simple: first you identify a texture on an existing object using the L{materialID} function, then you create a new texture with dynamic content -and swap the two textures in the GPU. +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. When the texture object is deleted, -the new texture is deleted and the old texture restored. +except that you are now in control of the texture. -Example: +When the texture object is deleted, the new texture is deleted and the old texture restored. + +Example:: import VideoTexture import GameLogic @@ -71,15 +77,18 @@ def imageToArray(image,mode): @param mode: optional argument representing the pixel format. You can use the characters R, G, B for the 3 color channels, A for the alpha channel, 0 to force a fixed 0 color channel and 1 to force a fixed 255 color channel. - Example: "BGR" will return 3 bytes per pixel with the Blue, Green and Red channels in that order. + Example: "BGR" will return 3 bytes per pixel with the Blue, Green and Red channels in that order. \ "RGB1" will return 4 bytes per pixel with the Red, Green, Blue channels in that order and the alpha channel forced to 255. The default mode is "RGBA". @type mode: string - @rtype: BGL.buffer object representing the image as one dimensional array of bytes of size (pixel_size*width*height), line by line starting from the bottom of the image. The pixel size and format is determined by the mode parameter. + @rtype: BGL.buffer + @returns: object representing the image as one dimensional array of bytes of size (pixel_size*width*height), line by line starting from the bottom of the image. The pixel size and format is determined by the mode parameter. """ + def materialID(object,name): """ Returns a numeric value that can be used in L{Texture} to create a dynamic texture. + The value corresponds to an internal material number that uses the texture identified by name. name is a string representing a texture name with IM prefix if you want to identify the texture directly. This method works for basic tex face and for material, @@ -87,6 +96,7 @@ def materialID(object,name): position of the texture stack. name can also have MA prefix if you want to identify the texture by material. In that case the material must have a texture channel in first position. + If the object has no material that matches name, it generates a runtime error. Use try/except to catch the exception. Ex: VideoTexture.materialID(obj, 'IMvideo.png') @@ -198,7 +208,7 @@ def Texture(): """ Does something - @rtype: + @rtype: L{Texture} """ def VideoFFmpeg(): """ |