[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38186] branches/soc-2011-onion: merge with trunk -r38184

Antony Riakiotakis kalast at gmail.com
Thu Jul 7 12:41:42 CEST 2011


Revision: 38186
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38186
Author:   psy-fi
Date:     2011-07-07 10:41:41 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
merge with trunk -r38184

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38184

Modified Paths:
--------------
    branches/soc-2011-onion/build_files/scons/tools/Blender.py
    branches/soc-2011-onion/doc/python_api/rst/bge.logic.rst
    branches/soc-2011-onion/intern/ghost/intern/GHOST_SystemCocoa.mm
    branches/soc-2011-onion/intern/ghost/intern/GHOST_SystemX11.cpp
    branches/soc-2011-onion/intern/ghost/test/gears/GHOST_C-Test.c
    branches/soc-2011-onion/intern/ghost/test/gears/GHOST_Test.cpp
    branches/soc-2011-onion/intern/smoke/intern/WAVELET_NOISE.h
    branches/soc-2011-onion/release/scripts/modules/bpy_extras/mesh_utils.py
    branches/soc-2011-onion/release/scripts/startup/bl_ui/properties_data_mesh.py
    branches/soc-2011-onion/release/scripts/startup/bl_ui/properties_material.py
    branches/soc-2011-onion/release/scripts/startup/bl_ui/properties_render.py
    branches/soc-2011-onion/source/blender/avi/AVI_avi.h
    branches/soc-2011-onion/source/blender/avi/CMakeLists.txt
    branches/soc-2011-onion/source/blender/avi/SConscript
    branches/soc-2011-onion/source/blender/avi/intern/avi.c
    branches/soc-2011-onion/source/blender/avi/intern/options.c
    branches/soc-2011-onion/source/blender/blenkernel/BKE_node.h
    branches/soc-2011-onion/source/blender/blenkernel/intern/BME_tools.c
    branches/soc-2011-onion/source/blender/blenkernel/intern/anim.c
    branches/soc-2011-onion/source/blender/blenkernel/intern/material.c
    branches/soc-2011-onion/source/blender/blenkernel/intern/node.c
    branches/soc-2011-onion/source/blender/blenkernel/intern/particle_system.c
    branches/soc-2011-onion/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2011-onion/source/blender/blenlib/BLI_math_base.h
    branches/soc-2011-onion/source/blender/blenlib/BLI_winstuff.h
    branches/soc-2011-onion/source/blender/blenlib/intern/math_geom.c
    branches/soc-2011-onion/source/blender/blenlib/intern/path_util.c
    branches/soc-2011-onion/source/blender/blenlib/intern/storage.c
    branches/soc-2011-onion/source/blender/blenlib/intern/uvproject.c
    branches/soc-2011-onion/source/blender/collada/ArmatureExporter.cpp
    branches/soc-2011-onion/source/blender/collada/ArmatureExporter.h
    branches/soc-2011-onion/source/blender/collada/CameraExporter.cpp
    branches/soc-2011-onion/source/blender/collada/CameraExporter.h
    branches/soc-2011-onion/source/blender/collada/DocumentExporter.cpp
    branches/soc-2011-onion/source/blender/collada/DocumentExporter.h
    branches/soc-2011-onion/source/blender/collada/EffectExporter.cpp
    branches/soc-2011-onion/source/blender/collada/EffectExporter.h
    branches/soc-2011-onion/source/blender/collada/GeometryExporter.cpp
    branches/soc-2011-onion/source/blender/collada/GeometryExporter.h
    branches/soc-2011-onion/source/blender/collada/ImageExporter.cpp
    branches/soc-2011-onion/source/blender/collada/ImageExporter.h
    branches/soc-2011-onion/source/blender/collada/LightExporter.cpp
    branches/soc-2011-onion/source/blender/collada/LightExporter.h
    branches/soc-2011-onion/source/blender/collada/MaterialExporter.cpp
    branches/soc-2011-onion/source/blender/collada/MaterialExporter.h
    branches/soc-2011-onion/source/blender/collada/MeshImporter.cpp
    branches/soc-2011-onion/source/blender/collada/MeshImporter.h
    branches/soc-2011-onion/source/blender/collada/collada.cpp
    branches/soc-2011-onion/source/blender/collada/collada.h
    branches/soc-2011-onion/source/blender/collada/collada_internal.cpp
    branches/soc-2011-onion/source/blender/editors/animation/anim_markers.c
    branches/soc-2011-onion/source/blender/editors/curve/editcurve.c
    branches/soc-2011-onion/source/blender/editors/include/ED_curve.h
    branches/soc-2011-onion/source/blender/editors/interface/interface.c
    branches/soc-2011-onion/source/blender/editors/interface/interface_handlers.c
    branches/soc-2011-onion/source/blender/editors/mesh/editmesh_loop.c
    branches/soc-2011-onion/source/blender/editors/object/object_modifier.c
    branches/soc-2011-onion/source/blender/editors/object/object_relations.c
    branches/soc-2011-onion/source/blender/editors/physics/particle_edit.c
    branches/soc-2011-onion/source/blender/editors/render/render_opengl.c
    branches/soc-2011-onion/source/blender/editors/space_node/drawnode.c
    branches/soc-2011-onion/source/blender/editors/space_node/node_buttons.c
    branches/soc-2011-onion/source/blender/editors/space_outliner/outliner.c
    branches/soc-2011-onion/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/soc-2011-onion/source/blender/editors/space_sequencer/sequencer_edit.c
    branches/soc-2011-onion/source/blender/editors/space_view3d/drawarmature.c
    branches/soc-2011-onion/source/blender/editors/transform/transform.c
    branches/soc-2011-onion/source/blender/editors/transform/transform_conversions.c
    branches/soc-2011-onion/source/blender/editors/transform/transform_manipulator.c
    branches/soc-2011-onion/source/blender/imbuf/intern/util.c
    branches/soc-2011-onion/source/blender/makesdna/DNA_material_types.h
    branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_armature.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_curve.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_material.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_object.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_render.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene_api.c
    branches/soc-2011-onion/source/blender/nodes/intern/CMP_nodes/CMP_image.c
    branches/soc-2011-onion/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
    branches/soc-2011-onion/source/blender/python/generic/mathutils_geometry.c
    branches/soc-2011-onion/source/blender/python/intern/bpy_interface.c
    branches/soc-2011-onion/source/blender/render/intern/source/pipeline.c
    branches/soc-2011-onion/source/blender/render/intern/source/rendercore.c
    branches/soc-2011-onion/source/blender/render/intern/source/shadeinput.c
    branches/soc-2011-onion/source/blender/render/intern/source/zbuf.c
    branches/soc-2011-onion/source/blender/windowmanager/intern/wm_files.c
    branches/soc-2011-onion/source/blender/windowmanager/intern/wm_operators.c
    branches/soc-2011-onion/source/blenderplayer/CMakeLists.txt
    branches/soc-2011-onion/source/blenderplayer/bad_level_call_stubs/stubs.c
    branches/soc-2011-onion/source/gameengine/Ketsji/KX_PythonInit.cpp

Added Paths:
-----------
    branches/soc-2011-onion/doc/python_api/examples/bge.texture.1.py
    branches/soc-2011-onion/doc/python_api/examples/bge.texture.py
    branches/soc-2011-onion/doc/python_api/examples/blf.py
    branches/soc-2011-onion/doc/python_api/rst/bge.texture.rst
    branches/soc-2011-onion/intern/ghost/test/CMakeLists.txt

Property Changed:
----------------
    branches/soc-2011-onion/


Property changes on: branches/soc-2011-onion
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/trunk/blender:36833-38038
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/trunk/blender:36833-38184

Modified: branches/soc-2011-onion/build_files/scons/tools/Blender.py
===================================================================
--- branches/soc-2011-onion/build_files/scons/tools/Blender.py	2011-07-07 10:37:46 UTC (rev 38185)
+++ branches/soc-2011-onion/build_files/scons/tools/Blender.py	2011-07-07 10:41:41 UTC (rev 38186)
@@ -565,13 +565,16 @@
     cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
     commands.getoutput(cmd)
     cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
-    commands.getoutput(cmd) 
-    cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
     commands.getoutput(cmd)
-    cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
-    commands.getoutput(cmd)
-    cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
-    commands.getoutput(cmd)
+
+    if binary == 'blender':#not copy everything for blenderplayer
+        cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+        commands.getoutput(cmd)
+        cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+        commands.getoutput(cmd)
+        cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+        commands.getoutput(cmd)
+
     cmd = 'chmod +x  %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
     commands.getoutput(cmd)
     cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary)

Copied: branches/soc-2011-onion/doc/python_api/examples/bge.texture.1.py (from rev 38184, trunk/blender/doc/python_api/examples/bge.texture.1.py)
===================================================================
--- branches/soc-2011-onion/doc/python_api/examples/bge.texture.1.py	                        (rev 0)
+++ branches/soc-2011-onion/doc/python_api/examples/bge.texture.1.py	2011-07-07 10:41:41 UTC (rev 38186)
@@ -0,0 +1,38 @@
+"""
+Texture replacement
+++++++++++++++++++++++
+Example of how to replace a texture in game with an external image.
+createTexture() and removeTexture() are to be called from a module Python
+Controller.
+"""
+import bge
+from bge import logic
+from bge import texture	
+
+def createTexture(cont):
+    """Create a new Dynamic Texture"""
+    object = cont.owner
+	
+    # get the reference pointer (ID) of the internal texture
+    ID = VT.materialID(obj, 'IMoriginal.png')
+	
+    # create a texture object 
+    object_texture = texture.Texture(object, ID)
+	
+    # create a new source with an external image
+    url = logic.expandPath("//newtexture.jpg")
+    new_source = texture.ImageFFmpeg(url)
+	
+    # the texture has to be stored in a permanent Python object
+    logic.texture = object_texture
+	
+    # update/replace the texture
+    logic.texture.source = new_source
+    logic.texture.refresh(False)
+
+def removeTexture(cont):
+    """Delete the Dynamic Texture, reversing back the final to its original state."""
+    try:
+        del logic.texture
+    except:
+        pass

Copied: branches/soc-2011-onion/doc/python_api/examples/bge.texture.py (from rev 38184, trunk/blender/doc/python_api/examples/bge.texture.py)
===================================================================
--- branches/soc-2011-onion/doc/python_api/examples/bge.texture.py	                        (rev 0)
+++ branches/soc-2011-onion/doc/python_api/examples/bge.texture.py	2011-07-07 10:41:41 UTC (rev 38186)
@@ -0,0 +1,32 @@
+"""
+Basic Video Playback
+++++++++++++++++++++++
+Example of how to replace a texture in game with a video. It needs to run everyframe
+"""
+import bge
+from bge import texture
+from bge import logic
+
+cont = logic.getCurrentController()
+obj = cont.owner
+	
+# the creation of the texture must be done once: save the 
+# texture object in an attribute of bge.logic module makes it persistent
+if not hasattr(logic, 'video'):
+	
+    # identify a static texture by name
+    matID = texture.materialID(obj, 'IMvideo.png')
+		
+    # create a dynamic texture that will replace the static texture
+    logic.video = texture.Texture(obj, matID)
+
+    # define a source of image for the texture, here a movie
+    movie = logic.expandPath('//trailer_400p.ogg')
+    logic.video.source = texture.VideoFFmpeg(movie)
+    logic.video.source.scale = True
+		
+    # quick off the movie, but it wont play in the background
+    logic.video.source.play()
+
+# you need to call this function every frame to ensure update of the texture.
+logic.video.refresh(True)
\ No newline at end of file

Copied: branches/soc-2011-onion/doc/python_api/examples/blf.py (from rev 38184, trunk/blender/doc/python_api/examples/blf.py)
===================================================================
--- branches/soc-2011-onion/doc/python_api/examples/blf.py	                        (rev 0)
+++ branches/soc-2011-onion/doc/python_api/examples/blf.py	2011-07-07 10:41:41 UTC (rev 38186)
@@ -0,0 +1,42 @@
+"""
+Hello World Text Example
+++++++++++++++++++++++++
+Blender Game Engine example of using the blf module. For this module to work we
+need to use the OpenGL wrapper :class:`~bgl` as well.
+"""
+# import game engine modules
+import bge
+from bge import render
+from bge import logic
+# import stand alone modules
+import bgl
+import blf
+
+def init():
+    """init function - runs once"""
+    # create a new font object, use external ttf file
+    font_path = logic.expandPath('//Zeyada.ttf')
+	# store the font indice - to use later
+    logic.font_id = blf.load(font_path)
+
+    # set the font drawing routine to run every frame   
+    scene = logic.getCurrentScene()
+    scene.post_draw=[write]
+
+def write():
+    """write on screen"""
+    width = render.getWindowWidth()
+    height = render.getWindowHeight()
+    
+    # OpenGL setup
+    bgl.glMatrixMode(bgl.GL_PROJECTION)
+    bgl.glLoadIdentity()
+    bgl.gluOrtho2D(0, width, 0, height)
+    bgl.glMatrixMode(bgl.GL_MODELVIEW)
+    bgl.glLoadIdentity()
+    
+    # BLF drawing routine
+    font_id = logic.font_id
+    blf.position(font_id, (width*0.2), (height*0.3), 0)
+    blf.size(font_id, 50, 72)
+    blf.draw(font_id, "Hello World")

Modified: branches/soc-2011-onion/doc/python_api/rst/bge.logic.rst
===================================================================
--- branches/soc-2011-onion/doc/python_api/rst/bge.logic.rst	2011-07-07 10:37:46 UTC (rev 38185)
+++ branches/soc-2011-onion/doc/python_api/rst/bge.logic.rst	2011-07-07 10:41:41 UTC (rev 38186)
@@ -17,7 +17,7 @@
    # To get the game object this controller is on:
    obj = cont.owner
 
-:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`bge.types.~KX_LightObject` methods are available depending on the type of object
+:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`~bge.types.KX_LightObject` methods are available depending on the type of object
 
 .. code-block:: python
 

Copied: branches/soc-2011-onion/doc/python_api/rst/bge.texture.rst (from rev 38184, trunk/blender/doc/python_api/rst/bge.texture.rst)
===================================================================
--- branches/soc-2011-onion/doc/python_api/rst/bge.texture.rst	                        (rev 0)
+++ branches/soc-2011-onion/doc/python_api/rst/bge.texture.rst	2011-07-07 10:41:41 UTC (rev 38186)
@@ -0,0 +1,451 @@
+
+Game Engine bge.texture Module
+==============================
+
+.. note::
+	This documentation is still very weak, and needs some help! Right now they are mostly a collection
+	of the docstrings found in the bge.texture source code + some random places filled with text.
+
+*****
+Intro
+*****
+
+The bge.texture 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.
+
+bge.texture uses FFmpeg to load images and videos. All the formats and codecs that FFmpeg supports are supported by this module, 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 
+
+The principle is simple: first you identify a texture on an existing object using 
+the :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.
+
+When the texture object is deleted, the new texture is deleted and the old texture restored.
+
+.. module:: bge.texture
+
+.. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0])
+
+	FFmpeg video source
+   
+	.. attribute:: status
+		video status
+		
+	.. attribute::  range
+		replay range
+		
+	.. attribute:: repeat
+		repeat count, -1 for infinite repeat
+		
+		:type: int
+	
+	.. attribute:: framerate
+		frame rate
+		
+		:type: float
+		
+	.. attribute:: valid
+		Tells if an image is available
+		
+		:type: bool
+		
+	.. attribute:: image
+		image data
+		
+	.. attribute:: size
+		image size
+		
+	.. attribute:: scale
+		fast scale of image (near neighbour)
+		
+	.. attribute:: flip
+		flip image vertically
+		
+	.. attribute:: filter
+		pixel filter
+		
+	.. attribute:: preseek
+		number of frames of preseek
+		
+		:type: int
+		
+	.. attribute:: deinterlace
+		deinterlace image
+		
+		:type: bool
+   
+	.. method:: play()
+		Play (restart) video
+		
+	.. method:: pause()
+		pause video
+		
+	.. method:: stop()
+		stop video (play will replay it from start)
+		

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list