[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38390] branches/soc-2011-tomato: Merging r38364 through r38389 from trunk into soc-2011-tomato

Sergey Sharybin g.ulairi at gmail.com
Thu Jul 14 14:04:23 CEST 2011


Revision: 38390
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38390
Author:   nazgul
Date:     2011-07-14 12:04:21 +0000 (Thu, 14 Jul 2011)
Log Message:
-----------
Merging r38364 through r38389 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/CMakeLists.txt
    branches/soc-2011-tomato/doc/python_api/rst/bgl.rst
    branches/soc-2011-tomato/intern/CMakeLists.txt
    branches/soc-2011-tomato/intern/smoke/CMakeLists.txt
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_texture.py
    branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/blenkernel/SConscript
    branches/soc-2011-tomato/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/smoke.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/sound.c
    branches/soc-2011-tomato/source/blender/editors/datafiles/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/datafiles/preview.blend.c
    branches/soc-2011-tomato/source/blender/editors/render/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/render/render_preview.c
    branches/soc-2011-tomato/source/blender/editors/space_buttons/buttons_context.c
    branches/soc-2011-tomato/source/blender/gpu/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/gpu/SConscript
    branches/soc-2011-tomato/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_constraint.c
    branches/soc-2011-tomato/source/blender/python/generic/bgl.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Color.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Euler.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Matrix.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Quaternion.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Vector.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_geometry.c
    branches/soc-2011-tomato/source/blender/render/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/render/SConscript
    branches/soc-2011-tomato/source/blender/render/intern/source/voxeldata.c
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_files.c

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


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36831-38363
   + /trunk/blender:36831-38389

Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/CMakeLists.txt	2011-07-14 12:04:21 UTC (rev 38390)
@@ -141,6 +141,7 @@
 
 # Modifiers
 option(WITH_MOD_FLUID        	"Enable Elbeem Modifier (Fluid Simulation)" ON)
+option(WITH_MOD_SMOKE        	"Enable Smoke Modifier (Smoke Simulation)" ON)
 option(WITH_MOD_DECIMATE       	"Enable Decimate Modifier" ON)
 option(WITH_MOD_BOOLEAN        	"Enable Boolean Modifier" ON)
 option(WITH_MOD_CLOTH_ELTOPO   	"Enable Experemental cloth solver" OFF)

Modified: branches/soc-2011-tomato/doc/python_api/rst/bgl.rst
===================================================================
--- branches/soc-2011-tomato/doc/python_api/rst/bgl.rst	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/doc/python_api/rst/bgl.rst	2011-07-14 12:04:21 UTC (rev 38390)
@@ -1379,16 +1379,17 @@
 
       .. code-block:: python
 
-        import Blender
-        from Blender.BGL import *
+        import bgl
         xval, yval= 100, 40
         # Get the scale of the view matrix
-        viewMatrix = Buffer(GL_FLOAT, 16)
-        glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix)
-        f = 1/viewMatrix[0]
-        glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval)
+        view_matrix = bgl.Buffer(bgl.GL_FLOAT, 16)
+        bgl.glGetFloatv(bgl.GL_MODELVIEW_MATRIX, view_matrix)
+        f = 1.0 / view_matrix[0]
 
+		# Instead of the usual glRasterPos2i(xval, yval)
+        bgl.glRasterPos2f(xval * f, yval * f)
 
+
 .. function:: glReadBuffer(mode):
 
    Select a color buffer source for pixels.
@@ -1839,32 +1840,32 @@
    The Buffer object is simply a block of memory that is delineated and initialized by the
    user. Many OpenGL functions return data to a C-style pointer, however, because this
    is not possible in python the Buffer object can be used to this end. Wherever pointer
-   notation is used in the OpenGL functions the Buffer object can be used in it's BGL
+   notation is used in the OpenGL functions the Buffer object can be used in it's bgl
    wrapper. In some instances the Buffer object will need to be initialized with the template
    parameter, while in other instances the user will want to create just a blank buffer
    which will be zeroed by default.
 
-   Example with Buffer::
-      import Blender
-      from Blender import BGL
-      myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32])
-      BGL.glGetPolygonStipple(myByteBuffer)
-      print myByteBuffer.dimensions
-      print myByteBuffer.list
+   .. code-block:: python
+
+      import bgl
+      myByteBuffer = bgl.Buffer(bgl.GL_BYTE, [32, 32])
+      bgl.glGetPolygonStipple(myByteBuffer)
+      print(myByteBuffer.dimensions)
+      print(myByteBuffer.to_list())
       sliceBuffer = myByteBuffer[0:16]
-      print sliceBuffer
+      print(sliceBuffer)
 
-   .. attribute:: list
+   .. attribute:: dimensions
 
-      The contents of the Buffer.
+      The number of dimensions of the Buffer.
 
-   .. attribute:: dimensions
+   .. method:: to_list()
 
-      The size of the Buffer.
+      The contents of the Buffer as a python list.
 
    .. method:: __init__(type, dimensions, template = None):
 
-      This will create a new Buffer object for use with other BGL OpenGL commands.
+      This will create a new Buffer object for use with other bgl OpenGL commands.
       Only the type of argument to store in the buffer and the dimensions of the buffer
       are necessary. Buffers are zeroed by default unless a template is supplied, in
       which case the buffer is initialized to the template.

Modified: branches/soc-2011-tomato/intern/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/CMakeLists.txt	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/intern/CMakeLists.txt	2011-07-14 12:04:21 UTC (rev 38390)
@@ -31,7 +31,6 @@
 add_subdirectory(memutil)
 add_subdirectory(iksolver)
 add_subdirectory(opennl)
-add_subdirectory(smoke)
 add_subdirectory(mikktspace)
 
 if(WITH_AUDASPACE)
@@ -42,6 +41,10 @@
 	add_subdirectory(elbeem)
 endif()
 
+if(WITH_MOD_SMOKE)
+	add_subdirectory(smoke)
+endif()
+
 if(WITH_MOD_DECIMATE)
 	add_subdirectory(container)
 	add_subdirectory(decimation)

Modified: branches/soc-2011-tomato/intern/smoke/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/smoke/CMakeLists.txt	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/intern/smoke/CMakeLists.txt	2011-07-14 12:04:21 UTC (rev 38390)
@@ -84,7 +84,7 @@
 )
 
 if(WITH_OPENMP)
-		add_definitions(-DPARALLEL=1)
+	add_definitions(-DPARALLEL=1)
 endif()
 
 if(WITH_FFTW3)

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_texture.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_texture.py	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_texture.py	2011-07-14 12:04:21 UTC (rev 38390)
@@ -88,15 +88,15 @@
     @classmethod
     def poll(cls, context):
         engine = context.scene.render.engine
-        if not hasattr(context, "texture_slot"):
+        if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
             return False
         return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, bpy.types.ParticleSettings))
             and (engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
         layout = self.layout
-        slot = context.texture_slot
-        node = context.texture_node
+        slot = getattr(context, "texture_slot", None)
+        node = getattr(context, "texture_node", None)
         space = context.space_data
         tex = context.texture
         idblock = context_tex_datablock(context)
@@ -393,7 +393,7 @@
 
         idblock = context_tex_datablock(context)
         tex = context.texture
-        slot = context.texture_slot
+        slot = getattr(context, "texture_slot", None)
 
         split = layout.split()
 
@@ -408,7 +408,7 @@
         col = split.column()
 
         #Only for Material based textures, not for Lamp/World...
-        if isinstance(idblock, bpy.types.Material):
+        if slot and isinstance(idblock, bpy.types.Material):
             col.prop(tex, "use_normal_map")
             row = col.row()
             row.active = tex.use_normal_map

Modified: branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt	2011-07-14 12:04:21 UTC (rev 38390)
@@ -312,6 +312,10 @@
 	add_definitions(-DDISABLE_ELBEEM)
 endif()
 
+if(WITH_MOD_SMOKE)
+	add_definitions(-DWITH_SMOKE)
+endif()
+
 if(WITH_JACK)
 	add_definitions(-DWITH_JACK)
 endif()

Modified: branches/soc-2011-tomato/source/blender/blenkernel/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/SConscript	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/source/blender/blenkernel/SConscript	2011-07-14 12:04:21 UTC (rev 38390)
@@ -21,6 +21,8 @@
 
 defs = [ 'GLEW_STATIC' ]
 
+defs.append('WITH_SMOKE')  # TODO, make optional
+
 if env['WITH_BF_PYTHON']:
     incs += ' ../python'
     incs += ' ' + env['BF_PYTHON_INC']

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/pointcache.c	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/pointcache.c	2011-07-14 12:04:21 UTC (rev 38390)
@@ -516,6 +516,7 @@
 	return clmd->clothObject ? clmd->clothObject->numverts : 0;
 }
 
+#ifdef WITH_SMOKE
 /* Smoke functions */
 static int  ptcache_smoke_totpoint(void *smoke_v, int UNUSED(cfra))
 {
@@ -652,6 +653,11 @@
 		}
 	}
 }
+#else // WITH_SMOKE
+static int  ptcache_smoke_totpoint(void *UNUSED(smoke_v), int UNUSED(cfra)) { return 0; };
+static void ptcache_smoke_read(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) {}
+static int  ptcache_smoke_write(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) { return 0; }
+#endif // WITH_SMOKE
 
 /* Creating ID's */
 void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/smoke.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/smoke.c	2011-07-14 11:32:33 UTC (rev 38389)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/smoke.c	2011-07-14 12:04:21 UTC (rev 38390)
@@ -140,6 +140,19 @@
 
 #define TRI_UVOFFSET (1./4.)
 
+/* Stubs to use when smoke is disabled */
+#ifndef WITH_SMOKE
+struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype)) { return NULL; }
+struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(p0)) { return NULL; }
+void smoke_free(struct FLUID_3D *UNUSED(fluid)) {}
+void smoke_turbulence_free(struct WTURBULENCE *UNUSED(wt)) {}
+void smoke_initWaveletBlenderRNA(struct WTURBULENCE *UNUSED(wt), float *UNUSED(strength)) {}
+void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), float *UNUSED(beta), float *UNUSED(dt_factor), float *UNUSED(vorticity), int *UNUSED(border_colli)) {}
+long long smoke_get_mem_req(int UNUSED(xres), int UNUSED(yres), int UNUSED(zres), int UNUSED(amplify)) { return 0; }
+void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Object *UNUSED(ob), DerivedMesh *UNUSED(dm)) {}
+#endif // WITH_SMOKE
+
+
 static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
 {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list