Merge with trunk r41411
authorMiika Hamalainen <blender@miikah.org>
Mon, 31 Oct 2011 13:18:14 +0000 (13:18 +0000)
committerMiika Hamalainen <blender@miikah.org>
Mon, 31 Oct 2011 13:18:14 +0000 (13:18 +0000)
43 files changed:
CMakeLists.txt
SConstruct
build_files/cmake/macros.cmake
build_files/scons/config/darwin-config.py
build_files/scons/tools/btools.py
intern/SConscript
intern/ghost/intern/GHOST_SystemCocoa.mm
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/BLI_string.h
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/string.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editface.c
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_opengl.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/nodes/composite/nodes/node_composite_mixrgb.c
source/blender/python/BPY_extern.h
source/blender/python/generic/IDProp.c
source/blender/windowmanager/intern/wm_operators.c

index 7631b24f7cd9855be48c449ac90cd72b2a4f97fc..bcec149eda8ef8bf26a5c2610db92002b980f20a 100644 (file)
@@ -65,7 +65,7 @@ set(CMAKE_BUILD_TYPE_INIT "Release")
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG           DEBUG _DEBUG)
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE         NDEBUG)
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL      NDEBUG)
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO  DEBUG _DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO  NDEBUG)
 
 
 #-----------------------------------------------------------------------------
@@ -302,6 +302,9 @@ set(PLATFORM_CFLAGS)
 set(C_WARNINGS)
 set(CXX_WARNINGS)
 
+# for gcc -Wno-blah-blah
+set(CC_REMOVE_STRICT_FLAGS)
+
 # libraries to link the binary with passed to target_link_libraries()
 # known as LLIBS to scons
 set(PLATFORM_LINKLIBS "")
@@ -1250,6 +1253,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
        # # this causes too many warnings, disable
        # ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
 
+       # flags to undo strict flags
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
+
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
index 93787cdddceac235ce07b5de64ddd74b40f979da..16ce8ca4b32237dc169a6a9f9fc39a93845c3e45 100644 (file)
@@ -253,7 +253,9 @@ if 'blenderlite' in B.targets:
     target_env_defs['WITH_BF_BULLET'] = False
     target_env_defs['WITH_BF_BINRELOC'] = False
     target_env_defs['BF_BUILDINFO'] = False
-    target_env_defs['BF_NO_ELBEEM'] = True
+    target_env_defs['WITH_BF_FLUID'] = False
+    target_env_defs['WITH_BF_DECIMATE'] = False
+    target_env_defs['WITH_BF_BOOLEAN'] = False
     target_env_defs['WITH_BF_PYTHON'] = False
     target_env_defs['WITH_BF_3DMOUSE'] = False
     
@@ -323,9 +325,9 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
-# disable elbeem (fluidsim) compilation?
-if env['BF_NO_ELBEEM'] == 1:
-    env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
+# build without elbeem (fluidsim)?
+if env['WITH_BF_FLUID'] == 1:
+    env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
 
 
 if btools.ENDIAN == "big":
index 8e5d914948bb2343a61560c9276eb7a0ea0b9ce0..f767376d122f3ab77a366e285cfd295e5f0f9787 100644 (file)
@@ -434,7 +434,7 @@ macro(remove_strict_flags_file
                if(CMAKE_COMPILER_IS_GNUCC)
                        set_source_files_properties(${_SOURCE}
                                PROPERTIES
-                                       COMPILE_FLAGS "-Wno-deprecated-declarations"
+                                       COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
                        )
                endif()
 
index deb3d01febd852b68561ba392441db64ba26c249..38c8dca6cd21e569bcfc59533c49eb635713df79 100644 (file)
@@ -336,7 +336,7 @@ else:
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
-       CCFLAGS = ['-fuse-cxa-atexit'] + CFLAGS
+       CCFLAGS = ['-fuse-cxa-atexit'] + CCFLAGS
        PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
        LLIBS.append('crt3.o')
        
index 49efa598ed8686d2d627f8582a97966f825610af..a678bc68f5459fc65f455ef28ffbe3087eecdffc 100644 (file)
@@ -150,7 +150,9 @@ def validate_arguments(args, bc):
             'BF_GHOST_DEBUG',
             'WITH_BF_RAYOPTIMIZATION',
             'BF_RAYOPTIMIZATION_SSE_FLAGS',
-            'BF_NO_ELBEEM',
+            'WITH_BF_FLUID',
+            'WITH_BF_DECIMATE',
+            'WITH_BF_BOOLEAN',
             'WITH_BF_CXX_GUARDEDALLOC',
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
             'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
@@ -250,7 +252,9 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
         ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
 
-        (BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
+        (BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
+        (BoolVariable('WITH_BF_DECIMATE', 'Build with decimate modifier', True)),
+        (BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
         ('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
         (BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
         ('BF_OPENAL', 'base path for OpenAL', ''),
index 9a78f8ddace4a25e60700c84bc75e900cfa7f113..da245c78776a5f503bf9faab684be47485f64887 100644 (file)
@@ -22,7 +22,7 @@ SConscript(['audaspace/SConscript',
 # perhaps get rid of intern/csg?
 NEW_CSG='false'
 
-if not env['BF_NO_ELBEEM']:
+if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
 
 if NEW_CSG=='false':
index 7a6c0a0204320bbf15fd647feb555e06c85d5d9d..9dc3dd3f30b8fec7b98351705dc2443888a0417d 100644 (file)
@@ -578,7 +578,7 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
        if (strstr(rstring,"MacBookAir") ||
                (strstr(rstring,"MacBook") && (rstring[strlen(rstring)-3]>='5') && (rstring[strlen(rstring)-3]<='9')))
                m_hasMultiTouchTrackpad = true;
-       else m_hasMultiTouchTrackpad = true;
+       else m_hasMultiTouchTrackpad = true;  // experimental, changes only MagicMouse behaviour (zoom->pan) but enables MagicTrackpad for all Macs
        
        free( rstring );
        rstring = NULL;
@@ -1610,7 +1610,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
                                GHOST_TInt32 x, y;
                                window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
                                pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, x, y,
-                                                                                                 [event magnification]*250.0 + 0.1, 0));
+                                                                                                 [event magnification]*125.0 + 0.1, 0));
                        }
                        break;
 
index 0c9f1c33abbcc9a5dd053656391952941331a79a..aa661b765121b27c22a6062ee0311b2d1798946a 100644 (file)
@@ -1371,9 +1371,9 @@ class WM_OT_keyitem_add(Operator):
         km = context.keymap
 
         if km.is_modal:
-            km.keymap_items.new_modal("", 'A', 'PRESS')  #~ kmi
+            km.keymap_items.new_modal("", 'A', 'PRESS')
         else:
-            km.keymap_items.new("none", 'A', 'PRESS')  #~ kmi
+            km.keymap_items.new("none", 'A', 'PRESS')
 
         # clear filter and expand keymap so we can see the newly added item
         if context.space_data.filter_text != "":
index a78992d4a07835587894f8180971bbf35ee14ee8..4a5fcfd4c49071035d1a766bdd49fb2a77d5891f 100644 (file)
@@ -711,19 +711,14 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
         if context.sculpt_object:
             #XXX duplicated from properties_texture.py
 
-            col.separator()
-
             col.label(text="Brush Mapping:")
-            row = col.row(align=True)
-            row.prop(tex_slot, "map_mode", expand=True)
+            col.row().prop(tex_slot, "map_mode", expand=True)
 
             col.separator()
 
             col = layout.column()
             col.active = tex_slot.map_mode in {'FIXED'}
             col.label(text="Angle:")
-
-            col = layout.column()
             if not brush.use_anchor and brush.sculpt_tool not in {'GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE'} and tex_slot.map_mode in {'FIXED'}:
                 col.prop(brush, "texture_angle_source_random", text="")
             else:
@@ -740,47 +735,33 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
             #col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
 
             col = layout.column()
-            col.prop(tex_slot, "angle", text="")
             col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
+            col.prop(tex_slot, "angle", text="")
 
             #col = layout.column()
             #col.prop(brush, "use_random_rotation")
             #col.active = (not brush.use_rake) and (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE'}) and tex_slot.map_mode in {'FIXED'}
 
             split = layout.split()
+            split.prop(tex_slot, "offset")
+            split.prop(tex_slot, "scale")
 
-            col = split.column()
-            col.prop(tex_slot, "offset")
-
-            col = split.column()
-
-            col.prop(tex_slot, "scale")
-
-            col = layout.column()
-
-            row = col.row(align=True)
-            row.label(text="Sample Bias:")
-            row = col.row(align=True)
-            row.prop(brush, "texture_sample_bias", slider=True, text="")
-
-            row = col.row(align=True)
-            row.label(text="Overlay:")
-            row.active = tex_slot.map_mode in {'FIXED', 'TILED'}
-
-            row = col.row(align=True)
+            col = layout.column(align=True)
+            col.label(text="Sample Bias:")
+            col.prop(brush, "texture_sample_bias", slider=True, text="")
 
-            col = row.column()
+            col = layout.column(align=True)
+            col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
+            col.label(text="Overlay:")
 
+            row = col.row()
             if brush.use_texture_overlay:
-                col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+                row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
             else:
-                col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
-
-            col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
-
-            col = row.column()
-            col.prop(brush, "texture_overlay_alpha", text="Alpha")
-            col.active = tex_slot.map_mode in {'FIXED', 'TILED'} and brush.use_texture_overlay
+                row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+            sub = row.row()
+            sub.active = tex_slot.map_mode in {'FIXED', 'TILED'} and brush.use_texture_overlay
+            sub.prop(brush, "texture_overlay_alpha", text="Alpha")
 
 
 class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel):
@@ -985,18 +966,14 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel):
 
         sculpt = context.tool_settings.sculpt
 
-        split = layout.split()
-
-        col = split.column()
+        col = layout.column(align=True)
         col.label(text="Mirror:")
-        col.prop(sculpt, "use_symmetry_x", text="X")
-        col.prop(sculpt, "use_symmetry_y", text="Y")
-        col.prop(sculpt, "use_symmetry_z", text="Z")
-
-        split.prop(sculpt, "radial_symmetry", text="Radial")
-
-        layout.separator()
+        row = col.row()
+        row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
+        row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
+        row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
 
+        layout.column().prop(sculpt, "radial_symmetry", text="Radial")
         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
 
 
index 68dc8940fced2380dc07f7fd91a034110ff25500..290dce968288f717b0f2761384756d1d93aa5e40 100644 (file)
@@ -324,8 +324,8 @@ if(WITH_OPENMP)
        add_definitions(-DPARALLEL=1)
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_MOD_SMOKE)
index 512eec4021fe0dc01b09d1794c9d07efea48766f..ebb09352a55f8bd1f8224cc4b1d64955a88e5e21 100644 (file)
@@ -79,8 +79,8 @@ if env['OURPLATFORM'] == 'darwin':
     if env['WITH_BF_OPENMP']:
        defs.append('PARALLEL=1')
 
-if env['BF_NO_ELBEEM']:
-    defs.append('DISABLE_ELBEEM')
+if env['WITH_BF_FLUID']:
+    defs.append('WITH_MOD_FLUID')
 
 if env['WITH_BF_LZO']:
     incs += ' #/extern/lzo/minilzo'
index a96100237759d8f9fb20b8ce849d6d5958fd7ec5..83eda86051053d8459c186f1d75bf34cf192b155 100644 (file)
@@ -104,8 +104,8 @@ void defvert_sync (MDeformVert *dvert_r, const MDeformVert *dvert, int use_verif
                MDeformWeight *dw;
                for(i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
                        MDeformWeight *dw_r;
-                       if(use_verify)  dw_r= defvert_find_index(dvert_r, dw->def_nr);
-                       else                    dw_r= defvert_verify_index(dvert_r, dw->def_nr);
+                       if(use_verify)  dw_r= defvert_verify_index(dvert_r, dw->def_nr);
+                       else                    dw_r= defvert_find_index(dvert_r, dw->def_nr);
 
                        if(dw_r) {
                                dw_r->weight= dw->weight;
@@ -123,8 +123,8 @@ void defvert_sync_mapped (MDeformVert *dvert_r, const MDeformVert *dvert, const
                for (i=0, dw=dvert->dw; i < dvert->totweight; i++, dw++) {
                        if (dw->def_nr < flip_map_len) {
                                MDeformWeight *dw_r;
-                               if(use_verify)  dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
-                               else                    dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
+                               if(use_verify)  dw_r= defvert_verify_index(dvert_r, flip_map[dw->def_nr]);
+                               else                    dw_r= defvert_find_index(dvert_r, flip_map[dw->def_nr]);
 
                                if(dw_r) {
                                        dw_r->weight= dw->weight;
@@ -487,25 +487,25 @@ MDeformWeight *defvert_verify_index(MDeformVert *dv, const int defgroup)
        MDeformWeight *newdw;
 
        /* do this check always, this function is used to check for it */
-       if(!dv || defgroup<0)
+       if(!dv || defgroup < 0)
                return NULL;
 
-       newdw = defvert_find_index(dv, defgroup);
+       newdw= defvert_find_index(dv, defgroup);
        if(newdw)
                return newdw;
 
-       newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
-       if(dv->dw) {
+       newdw= MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
+       if (dv->dw) {
                memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
                MEM_freeN(dv->dw);
        }
-       dv->dw=newdw;
-
-       dv->dw[dv->totweight].weight=0.0f;
-       dv->dw[dv->totweight].def_nr=defgroup;
+       dv->dw= newdw;
+       newdw += dv->totweight;
+       newdw->weight= 0.0f;
+       newdw->def_nr= defgroup;
        /* Group index */
 
        dv->totweight++;
 
-       return dv->dw+(dv->totweight-1);
+       return newdw;
 }
index c4543df0d1605cb89166230f6b1683bdebcc8908..bb14a1ddeaf601a7a05661b5862a6b2db4fac8da 100644 (file)
 #include "RE_shader_ext.h"
 
 /* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 #include "DNA_object_fluidsim.h"
 #include "LBM_fluidsim.h"
 #include <zlib.h>
 #include <string.h>
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 //XXX #include "BIF_screen.h"
 
index 8bce75156955afa6fa3d7bf1d86c9e900dc50e8e..9aeacb9d7fa36f830841d1a5599fda2eb429319f 100644 (file)
@@ -981,7 +981,7 @@ int BKE_add_image_extension(char *string, int imtype)
                                  || (G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt))) {
                        return BLI_replace_extension(string, FILE_MAX, extension);
                } else {
-                       strcat(string, extension);
+                       return BLI_ensure_extension(string, FILE_MAX, extension);
                        return TRUE;
                }
                
index 50525c2b9cded622967c4c34ef1c19fdd867c9d2..6f66e189dcf7b527f5504ddfae0053160950c861 100644 (file)
@@ -1317,7 +1317,6 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
        UvVertMap *vmap;
        UvMapVert *buf;
        MFace *mf;
-       MTFace *tf;
        unsigned int a;
        int     i, totuv, nverts;
 
@@ -1325,8 +1324,7 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
 
        /* generate UvMapVert array */
        mf= mface;
-       tf= tface;
-       for(a=0; a<totface; a++, mf++, tf++)
+       for(a=0; a<totface; a++, mf++)
                if(!selected || (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL)))
                        totuv += (mf->v4)? 4: 3;
                
@@ -1346,8 +1344,7 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
        }
 
        mf= mface;
-       tf= tface;
-       for(a=0; a<totface; a++, mf++, tf++) {
+       for(a=0; a<totface; a++, mf++) {
                if(!selected || (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL))) {
                        nverts= (mf->v4)? 4: 3;
 
@@ -1363,7 +1360,6 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
        }
        
        /* sort individual uvs for each vert */
-       tf= tface;
        for(a=0; a<totvert; a++) {
                UvMapVert *newvlist= NULL, *vlist=vmap->vert[a];
                UvMapVert *iterv, *v, *lastv, *next;
@@ -1375,14 +1371,14 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
                        v->next= newvlist;
                        newvlist= v;
 
-                       uv= (tf+v->f)->uv[v->tfindex];
+                       uv= tface[v->f].uv[v->tfindex];
                        lastv= NULL;
                        iterv= vlist;
 
                        while(iterv) {
                                next= iterv->next;
 
-                               uv2= (tf+iterv->f)->uv[iterv->tfindex];
+                               uv2= tface[iterv->f].uv[iterv->tfindex];
                                sub_v2_v2v2(uvdiff, uv2, uv);
 
 
index f904f246b650b5a56b42118eaa285bdff405f357..ec058b23050fd3725eb25d690641442ce22ae1d9 100644 (file)
 #include "RE_shader_ext.h"
 
 /* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 #include "DNA_object_fluidsim.h"
 #include "LBM_fluidsim.h"
 #include <zlib.h>
 #include <string.h>
 
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 /************************************************/
 /*                     Reacting to system events                       */
@@ -3916,7 +3916,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
        }
 
        /* fluid sim particle import handling, actual loading of particles from file */
-       #ifndef DISABLE_ELBEEM
+       #ifdef WITH_MOD_FLUID
        {
                FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim);
                
@@ -4009,7 +4009,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
                        
                } // fluid sim particles done
        }
-       #endif // DISABLE_ELBEEM
+       #endif // WITH_MOD_FLUID
 }
 
 static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
index dd4bc868ab08d0865677f843c461a6ada4b8d384..68bb1a7280d5f5e35f89c685dddca5ba90ac6850 100644 (file)
@@ -102,6 +102,7 @@ int BLI_testextensie(const char *str, const char *ext);
 int BLI_testextensie_array(const char *str, const char **ext_array);
 int BLI_testextensie_glob(const char *str, const char *ext_fnmatch);
 int BLI_replace_extension(char *path, size_t maxlen, const char *ext);
+int BLI_ensure_extension(char *path, size_t maxlen, const char *ext);
 void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len);
 int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len);
 void BLI_newname(char * name, int add);
index 9a7fa521af1acdfb30a96492b8ac630472e7fa61..46389a9259e062b9a737d19136feca311d157745 100644 (file)
@@ -132,29 +132,6 @@ int BLI_strcasecmp(const char *s1, const char *s2);
 int BLI_strncasecmp(const char *s1, const char *s2, size_t len);
 int BLI_natstrcmp(const char *s1, const char *s2);
 size_t BLI_strnlen(const char *str, size_t maxlen);
-
-       /**
-        * Split str on the first occurence of delimiter, returns the first
-        * part as a mallocN'd string, and stores the second part into
-        * ctx (also mallocN'd).
-        * If str is NULL, split on ctx instead.
-        * This allows to iterate over this "generator" function:
-        *
-        * char *ctx = NULL;
-        * char *res = NULL;
-        * for(res = BLI_strtok_r("a;dummy;csv;line", ";", &ctx); res; res = BLI_strtok_r(NULL, ";", &ctx)) {
-        *     printf(res);
-        *     MEM_freeN(res);
-        * }
-        * 
-        * @param str The string to be split.
-        * @param delimiter The char used to split str apart.
-        * @param ctx The "context" string. It’s a pointer inside the org passed @str,
-        *            so it has no specific mem management.
-        * @retval Returns the mallocN'd first element from split str (or ctx).
-        */
-char *BLI_strtok_r(char *str, const char *delimiter, char **ctx);
-
 void BLI_timestr(double _time, char *str); /* time var is global */
 
 void BLI_ascii_strtolower(char *str, int len);
index e42e02fb24f8475ee8367bf69dad79fb2d537e9e..b7fe7ef5efdd83b6417b00b202037043d2ba1a31 100644 (file)
@@ -325,8 +325,7 @@ static int rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR], char path_file
        }
 
        if (visit_cb(userdata, path_dst, (const char *)path_src)) {
-               BLI_split_dirfile(path_dst, path_dir, path_file,
-                                 sizeof(path_dir), sizeof(path_file));
+               BLI_split_dirfile(path_dst, path_dir, path_file, FILE_MAXDIR, FILE_MAXFILE);
                return TRUE;
        }
        else {
index bc24415fd3f15f1301e8891f99705deed53f9fdf..bbb62db58f285bfbd8ec23064163cf1e39d03e05 100644 (file)
@@ -1397,22 +1397,51 @@ int BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
 
 int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
 {
+       size_t path_len= strlen(path);
+       size_t ext_len= strlen(ext);
        size_t a;
 
-       for(a=strlen(path); a>0; a--) {
-               if(path[a-1] == '.' || path[a-1] == '/' || path[a-1] == '\\') {
-                       a--;
+       for(a= path_len - 1; a >= 0; a--) {
+               if (ELEM3(path[a], '.', '/', '\\')) {
                        break;
                }
        }
-       
-       if(path[a] != '.')
-               a= strlen(path);
 
-       if(a + strlen(ext) >= maxlen)
+       if(a + ext_len >= maxlen)
+               return 0;
+
+       memcpy(path+a, ext, ext_len + 1);
+       return 1;
+}
+
+/* strip's trailing '.'s and adds the extension only when needed */
+int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
+{
+       size_t path_len= strlen(path);
+       size_t ext_len= strlen(ext);
+       size_t a;
+
+       /* first check the extension is alread there */
+       if (    (ext_len <= path_len) &&
+               (strcmp(path + (path_len - ext_len), ext) == 0))
+       {
+               return 1;
+       }
+
+       for(a= path_len - 1; a >= 0; a--) {
+               if (path[a] == '.') {
+                       path[a]= '\0';
+               }
+               else {
+                       break;
+               }
+       }
+       a++;
+
+       if(a + ext_len >= maxlen)
                return 0;
 
-       strcpy(path+a, ext);
+       memcpy(path+a, ext, ext_len + 1);
        return 1;
 }
 
@@ -1844,7 +1873,7 @@ void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
                /* add a trailing slash if needed */
                BLI_add_slash(fullname);
 #ifdef WIN32
-               if(userdir != fullname) {
+               if(userdir && userdir != fullname) {
                        BLI_strncpy(userdir, fullname, maxlen); /* also set user pref to show %TEMP%. /tmp/ is just plain confusing for Windows users. */
                }
 #endif
index 3ec84e0b5930d7da48f15053b36fe6a3432f0563..3a66425a5de1fb92781e23dd5f5d686446e4a1c2 100644 (file)
@@ -375,35 +375,6 @@ int BLI_natstrcmp(const char *s1, const char *s2)
        return 0;
 }
 
-/* As unfortunately strtok_r is not available everywhere... */
-char *BLI_strtok_r(char *str, const char *delimiter, char **ctx)
-{
-       char *cut = NULL, *ret = NULL;
-       char *split = str ? str : *ctx;
-
-       if(!split) {
-               return ret;
-       }
-
-       cut = strchr(split, *delimiter);
-       if(cut) {
-               size_t len_ret = cut - split;
-               size_t len_ctx = strlen(split) - len_ret - 1;
-               ret = BLI_strdupn(split, len_ret);
-               if(len_ctx > 0) {
-                       *ctx = split+len_ret+1;
-               }
-               else {
-                       *ctx = NULL;
-               }
-       }
-       else {
-               ret = BLI_strdup(split);
-               *ctx = NULL;
-       }
-       return ret;
-}
-
 void BLI_timestr(double _time, char *str)
 {
        /* format 00:00:00.00 (hr:min:sec) string has to be 12 long */
index dd1399dda0d6de5980a85452d6a5fa9c481d18e3..6d7bac9ed44392f7fc43f18c7482b65397586ba8 100644 (file)
@@ -2290,7 +2290,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
 
 static void write_libraries(WriteData *wd, Main *main)
 {
-       ListBase *lbarray[30];
+       ListBase *lbarray[MAX_LIBARRAY];
        ID *id;
        int a, tot, foundone;
 
index 0391c16a8f77aba88a0a9a65717eeff2ba76a1cd..89b9f74d8516b734b89a7709ab93012d2d94a8b9 100644 (file)
@@ -2068,7 +2068,7 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int
        return rnaicon;
 }
 
-static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop, const char *prop_list)
+static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, PropertyRNA *activeprop, const char *prop_list_id)
 {
        uiBlock *block= uiLayoutGetBlock(layout);
        uiBut *but;
@@ -2212,8 +2212,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
         * \85 you\92ll get a numfield for the integer prop, a check box for the bool prop, and a textfield
         * for the string prop, after the name of each item of the collection.
         */
-       else if (prop_list) {
-               PropertyRNA *prop_ctrls;
+       else if (prop_list_id) {
                row = uiLayoutRow(sub, 1);
                uiItemL(row, name, icon);
 
@@ -2222,18 +2221,21 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                 *      which would obviously produce a sigsev\85 */
                if (itemptr->type) {
                        /* If the special property is set for the item, and it is a collection\85 */
-                       prop_ctrls = RNA_struct_find_property(itemptr, prop_list);
-                       if(prop_ctrls) {
-                               if(RNA_property_type(prop_ctrls) == PROP_STRING) {
-                                       char *prop_names = RNA_property_string_get_alloc(itemptr, prop_ctrls, NULL, 0, NULL);
-                                       char *id = NULL;
-                                       char *ctx = NULL;
-                                       for(id = BLI_strtok_r(prop_names, ":", &ctx); id; id = BLI_strtok_r(NULL, ":", &ctx)) {
-                                               uiItemR(row, itemptr, id, 0, NULL, 0);
-                                               MEM_freeN(id);
-                                       }
-                                       MEM_freeN(prop_names);
+                       PropertyRNA *prop_list= RNA_struct_find_property(itemptr, prop_list_id);
+
+                       if(prop_list && RNA_property_type(prop_list) == PROP_STRING) {
+                               int prop_names_len;
+                               char *prop_names = RNA_property_string_get_alloc(itemptr, prop_list, NULL, 0, &prop_names_len);
+                               char *prop_names_end= prop_names + prop_names_len;
+                               char *id= prop_names;
+                               char *id_next;
+                               while (id < prop_names_end) {
+                                       if ((id_next= strchr(id, ':'))) *id_next++= '\0';
+                                       else id_next= prop_names_end;
+                                       uiItemR(row, itemptr, id, 0, NULL, 0);
+                                       id= id_next;
                                }
+                               MEM_freeN(prop_names);
                        }
                }
        }
index 279657e71c2a0bc2c6988bba6d80eb2b08e0e4f0..02d20e64bc3062eb63fc8062004370467216ada0 100644 (file)
@@ -346,7 +346,6 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
        paintface_flush_flags(ob);
 }
 
-/* note: caller needs to run paintface_flush_flags(ob) after this */
 void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
 {
        Mesh *me;
index 3fc05684fc9e732e147680719fd2aa2b2824cd6e..4d43c6185685eeb7d1a1d6c4183e938967bc086e 100644 (file)
@@ -46,8 +46,8 @@ set(SRC
        physics_intern.h
 )
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_OPENMP)
index f0c327b9279e63a392cacd69a4d72baf4847bd6c..6e88d477d9cc46193ff75b2a5aff55d0817c462c 100644 (file)
@@ -85,7 +85,7 @@
 #include "physics_intern.h" // own include
 
 /* enable/disable overall compilation */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 
 #include "WM_api.h"
 
@@ -1111,7 +1111,7 @@ void fluidsimFreeBake(Object *UNUSED(ob))
        /* not implemented yet */
 }
 
-#else /* DISABLE_ELBEEM */
+#else /* WITH_MOD_FLUID */
 
 /* compile dummy functions for disabled fluid sim */
 
@@ -1135,7 +1135,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
        return 0;
 }
 
-#endif /* DISABLE_ELBEEM */
+#endif /* WITH_MOD_FLUID */
 
 /***************************** Operators ******************************/
 
index feeb2fefca7ebf1db69bd1832e536d8a6f6c359a..fa764e6eefc2af4492959fe4010302a1047588e9 100644 (file)
@@ -154,7 +154,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 
                if((scene->r.mode & R_OSA) == 0) { 
                        ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
-                       glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, rr->rectf);
+                       GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, rr->rectf);
                }
                else {
                        /* simple accumulation, less hassle then FSAA FBO's */
@@ -167,7 +167,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
 
                        /* first sample buffer, also initializes 'rv3d->persmat' */
                        ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
-                       glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, accum_buffer);
+                       GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_buffer);
 
                        /* skip the first sample */
                        for(j=1; j < SAMPLES; j++) {
@@ -175,7 +175,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
                                window_translate_m4(winmat_jitter, rv3d->persmat, jit_ofs[j][0] / sizex, jit_ofs[j][1] / sizey);
 
                                ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter);
-                               glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, accum_tmp);
+                               GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_tmp);
                                add_vn_vn(accum_buffer, accum_tmp, sizex*sizey*sizeof(float));
                        }
 
@@ -278,7 +278,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
        sizey= (scene->r.size*scene->r.ysch)/100;
 
        /* corrects render size with actual size, not every card supports non-power-of-two dimensions */
-       ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
+       ofs= GPU_offscreen_create(sizex, sizey, err_out);
 
        if(!ofs) {
                BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer, %s", err_out);
index 20b1df6ef2cf16fd0637c0706cc31868b9a0dffc..32e553262e2cdec67ef704569bd1525628fe313f 100644 (file)
@@ -2379,7 +2379,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
        glPushAttrib(GL_LIGHTING_BIT);
 
        /* bind */
-       ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
+       ofs= GPU_offscreen_create(sizex, sizey, err_out);
        if(ofs == NULL)
                return NULL;
 
@@ -2403,9 +2403,9 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
        ibuf= IMB_allocImBuf(sizex, sizey, 32, flag);
 
        if(ibuf->rect_float)
-               glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, ibuf->rect_float);
+               GPU_offscreen_read_pixels(ofs, GL_FLOAT, ibuf->rect_float);
        else if(ibuf->rect)
-               glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+               GPU_offscreen_read_pixels(ofs, GL_UNSIGNED_BYTE, ibuf->rect);
        
        //if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW))
        //      BKE_stamp_buf(scene, NULL, rr->rectf, rr->rectx, rr->recty, 4);
index 99f11554aa6a4239e10a9cd6a41acfc254c61e32..ea8db17daf0a33f863016ea13d90ebc02b2a9df2 100644 (file)
@@ -2946,6 +2946,7 @@ static BGpic *background_image_add(bContext *C)
        bgpic->iuser.fie_ima= 2;
        bgpic->iuser.ok= 1;
        bgpic->view= 0; /* 0 for all */
+       bgpic->flag |= V3D_BGPIC_EXPANDED;
        
        BLI_addtail(&v3d->bgpicbase, bgpic);
        
index 965f317aa50520bd812ab9745e659493a716be8b..3fff79390e3177cf743b6a827e660be65f39bd07 100644 (file)
@@ -136,7 +136,7 @@ int GPU_texture_opengl_bindcode(GPUTexture *tex);
 GPUFrameBuffer *GPU_framebuffer_create(void);
 int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256]);
 void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex);
-void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex);
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex, int w, int h);
 void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex);
 void GPU_framebuffer_free(GPUFrameBuffer *fb);
 
@@ -146,10 +146,11 @@ void GPU_framebuffer_restore(void);
    - wrapper around framebuffer and texture for simple offscreen drawing 
    - changes size if graphics card can't support it */
 
-GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256]);
+GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256]);
 void GPU_offscreen_free(GPUOffScreen *ofs);
 void GPU_offscreen_bind(GPUOffScreen *ofs);
 void GPU_offscreen_unbind(GPUOffScreen *ofs);
+void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
 
 /* GPU Shader
    - only for fragment shaders now
index 6189062a855d6adb97f1e57bee0db8acce28d56d..e1a89daf7e202426e7e9cd52b06c1988483b7491 100644 (file)
@@ -790,7 +790,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex)
        tex->fb = NULL;
 }
 
-void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex)
+void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex, int w, int h)
 {
        /* push attributes */
        glPushAttrib(GL_ENABLE_BIT);
@@ -801,7 +801,7 @@ void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex)
        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object);
 
        /* push matrices and set default viewport and matrix */
-       glViewport(0, 0, tex->w, tex->h);
+       glViewport(0, 0, w, h);
        GG.currentfb = tex->fb->object;
 
        glMatrixMode(GL_PROJECTION);
@@ -859,13 +859,19 @@ struct GPUOffScreen {
        GPUFrameBuffer *fb;
        GPUTexture *color;
        GPUTexture *depth;
+
+       /* requested width/height, may be smaller than actual texture size due
+          to missing non-power of two support, so we compensate for that */
+       int w, h;
 };
 
-GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256])
+GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256])
 {
        GPUOffScreen *ofs;
 
        ofs= MEM_callocN(sizeof(GPUOffScreen), "GPUOffScreen");
+       ofs->w= width;
+       ofs->h= height;
 
        ofs->fb = GPU_framebuffer_create();
        if(!ofs->fb) {
@@ -873,24 +879,18 @@ GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256])
                return NULL;
        }
 
-       ofs->depth = GPU_texture_create_depth(*width, *height, err_out);
+       ofs->depth = GPU_texture_create_depth(width, height, err_out);
        if(!ofs->depth) {
                GPU_offscreen_free(ofs);
                return NULL;
        }
 
-       if(*width!=ofs->depth->w || *height!=ofs->depth->h) {
-               *width= ofs->depth->w;
-               *height= ofs->depth->h;
-               printf("Offscreen size differs from given size!\n");
-       }
-       
        if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, err_out)) {
                GPU_offscreen_free(ofs);
                return NULL;
        }
 
-       ofs->color = GPU_texture_create_2D(*width, *height, NULL, err_out);
+       ofs->color = GPU_texture_create_2D(width, height, NULL, err_out);
        if(!ofs->color) {
                GPU_offscreen_free(ofs);
                return NULL;
@@ -921,7 +921,7 @@ void GPU_offscreen_free(GPUOffScreen *ofs)
 void GPU_offscreen_bind(GPUOffScreen *ofs)
 {
        glDisable(GL_SCISSOR_TEST);
-       GPU_framebuffer_texture_bind(ofs->fb, ofs->color);
+       GPU_framebuffer_texture_bind(ofs->fb, ofs->color, ofs->w, ofs->h);
 }
 
 void GPU_offscreen_unbind(GPUOffScreen *ofs)
@@ -931,6 +931,11 @@ void GPU_offscreen_unbind(GPUOffScreen *ofs)
        glEnable(GL_SCISSOR_TEST);
 }
 
+void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels)
+{
+       glReadPixels(0, 0, ofs->w, ofs->h, GL_RGBA, type, pixels);
+}
+
 /* GPUShader */
 
 struct GPUShader {
index d0f834977c8c6485a094ff6279ead6e6cc1fd9b2..26c08f6cae509a4f2339881329d02df7ac493a5b 100644 (file)
@@ -1661,7 +1661,8 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize
 
        /* opengl */
        glDisable(GL_SCISSOR_TEST);
-       GPU_framebuffer_texture_bind(lamp->fb, lamp->tex);
+       GPU_framebuffer_texture_bind(lamp->fb, lamp->tex,
+               GPU_texture_opengl_width(lamp->tex), GPU_texture_opengl_height(lamp->tex));
 
        /* set matrices */
        copy_m4_m4(viewmat, lamp->viewmat);
index d986e9c7a709cc6d30bfc90e7fc7347a40a44388..012333e5da022e5f6235dbcaa7d3506f12eadb23 100644 (file)
@@ -196,8 +196,8 @@ if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_FFTW3)
index d2d24e083b12f24552f3de3fa1a87461c9ff1173..a7eedf5f06208b971689b3d7dd5cad9d2cd5e8db 100644 (file)
@@ -170,7 +170,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
 
 static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
 {
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
        (void)ptr;
        value[0]= '\0';
 #else
@@ -183,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
 
 static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
 {
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
        return 0;
 #else
        return 31;
index 4862b5224ab03b03e9815e5fa628ac6d6787e839..25c673a168f4faa03decc7cb69e14c4fff6a8d3b 100644 (file)
@@ -410,7 +410,7 @@ void RNA_api_ui_layout(StructRNA *srna)
        RNA_def_property_flag(parm, PROP_REQUIRED);
        parm= RNA_def_string(func, "prop_list", "", 0, "",
                             "Identifier of a string property in each data member, specifying which "
-                            "of its properties should have a widget displayed in its row.");
+                            "of its properties should have a widget displayed in its row");
        RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
        RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
        RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
index 735437a0785d0130efbb8166a49a88eda30d8eaf..e8ecc75ca60d14856df080920fa6a066d3033607 100644 (file)
@@ -112,8 +112,8 @@ if(WITH_MOD_DECIMATE)
        )
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_GAMEENGINE)
index 77a2d577fb59251f2f1463f65f6585d44e77b2cd..277ed2c3fb3e754e043f9b17554622fd9cc46f3d 100644 (file)
@@ -13,12 +13,14 @@ incs += ' ' + env['BF_ZLIB_INC']
 
 defs = []
 
-# could be made optional
-defs += ['WITH_MOD_BOOLEAN']
-defs += ['WITH_MOD_DECIMATE']
+if env ['WITH_BF_BOOLEAN']:
+    defs.append('WITH_MOD_BOOLEAN')
 
-if env['BF_NO_ELBEEM']:
-    defs.append('DISABLE_ELBEEM')
+if env ['WITH_BF_DECIMATE']:
+    defs.append('WITH_MOD_DECIMATE')
+
+if env['WITH_BF_FLUID']:
+    defs.append('WITH_MOD_FLUID')
 
 if env['WITH_BF_GAMEENGINE']:
     incs += ' #/extern/recastnavigation'
index 0e9b71c3e6d9e8c07cd949c7cd0812b20f38d4b6..1baa03d2063cafd0201a2c0b0b0b9dc5e4b1e443 100644 (file)
 // headers for fluidsim bobj meshes
 #include "LBM_fluidsim.h"
 
+
 void fluidsim_init(FluidsimModifierData *fluidmd)
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        if(fluidmd)
        {
                FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
@@ -152,7 +153,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
 
 void fluidsim_free(FluidsimModifierData *fluidmd)
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        if(fluidmd)
        {
                if(fluidmd->fss->meshVelocities)
@@ -169,7 +170,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
        return;
 }
 
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 /* read .bobj.gz file into a fluidsimDerivedMesh struct */
 static DerivedMesh *fluidsim_read_obj(const char *filename)
 {
@@ -534,14 +535,14 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
 
        return dm;
 }
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
                                                Object *UNUSED(ob),
                                                DerivedMesh *dm,
                                                int useRenderParams, int UNUSED(isFinalCalc))
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        DerivedMesh *result = NULL;
        int framenr;
        FluidsimSettings *fss = NULL;
index 8d47ad28a864a9733396a7dc90426302911957e7..b8e95ad4c511df73b93ea6944fe75a1235bbb0af 100644 (file)
@@ -626,7 +626,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                        add_v3_v3(edge_vert_nos[ed->v1], nor);
                        add_v3_v3(edge_vert_nos[ed->v2], nor);
 #endif
-                       origindex[numFaces * 2 + i]= ORIGINDEX_NONE;
+                       origindex[numFaces * 2 + i]= fidx;
                }
                
 #ifdef SOLIDIFY_SIDE_NORMALS
index 6732803f19c3e3ea44a48c0844fff9a8c3c13871..0f5a2b61b87d8b2738fb397015a16ae06b7091a1 100644 (file)
@@ -33,9 +33,9 @@
 
 /* **************** MIX RGB ******************** */
 static bNodeSocketTemplate cmp_node_mix_rgb_in[]= {
-       {       SOCK_FLOAT, 1, "Fac",                   0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_FLOAT, 1, "Fac",                   1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_mix_rgb_out[]= {
index c43a2520bb8c281623b3e9fdf3fcf23519d0b648..d8ddcd593a8a64fd0cd9482fe4466ccacc591837 100644 (file)
  *
  * The Original Code was in: source/blender/bpython/include/BPY_extern.h
  *
- * Contributor(s): Michel Selten, Willian P. Germano, Chris Keith
+ * Contributor(s): Michel Selten,
+ *                 Willian P. Germano,
+ *                 Chris Keith,
+ *                 Campbell Barton
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -39,14 +42,10 @@ struct ID; /* DNA_ID.h */
 struct Object; /* DNA_object_types.h */
 struct ChannelDriver; /* DNA_anim_types.h */
 struct ListBase; /* DNA_listBase.h */
-struct SpaceText; /* DNA_space_types.h */
-struct ScrArea; /* DNA_screen_types.h */
-struct bScreen; /* DNA_screen_types.h */
 struct bConstraint; /* DNA_constraint_types.h */
 struct bPythonConstraint; /* DNA_constraint_types.h */
 struct bConstraintOb; /* DNA_constraint_types.h */
 struct bConstraintTarget; /* DNA_constraint_types.h*/
-struct BPyMenu;
 struct bContext;
 struct bContextDataResult;
 struct ReportList;
@@ -61,16 +60,9 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa
 void BPY_pyconstraint_update(struct Object *owner, struct bConstraint *con);
 int BPY_is_pyconstraint(struct Text *text);
 //     void BPY_free_pyconstraint_links(struct Text *text);
-//
+
 void BPY_python_start(int argc, const char **argv);
 void BPY_python_end(void);
-//     void init_syspath(int first_time);
-//     void syspath_append(char *dir);
-//     void BPY_rebuild_syspath(void);
-//     int BPY_path_update(void);
-//
-//     int BPY_Err_getLinenumber(void);
-//     const char *BPY_Err_getFilename(void);
 
 /* 2.5 UI Scripts */
 int            BPY_filepath_exec(struct bContext *C, const char *filepath, struct ReportList *reports);
index 7aa5ed612031cbbf0089c29bef275328c3a855ff..076b4811d07c34422378abad77c0a0da7c2bd574 100644 (file)
@@ -65,9 +65,9 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
        switch ( prop->type ) {
                case IDP_STRING:
 #ifdef USE_STRING_COERCE
-            return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len);
+            return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
 #else
-            return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len);
+            return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
 #endif
                case IDP_INT:
                        return PyLong_FromLong( (long)prop->data.val );
@@ -483,9 +483,9 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
        switch (prop->type) {
                case IDP_STRING:
 #ifdef USE_STRING_COERCE
-            return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len);
+            return PyC_UnicodeFromByteAndSize(IDP_Array(prop), prop->len - 1);
 #else
-            return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len);
+            return PyUnicode_FromStringAndSize(IDP_Array(prop), prop->len - 1);
 #endif
                        break;
                case IDP_FLOAT:
@@ -625,11 +625,11 @@ static PyObject *BPy_IDGroup_IterItems(BPy_IDProperty *self)
 }
 
 /* utility function */
-static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len)
+static void BPy_IDGroup_CorrectListLen(IDProperty *prop, PyObject *seq, int len, const char *func)
 {
        int j;
 
-       printf("ID Property Error found and corrected in BPy_IDGroup_GetKeys/Values/Items!\n");
+       printf("%s: ID Property Error found and corrected!\n", func);
 
        /*fill rest of list with valid references to None*/
        for (j=len; j<prop->len; j++) {
@@ -654,7 +654,7 @@ PyObject *BPy_Wrap_GetKeys(IDProperty *prop)
        for (; loop; loop=loop->next, i++) {}
 
        if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */
-               BPy_IDGroup_CorrectListLen(prop, seq, i);
+               BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
                Py_DECREF(seq); /*free the list*/
                /*call self again*/
                return BPy_Wrap_GetKeys(prop);
@@ -674,7 +674,7 @@ PyObject *BPy_Wrap_GetValues(ID *id, IDProperty *prop)
        }
 
        if (i != prop->len) {
-               BPy_IDGroup_CorrectListLen(prop, seq, i);
+               BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
                Py_DECREF(seq); /*free the list*/
                /*call self again*/
                return BPy_Wrap_GetValues(id, prop);
@@ -697,7 +697,7 @@ PyObject *BPy_Wrap_GetItems(ID *id, IDProperty *prop)
        }
 
        if (i != prop->len) {
-               BPy_IDGroup_CorrectListLen(prop, seq, i);
+               BPy_IDGroup_CorrectListLen(prop, seq, i, __func__);
                Py_DECREF(seq); /*free the list*/
                /*call self again*/
                return BPy_Wrap_GetItems(id, prop);
index 32d4ba857e6e288d4bed0be2d56065e1fab9e7f2..acd5df799828b8d5995351a2effa021db4c85c6c 100644 (file)
@@ -1949,7 +1949,10 @@ static int blend_save_check(bContext *UNUSED(C), wmOperator *op)
 {
        char filepath[FILE_MAX];
        RNA_string_get(op->ptr, "filepath", filepath);
-       if(BLI_replace_extension(filepath, sizeof(filepath), ".blend")) {
+       if(!BLO_has_bfile_extension(filepath)) {
+               /* some users would prefer BLI_replace_extension(),
+                * we keep getting knit-picking bug reports about this - campbell */
+               BLI_ensure_extension(filepath, FILE_MAX, ".blend");
                RNA_string_set(op->ptr, "filepath", filepath);
                return TRUE;
        }