[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38227] branches/soc-2011-carrot: Merge with trunk r38225
Miika Hamalainen
miika.hamalainen at kolumbus.fi
Fri Jul 8 13:16:14 CEST 2011
Revision: 38227
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38227
Author: miikah
Date: 2011-07-08 11:16:13 +0000 (Fri, 08 Jul 2011)
Log Message:
-----------
Merge with trunk r38225
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38225
Modified Paths:
--------------
branches/soc-2011-carrot/build_files/scons/tools/Blender.py
branches/soc-2011-carrot/doc/python_api/examples/bpy.types.RenderEngine.py
branches/soc-2011-carrot/doc/python_api/rst/bge.events.rst
branches/soc-2011-carrot/doc/python_api/rst/bge.logic.rst
branches/soc-2011-carrot/doc/python_api/sphinx_doc_gen.py
branches/soc-2011-carrot/intern/ghost/intern/GHOST_SystemCocoa.mm
branches/soc-2011-carrot/intern/ghost/intern/GHOST_SystemX11.cpp
branches/soc-2011-carrot/intern/ghost/test/gears/GHOST_C-Test.c
branches/soc-2011-carrot/intern/ghost/test/gears/GHOST_Test.cpp
branches/soc-2011-carrot/intern/smoke/intern/WAVELET_NOISE.h
branches/soc-2011-carrot/release/scripts/modules/bpy_extras/mesh_utils.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/uvcalc_lightmap.py
branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_data_mesh.py
branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_material.py
branches/soc-2011-carrot/release/scripts/startup/bl_ui/properties_render.py
branches/soc-2011-carrot/source/blender/avi/AVI_avi.h
branches/soc-2011-carrot/source/blender/avi/CMakeLists.txt
branches/soc-2011-carrot/source/blender/avi/SConscript
branches/soc-2011-carrot/source/blender/avi/intern/avi.c
branches/soc-2011-carrot/source/blender/avi/intern/options.c
branches/soc-2011-carrot/source/blender/blenkernel/BKE_node.h
branches/soc-2011-carrot/source/blender/blenkernel/intern/BME_tools.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/anim.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/material.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/node.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/particle_system.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/pointcache.c
branches/soc-2011-carrot/source/blender/blenlib/BLI_math_base.h
branches/soc-2011-carrot/source/blender/blenlib/BLI_winstuff.h
branches/soc-2011-carrot/source/blender/blenlib/intern/math_geom.c
branches/soc-2011-carrot/source/blender/blenlib/intern/path_util.c
branches/soc-2011-carrot/source/blender/blenlib/intern/storage.c
branches/soc-2011-carrot/source/blender/blenlib/intern/uvproject.c
branches/soc-2011-carrot/source/blender/collada/ArmatureExporter.cpp
branches/soc-2011-carrot/source/blender/collada/ArmatureExporter.h
branches/soc-2011-carrot/source/blender/collada/CameraExporter.cpp
branches/soc-2011-carrot/source/blender/collada/CameraExporter.h
branches/soc-2011-carrot/source/blender/collada/DocumentExporter.cpp
branches/soc-2011-carrot/source/blender/collada/DocumentExporter.h
branches/soc-2011-carrot/source/blender/collada/EffectExporter.cpp
branches/soc-2011-carrot/source/blender/collada/EffectExporter.h
branches/soc-2011-carrot/source/blender/collada/GeometryExporter.cpp
branches/soc-2011-carrot/source/blender/collada/GeometryExporter.h
branches/soc-2011-carrot/source/blender/collada/ImageExporter.cpp
branches/soc-2011-carrot/source/blender/collada/ImageExporter.h
branches/soc-2011-carrot/source/blender/collada/LightExporter.cpp
branches/soc-2011-carrot/source/blender/collada/LightExporter.h
branches/soc-2011-carrot/source/blender/collada/MaterialExporter.cpp
branches/soc-2011-carrot/source/blender/collada/MaterialExporter.h
branches/soc-2011-carrot/source/blender/collada/MeshImporter.cpp
branches/soc-2011-carrot/source/blender/collada/MeshImporter.h
branches/soc-2011-carrot/source/blender/collada/collada.cpp
branches/soc-2011-carrot/source/blender/collada/collada.h
branches/soc-2011-carrot/source/blender/collada/collada_internal.cpp
branches/soc-2011-carrot/source/blender/editors/animation/anim_markers.c
branches/soc-2011-carrot/source/blender/editors/curve/editcurve.c
branches/soc-2011-carrot/source/blender/editors/include/ED_curve.h
branches/soc-2011-carrot/source/blender/editors/interface/interface.c
branches/soc-2011-carrot/source/blender/editors/interface/interface_handlers.c
branches/soc-2011-carrot/source/blender/editors/interface/interface_templates.c
branches/soc-2011-carrot/source/blender/editors/mesh/editmesh_loop.c
branches/soc-2011-carrot/source/blender/editors/object/object_modifier.c
branches/soc-2011-carrot/source/blender/editors/object/object_relations.c
branches/soc-2011-carrot/source/blender/editors/physics/particle_edit.c
branches/soc-2011-carrot/source/blender/editors/render/render_opengl.c
branches/soc-2011-carrot/source/blender/editors/space_node/drawnode.c
branches/soc-2011-carrot/source/blender/editors/space_node/node_buttons.c
branches/soc-2011-carrot/source/blender/editors/space_outliner/outliner.c
branches/soc-2011-carrot/source/blender/editors/space_sequencer/sequencer_draw.c
branches/soc-2011-carrot/source/blender/editors/space_sequencer/sequencer_edit.c
branches/soc-2011-carrot/source/blender/editors/space_view3d/drawarmature.c
branches/soc-2011-carrot/source/blender/editors/transform/transform.c
branches/soc-2011-carrot/source/blender/editors/transform/transform_conversions.c
branches/soc-2011-carrot/source/blender/editors/transform/transform_manipulator.c
branches/soc-2011-carrot/source/blender/imbuf/intern/util.c
branches/soc-2011-carrot/source/blender/makesdna/DNA_material_types.h
branches/soc-2011-carrot/source/blender/makesdna/DNA_scene_types.h
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_armature.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_curve.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_material.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_object.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_pose.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_render.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_scene.c
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_scene_api.c
branches/soc-2011-carrot/source/blender/nodes/intern/CMP_nodes/CMP_image.c
branches/soc-2011-carrot/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
branches/soc-2011-carrot/source/blender/python/generic/mathutils_geometry.c
branches/soc-2011-carrot/source/blender/python/intern/bpy_interface.c
branches/soc-2011-carrot/source/blender/render/intern/source/pipeline.c
branches/soc-2011-carrot/source/blender/render/intern/source/rendercore.c
branches/soc-2011-carrot/source/blender/render/intern/source/shadeinput.c
branches/soc-2011-carrot/source/blender/render/intern/source/zbuf.c
branches/soc-2011-carrot/source/blender/windowmanager/intern/wm_files.c
branches/soc-2011-carrot/source/blender/windowmanager/intern/wm_operators.c
branches/soc-2011-carrot/source/blenderplayer/CMakeLists.txt
branches/soc-2011-carrot/source/blenderplayer/bad_level_call_stubs/stubs.c
branches/soc-2011-carrot/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
branches/soc-2011-carrot/source/gameengine/GamePlayer/ghost/SConscript
branches/soc-2011-carrot/source/gameengine/Ketsji/KX_PythonInit.cpp
Added Paths:
-----------
branches/soc-2011-carrot/doc/python_api/examples/bge.constraints.py
branches/soc-2011-carrot/doc/python_api/examples/bge.texture.1.py
branches/soc-2011-carrot/doc/python_api/examples/bge.texture.py
branches/soc-2011-carrot/doc/python_api/examples/blf.py
branches/soc-2011-carrot/doc/python_api/rst/bge.constraints.rst
branches/soc-2011-carrot/doc/python_api/rst/bge.texture.rst
branches/soc-2011-carrot/intern/ghost/test/CMakeLists.txt
Property Changed:
----------------
branches/soc-2011-carrot/
Property changes on: branches/soc-2011-carrot
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender:36828-38042
+ /trunk/blender:36828-38225
Modified: branches/soc-2011-carrot/build_files/scons/tools/Blender.py
===================================================================
--- branches/soc-2011-carrot/build_files/scons/tools/Blender.py 2011-07-08 11:03:37 UTC (rev 38226)
+++ branches/soc-2011-carrot/build_files/scons/tools/Blender.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -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-carrot/doc/python_api/examples/bge.constraints.py (from rev 38225, trunk/blender/doc/python_api/examples/bge.constraints.py)
===================================================================
--- branches/soc-2011-carrot/doc/python_api/examples/bge.constraints.py (rev 0)
+++ branches/soc-2011-carrot/doc/python_api/examples/bge.constraints.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -0,0 +1,37 @@
+"""
+Basic Physics Constraint
+++++++++++++++++++++++
+Example of how to create a hinge Physics Constraint between two objects.
+"""
+from bge import logic
+from bge import constraints
+
+# get object list
+objects = logic.getCurrentScene().objects
+
+# get object named Object1 and Object 2
+object_1 = objects["Object1"]
+object_2 = objects["Object2"]
+
+# want to use Edge constraint type
+constraint_type = 2
+
+# get Object1 and Object2 physics IDs
+physics_id_1 = object_1.getPhysicsId()
+physics_id_2 = object_2.getPhysicsId()
+
+# Use bottom right edge of Object1 for hinge position
+edge_position_x = 1.0
+edge_position_y = 0.0
+edge_position_z = -1.0
+
+# use Object1 y axis for angle to point hinge
+edge_angle_x = 0.0
+edge_angle_y = 1.0
+edge_angle_z = 0.0
+
+# create an edge constraint
+constraints.createConstraint( physics_id_1, physics_id_2,
+ constraint_type,
+ edge_position_x, edge_position_y, edge_position_z,
+ edge_angle_x, edge_angle_y, edge_angle_z )
Copied: branches/soc-2011-carrot/doc/python_api/examples/bge.texture.1.py (from rev 38225, trunk/blender/doc/python_api/examples/bge.texture.1.py)
===================================================================
--- branches/soc-2011-carrot/doc/python_api/examples/bge.texture.1.py (rev 0)
+++ branches/soc-2011-carrot/doc/python_api/examples/bge.texture.1.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -0,0 +1,37 @@
+"""
+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.
+"""
+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 = texture.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-carrot/doc/python_api/examples/bge.texture.py (from rev 38225, trunk/blender/doc/python_api/examples/bge.texture.py)
===================================================================
--- branches/soc-2011-carrot/doc/python_api/examples/bge.texture.py (rev 0)
+++ branches/soc-2011-carrot/doc/python_api/examples/bge.texture.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -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-carrot/doc/python_api/examples/blf.py (from rev 38225, trunk/blender/doc/python_api/examples/blf.py)
===================================================================
--- branches/soc-2011-carrot/doc/python_api/examples/blf.py (rev 0)
+++ branches/soc-2011-carrot/doc/python_api/examples/blf.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -0,0 +1,41 @@
+"""
+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
+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-carrot/doc/python_api/examples/bpy.types.RenderEngine.py
===================================================================
--- branches/soc-2011-carrot/doc/python_api/examples/bpy.types.RenderEngine.py 2011-07-08 11:03:37 UTC (rev 38226)
+++ branches/soc-2011-carrot/doc/python_api/examples/bpy.types.RenderEngine.py 2011-07-08 11:16:13 UTC (rev 38227)
@@ -61,10 +61,10 @@
# Otherwise most of the UI will be empty when the engine is selected.
# In this example, we need to see the main render image button and
# the material preview panel.
-import properties_render
+from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('custom_renderer')
del properties_render
-import properties_material
+from bl_ui import properties_material
properties_material.MATERIAL_PT_preview.COMPAT_ENGINES.add('custom_renderer')
del properties_material
Copied: branches/soc-2011-carrot/doc/python_api/rst/bge.constraints.rst (from rev 38225, trunk/blender/doc/python_api/rst/bge.constraints.rst)
===================================================================
--- branches/soc-2011-carrot/doc/python_api/rst/bge.constraints.rst (rev 0)
+++ branches/soc-2011-carrot/doc/python_api/rst/bge.constraints.rst 2011-07-08 11:16:13 UTC (rev 38227)
@@ -0,0 +1,199 @@
+
+Game Engine bge.constraints Module
+==================================
+
+.. note::
+ This documentation is still very weak, and needs some help!
+
+.. function:: createConstraint([obj1, [obj2, [restLength, [restitution, [damping]]]]])
+
+ Creates a constraint.
+
+ :arg obj1: first object on Constraint
+ :type obj1: :class:'bge.types.KX_GameObject' #I think, there is no error when I use one
+
+ :arg obj2: second object on Constraint
+ :type obj2: :class:'bge.types.KX_GameObject' #too
+
+ :arg restLength: #to be filled
+ :type restLength: float
+
+ :arg restitution: #to be filled
+ :type restitution: float
+
+ :arg damping: #to be filled
+ :type damping: float
+
+.. attribute:: error
+
+ Simbolic constant string that indicates error.
+
+.. function:: exportBulletFile(filename)
+
+ export a .bullet file
+
+ :arg filename: File name
+ :type filename: string
+
+.. function:: getAppliedImpulse(constraintId)
+
+ :arg constraintId: The id of the constraint.
+ :type constraintId: int
+
+ :return: the most recent applied impulse.
+ :rtype: float
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list