[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27813] trunk/blender/source/gameengine/ PyDoc/VideoTexture.py: VideoTexture: more PyDoc.

Benoit Bolsee benoit.bolsee at online.be
Sun Mar 28 22:15:46 CEST 2010


Revision: 27813
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27813
Author:   ben2610
Date:     2010-03-28 22:15:45 +0200 (Sun, 28 Mar 2010)

Log Message:
-----------
VideoTexture: more PyDoc.

Modified Paths:
--------------
    trunk/blender/source/gameengine/PyDoc/VideoTexture.py

Modified: trunk/blender/source/gameengine/PyDoc/VideoTexture.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/VideoTexture.py	2010-03-28 20:12:28 UTC (rev 27812)
+++ trunk/blender/source/gameengine/PyDoc/VideoTexture.py	2010-03-28 20:15:45 UTC (rev 27813)
@@ -23,15 +23,15 @@
 the L{materialID} function, 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. 
+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. 
 
 Example:
 	import VideoTexture
 	import GameLogic
 
 	contr = GameLogic.getCurrentController()
-	obj = contr.getOwner()
+	obj = contr.owner
 	
 	# the creation of the texture must be done once: save the 
 	# texture object in an attribute of GameLogic module makes it persistent
@@ -62,13 +62,20 @@
 	
 	@rtype: string
 	"""
-def imageToArray(image):
+def imageToArray(image,mode):
 	"""
-	Returns a string corresponding to the current image stored in a texture source object
+	Returns a BGL.buffer corresponding to the current image stored in a texture source object
 
 	@param image: Image source object.
 	@type image: object of type L{VideoFFmpeg}, L{ImageFFmpeg}, L{ImageBuff}, L{ImageMix}, L{ImageRender}, L{ImageMirror} or L{ImageViewport}
-	@rtype: string representing the image, 4 bytes per pixel in the RGBA order, line per line, starting from the bottom of the image.
+	@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. 
+	                      "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.
 	"""
 def materialID(object,name):
 	"""
@@ -80,7 +87,7 @@
 	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/catch to catch the exception.
+	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')
 	
@@ -90,17 +97,22 @@
 	@type name: string
 	@rtype: integer
 	"""
-def setLogFile():
+def setLogFile(filename):
 	"""
-	Does something
-	
-	@rtype: 
+	Sets the name of a text file in which runtime error messages will be written, in addition to the printing
+	of the messages on the Python console. Only the runtime errors specific to the VideoTexture module
+	are written in that file, ordinary runtime time errors are not written. 
+
+	@param filename: name of error log file
+	@type filename: string
+	@rtype: integer
 	"""
 def FilterBGR24():
 	"""
-	Does something
+	Returns a new input filter object to be used with L{ImageBuff} object when the image passed 
+	to the ImageBuff.load() function has the 3-bytes pixel format BGR. 
 	
-	@rtype: 
+	@rtype: object of type FilterBGR24
 	"""
 def FilterBlueScreen():
 	"""
@@ -134,15 +146,17 @@
 	"""
 def FilterRGB24():
 	"""
-	Does something
+	Returns a new input filter object to be used with L{ImageBuff} object when the image passed 
+	to the ImageBuff.load() function has the 3-bytes pixel format RBG.
 	
-	@rtype: 
+	@rtype: object of type FilterRGB24
 	"""
 def FilterRGBA32():
 	"""
-	Does something
+	Returns a new input filter object to be used with L{ImageBuff} object when the image passed 
+	to the ImageBuff.load() function has the 4-bytes pixel format RGBA.
 	
-	@rtype: 
+	@rtype: object of type FilterRGBA32
 	"""
 def ImageBuff():
 	"""





More information about the Bf-blender-cvs mailing list