[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27843] branches/soc-2009-yukishiro: merge till 23147 (have to merge very slowly)

Jingyuan Huang jingyuan.huang at gmail.com
Tue Mar 30 00:19:11 CEST 2010


Revision: 27843
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27843
Author:   yukishiro
Date:     2010-03-30 00:19:10 +0200 (Tue, 30 Mar 2010)

Log Message:
-----------
merge till 23147 (have to merge very slowly)

Modified Paths:
--------------
    branches/soc-2009-yukishiro/intern/audaspace/intern/AUD_C-API.cpp
    branches/soc-2009-yukishiro/intern/smoke/extern/smoke_API.h
    branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D.cpp
    branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D_STATIC.cpp
    branches/soc-2009-yukishiro/intern/smoke/intern/WTURBULENCE.cpp
    branches/soc-2009-yukishiro/intern/smoke/intern/WTURBULENCE.h
    branches/soc-2009-yukishiro/intern/smoke/intern/smoke_API.cpp
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/blender.vcproj
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/editors/ED_editors.vcproj
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/gpu/BL_gpu.vcproj
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
    branches/soc-2009-yukishiro/projectfiles_vc9/blender/nodes/nodes.vcproj
    branches/soc-2009-yukishiro/release/datafiles/blenderbuttons
    branches/soc-2009-yukishiro/release/io/engine_render_pov.py
    branches/soc-2009-yukishiro/release/io/netrender/__init__.py
    branches/soc-2009-yukishiro/release/io/netrender/client.py
    branches/soc-2009-yukishiro/release/io/netrender/master.py
    branches/soc-2009-yukishiro/release/io/netrender/model.py
    branches/soc-2009-yukishiro/release/io/netrender/operators.py
    branches/soc-2009-yukishiro/release/io/netrender/slave.py
    branches/soc-2009-yukishiro/release/io/netrender/ui.py
    branches/soc-2009-yukishiro/release/io/netrender/utils.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_armature.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_bone.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_curve.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_empty.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_modifier.py
    branches/soc-2009-yukishiro/release/ui/buttons_data_text.py
    branches/soc-2009-yukishiro/release/ui/buttons_object_constraint.py
    branches/soc-2009-yukishiro/release/ui/buttons_particle.py
    branches/soc-2009-yukishiro/release/ui/buttons_physics_smoke.py
    branches/soc-2009-yukishiro/release/ui/space_console.py
    branches/soc-2009-yukishiro/release/ui/space_image.py
    branches/soc-2009-yukishiro/release/ui/space_info.py
    branches/soc-2009-yukishiro/release/ui/space_view3d.py
    branches/soc-2009-yukishiro/release/ui/space_view3d_toolbar.py
    branches/soc-2009-yukishiro/source/Makefile
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_animsys.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_cloth.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_curve.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_global.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_key.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_node.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_particle.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_pointcache.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_smoke.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_utildefines.h
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/anim.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/anim_sys.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/armature.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cloth.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/colortools.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/constraint.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/curve.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/displist.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/font.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/implicit.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/key.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/lattice.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/library.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/material.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/node.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/object.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/particle.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/particle_system.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/smoke.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/softbody.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/texture.c
    branches/soc-2009-yukishiro/source/blender/blenlib/BLI_arithb.h
    branches/soc-2009-yukishiro/source/blender/blenlib/BLI_fileops.h
    branches/soc-2009-yukishiro/source/blender/blenlib/intern/arithb.c
    branches/soc-2009-yukishiro/source/blender/blenlib/intern/fileops.c
    branches/soc-2009-yukishiro/source/blender/blenlib/intern/freetypefont.c
    branches/soc-2009-yukishiro/source/blender/blenlib/intern/util.c
    branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c
    branches/soc-2009-yukishiro/source/blender/blenloader/intern/writefile.c
    branches/soc-2009-yukishiro/source/blender/editors/animation/keyingsets.c
    branches/soc-2009-yukishiro/source/blender/editors/armature/editarmature.c
    branches/soc-2009-yukishiro/source/blender/editors/armature/editarmature_retarget.c
    branches/soc-2009-yukishiro/source/blender/editors/armature/meshlaplacian.c
    branches/soc-2009-yukishiro/source/blender/editors/armature/poselib.c
    branches/soc-2009-yukishiro/source/blender/editors/armature/poseobject.c
    branches/soc-2009-yukishiro/source/blender/editors/curve/curve_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/curve/editcurve.c
    branches/soc-2009-yukishiro/source/blender/editors/datafiles/blenderbuttons.c
    branches/soc-2009-yukishiro/source/blender/editors/gpencil/gpencil_buttons.c
    branches/soc-2009-yukishiro/source/blender/editors/include/ED_anim_api.h
    branches/soc-2009-yukishiro/source/blender/editors/include/ED_armature.h
    branches/soc-2009-yukishiro/source/blender/editors/include/ED_mball.h
    branches/soc-2009-yukishiro/source/blender/editors/include/ED_mesh.h
    branches/soc-2009-yukishiro/source/blender/editors/include/ED_object.h
    branches/soc-2009-yukishiro/source/blender/editors/include/UI_icons.h
    branches/soc-2009-yukishiro/source/blender/editors/include/UI_interface.h
    branches/soc-2009-yukishiro/source/blender/editors/interface/interface_layout.c
    branches/soc-2009-yukishiro/source/blender/editors/interface/interface_utils.c
    branches/soc-2009-yukishiro/source/blender/editors/interface/interface_widgets.c
    branches/soc-2009-yukishiro/source/blender/editors/interface/view2d_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_edit.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_intern.h
    branches/soc-2009-yukishiro/source/blender/editors/object/object_modifier.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_vgroup.c
    branches/soc-2009-yukishiro/source/blender/editors/physics/ed_fluidsim.c
    branches/soc-2009-yukishiro/source/blender/editors/physics/editparticle.c
    branches/soc-2009-yukishiro/source/blender/editors/screen/area.c
    branches/soc-2009-yukishiro/source/blender/editors/screen/screen_context.c
    branches/soc-2009-yukishiro/source/blender/editors/screen/screen_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2009-yukishiro/source/blender/editors/space_buttons/buttons_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/space_buttons/space_buttons.c
    branches/soc-2009-yukishiro/source/blender/editors/space_console/console_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/space_console/space_console.c
    branches/soc-2009-yukishiro/source/blender/editors/space_graph/graph_draw.c
    branches/soc-2009-yukishiro/source/blender/editors/space_graph/graph_select.c
    branches/soc-2009-yukishiro/source/blender/editors/space_image/image_buttons.c
    branches/soc-2009-yukishiro/source/blender/editors/space_info/info_stats.c
    branches/soc-2009-yukishiro/source/blender/editors/space_node/drawnode.c
    branches/soc-2009-yukishiro/source/blender/editors/space_text/space_text.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawarmature.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawvolume.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_buttons.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_header.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_intern.h
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_select.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_snap.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_toolbar.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_view.c
    branches/soc-2009-yukishiro/source/blender/editors/transform/transform.c
    branches/soc-2009-yukishiro/source/blender/editors/transform/transform_conversions.c
    branches/soc-2009-yukishiro/source/blender/editors/transform/transform_manipulator.c
    branches/soc-2009-yukishiro/source/blender/editors/transform/transform_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/transform/transform_orientations.c
    branches/soc-2009-yukishiro/source/blender/editors/util/undo.c
    branches/soc-2009-yukishiro/source/blender/editors/uvedit/uvedit_ops.c
    branches/soc-2009-yukishiro/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    branches/soc-2009-yukishiro/source/blender/gpu/CMakeLists.txt
    branches/soc-2009-yukishiro/source/blender/gpu/GPU_draw.h
    branches/soc-2009-yukishiro/source/blender/gpu/SConscript
    branches/soc-2009-yukishiro/source/blender/gpu/intern/Makefile
    branches/soc-2009-yukishiro/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2009-yukishiro/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2009-yukishiro/source/blender/imbuf/intern/anim5.c
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_action_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_cloth_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_constraint_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_curve_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_material_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_object_force.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_object_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_particle_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_smoke_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_texture_types.h
    branches/soc-2009-yukishiro/source/blender/makesrna/RNA_access.h
    branches/soc-2009-yukishiro/source/blender/makesrna/RNA_define.h
    branches/soc-2009-yukishiro/source/blender/makesrna/RNA_enum_types.h
    branches/soc-2009-yukishiro/source/blender/makesrna/RNA_types.h
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/makesrna.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_access.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_armature.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_brush.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_cloth.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_constraint.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_curve.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_define.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_gpencil.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_group.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_internal_types.h
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_material.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_mesh.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_modifier.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_nodetree_types.h
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_object.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_particle.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_pose.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_render.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_rna.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_smoke.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_texture.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_wm.c
    branches/soc-2009-yukishiro/source/blender/nodes/CMP_node.h
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_util.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_util.h
    branches/soc-2009-yukishiro/source/blender/python/generic/Geometry.c
    branches/soc-2009-yukishiro/source/blender/python/generic/matrix.c
    branches/soc-2009-yukishiro/source/blender/python/generic/vector.c
    branches/soc-2009-yukishiro/source/blender/python/intern/bpy_array.c
    branches/soc-2009-yukishiro/source/blender/python/intern/bpy_rna.c
    branches/soc-2009-yukishiro/source/blender/python/intern/bpy_rna.h
    branches/soc-2009-yukishiro/source/blender/render/intern/source/convertblender.c
    branches/soc-2009-yukishiro/source/blender/render/intern/source/strand.c
    branches/soc-2009-yukishiro/source/blender/render/intern/source/texture.c
    branches/soc-2009-yukishiro/source/blender/render/intern/source/volume_precache.c
    branches/soc-2009-yukishiro/source/blender/render/intern/source/volumetric.c
    branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_event_system.c
    branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_files.c
    branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_keymap.c
    branches/soc-2009-yukishiro/source/blender/windowmanager/intern/wm_operators.c
    branches/soc-2009-yukishiro/source/nan_link.mk

Added Paths:
-----------
    branches/soc-2009-yukishiro/release/windows/inno/
    branches/soc-2009-yukishiro/source/blender/editors/metaball/mball_edit.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_add.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_constraint.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_group.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_hook.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_lattice.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_relations.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_select.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_shapekey.c
    branches/soc-2009-yukishiro/source/blender/editors/object/object_transform.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/CMP_nodes/CMP_levels.c

Removed Paths:
-------------
    branches/soc-2009-yukishiro/source/blender/editors/metaball/editmball.c
    branches/soc-2009-yukishiro/source/blender/editors/object/editconstraint.c
    branches/soc-2009-yukishiro/source/blender/editors/object/editgroup.c
    branches/soc-2009-yukishiro/source/blender/editors/object/editkey.c
    branches/soc-2009-yukishiro/source/blender/editors/object/editlattice.c

Modified: branches/soc-2009-yukishiro/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/audaspace/intern/AUD_C-API.cpp	2010-03-29 21:58:58 UTC (rev 27842)
+++ branches/soc-2009-yukishiro/intern/audaspace/intern/AUD_C-API.cpp	2010-03-29 22:19:10 UTC (rev 27843)
@@ -67,7 +67,7 @@
 #endif
 
 static AUD_IDevice* AUD_device = NULL;
-static int AUD_available_devices[3];
+static int AUD_available_devices[4];
 static AUD_I3DDevice* AUD_3ddevice = NULL;
 
 int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize)

Modified: branches/soc-2009-yukishiro/intern/smoke/extern/smoke_API.h
===================================================================
--- branches/soc-2009-yukishiro/intern/smoke/extern/smoke_API.h	2010-03-29 21:58:58 UTC (rev 27842)
+++ branches/soc-2009-yukishiro/intern/smoke/extern/smoke_API.h	2010-03-29 22:19:10 UTC (rev 27843)
@@ -63,11 +63,11 @@
 void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
 
 float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
-void smoke_turbulence_get_res(struct WTURBULENCE *wt, unsigned int *res);
+void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res);
 void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
-void smoke_turbulence_initBlenderRNA(struct WTURBULENCE *wt, float *strength);
+void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength);
 
-void smoke_turbulence_dissolve(struct WTURBULENCE *wt, int speed, int log);
+void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log);
 
 // export
 void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw);

Modified: branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D.cpp	2010-03-29 21:58:58 UTC (rev 27842)
+++ branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D.cpp	2010-03-29 22:19:10 UTC (rev 27843)
@@ -27,9 +27,9 @@
 #include <zlib.h>
 
 // boundary conditions of the fluid domain
-#define DOMAIN_BC_FRONT  1
-#define DOMAIN_BC_TOP    0
-#define DOMAIN_BC_LEFT   1
+#define DOMAIN_BC_FRONT  0 // z
+#define DOMAIN_BC_TOP    1 // y
+#define DOMAIN_BC_LEFT   1 // x
 #define DOMAIN_BC_BACK   DOMAIN_BC_FRONT
 #define DOMAIN_BC_BOTTOM DOMAIN_BC_TOP
 #define DOMAIN_BC_RIGHT  DOMAIN_BC_LEFT
@@ -111,47 +111,42 @@
 	}
 
 	// set side obstacles
-  size_t index;
-  for (int y = 0; y < _yRes; y++) // z
-    for (int x = 0; x < _xRes; x++)
-    {
-      // front slab
-      index = x + y * _xRes;
-      if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
+	int index;
+	for (int y = 0; y < _yRes; y++)
+	for (int x = 0; x < _xRes; x++)
+	{
+		// front slab
+		index = x + y * _xRes;
+		if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
 
-      // back slab
-      index += _totalCells - _slabSize;
-      if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
-    }
-  for (int z = 0; z < _zRes; z++) // y
-    for (int x = 0; x < _xRes; x++)
-    {
-      // bottom slab
-      index = x + z * _slabSize;
-      if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
+		// back slab
+		index += _totalCells - _slabSize;
+		if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
+	}
 
-      // top slab
-      index += _slabSize - _xRes;
-      if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
-    }
-  for (int z = 0; z < _zRes; z++) // x
-    for (int y = 0; y < _yRes; y++)
-    {
-      // left slab
-      index = y * _xRes + z * _slabSize;
-      if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+	for (int z = 0; z < _zRes; z++)
+	for (int x = 0; x < _xRes; x++)
+	{
+		// bottom slab
+		index = x + z * _slabSize;
+		if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
 
-      // right slab
-      index += _xRes - 1;
-      if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
-    }
+		// top slab
+		index += _slabSize - _xRes;
+		if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
+	}
 
-	/*
-	SPHERE *obsSphere = NULL;
-	obsSphere = new SPHERE(0.375,0.5,0.375, 0.1); // for 4 to 3 domain
-	addObstacle(obsSphere);
-	delete obsSphere;
-	*/
+	for (int z = 0; z < _zRes; z++)
+	for (int y = 0; y < _yRes; y++)
+	{
+		// left slab
+		index = y * _xRes + z * _slabSize;
+		if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+
+		// right slab
+		index += _xRes - 1;
+		if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
+	}
 }
 
 FLUID_3D::~FLUID_3D()
@@ -191,7 +186,7 @@
 	for (int i = 0; i < _totalCells; i++)
 	{
 		_xForce[i] = _yForce[i] = _zForce[i] = 0.0f;
-		_obstacles[i] &= ~2;
+		// _obstacles[i] &= ~2;
 	}
 
 	wipeBoundaries();
@@ -232,7 +227,8 @@
 	_totalTime += _dt;
 	_totalSteps++;	
 
-	memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
+	// todo xxx dg: only clear obstacles, not boundaries
+	// memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
 }
 
 //////////////////////////////////////////////////////////////////////
@@ -270,7 +266,7 @@
 //////////////////////////////////////////////////////////////////////
 void FLUID_3D::copyBorderAll(float* field)
 {
-	size_t index;
+	int index;
 	for (int y = 0; y < _yRes; y++)
 		for (int x = 0; x < _xRes; x++)
 		{
@@ -350,14 +346,14 @@
 
 	// copy out the boundaries
 	if(DOMAIN_BC_LEFT == 0)  setNeumannX(_xVelocity, _res);
-	else setZeroX(_xVelocity, _res);
+	else setZeroX(_xVelocity, _res); 
 
-	if(DOMAIN_BC_TOP == 0)   setNeumannZ(_zVelocity, _res);
+	if(DOMAIN_BC_TOP == 0)   setNeumannY(_yVelocity, _res);
+	else setZeroY(_yVelocity, _res); 
+
+	if(DOMAIN_BC_FRONT == 0) setNeumannZ(_zVelocity, _res);
 	else setZeroZ(_zVelocity, _res);
 
-	if(DOMAIN_BC_FRONT == 0) setNeumannY(_yVelocity, _res);
-	else setZeroY(_yVelocity, _res);
-
 	// calculate divergence
 	index = _slabSize + _xRes + 1;
 	for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
@@ -400,12 +396,16 @@
 		for (y = 1; y < _yRes - 1; y++, index += 2)
 			for (x = 1; x < _xRes - 1; x++, index++)
 			{
-				if(!_obstacles[index])
+				// if(!_obstacles[index])
 				{
 					_xVelocity[index] -= 0.5f * (_pressure[index + 1]     - _pressure[index - 1]) * invDx;
 					_yVelocity[index] -= 0.5f * (_pressure[index + _xRes]  - _pressure[index - _xRes]) * invDx;
 					_zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx;
-				}
+				}/*
+				else
+				{
+					_xVelocity[index] = _yVelocity[index] = _zVelocity[index] = 0.0f;
+				}*/
 			}
 
 	if (_pressure) delete[] _pressure;
@@ -669,14 +669,14 @@
 	Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
 
 	if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
-	else setZeroX(_xVelocity, res);
+	else setZeroX(_xVelocity, res); 
 
-	if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+	if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocity, res);
+	else setZeroY(_yVelocity, res); 
+
+	if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocity, res);
 	else setZeroZ(_zVelocity, res);
 
-	if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
-	else setZeroY(_yVelocity, res);
-
 	SWAP_POINTERS(_xVelocity, _xVelocityOld);
 	SWAP_POINTERS(_yVelocity, _yVelocityOld);
 	SWAP_POINTERS(_zVelocity, _zVelocityOld);
@@ -698,14 +698,14 @@
 	advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _zVelocityOld, _zVelocity, t1,t2, res, _obstacles);
 
 	if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
-	else setZeroX(_xVelocity, res);
+	else setZeroX(_xVelocity, res); 
 
-	if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+	if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocity, res);
+	else setZeroY(_yVelocity, res); 
+
+	if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocity, res);
 	else setZeroZ(_zVelocity, res);
 
-	if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
-	else setZeroY(_yVelocity, res);
-
 	setZeroBorder(_density, res);
 	setZeroBorder(_heat, res);
 

Modified: branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D_STATIC.cpp
===================================================================
--- branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D_STATIC.cpp	2010-03-29 21:58:58 UTC (rev 27842)
+++ branches/soc-2009-yukishiro/intern/smoke/intern/FLUID_3D_STATIC.cpp	2010-03-29 22:19:10 UTC (rev 27843)
@@ -80,7 +80,7 @@
 void FLUID_3D::setNeumannX(float* field, Vec3Int res)
 {
 	const int slabSize = res[0] * res[1];
-	size_t index;
+	int index;
 	for (int z = 0; z < res[2]; z++)
 		for (int y = 0; y < res[1]; y++)
 		{
@@ -92,6 +92,18 @@
 			index += res[0] - 1;
 			field[index] = field[index - 2];
 		}
+
+	// fix, force top slab to only allow outwards flux
+	for (int y = 0; y < res[1]; y++)
+		for (int z = 0; z < res[2]; z++)
+		{
+			// top slab
+			int index = y * res[0] + z * slabSize;
+			index += res[0] - 1;
+			if(field[index]<0.) field[index] = 0.;
+			index -= 1;
+			if(field[index]<0.) field[index] = 0.;
+		}
  }
 
 //////////////////////////////////////////////////////////////////////
@@ -100,18 +112,31 @@
 void FLUID_3D::setNeumannY(float* field, Vec3Int res)
 {
 	const int slabSize = res[0] * res[1];
-	size_t index;
+	int index;
 	for (int z = 0; z < res[2]; z++)
 		for (int x = 0; x < res[0]; x++)
 		{
-			// front slab
+			// bottom slab
 			index = x + z * slabSize;
 			field[index] = field[index + 2 * res[0]];
 
-			// back slab
+			// top slab
 			index += slabSize - res[0];
 			field[index] = field[index - 2 * res[0]];
 		}
+
+	// fix, force top slab to only allow outwards flux
+	for (int z = 0; z < res[2]; z++)
+		for (int x = 0; x < res[0]; x++)
+		{
+			// top slab
+			int index = x + z * slabSize;
+			index += slabSize - res[0];
+			if(field[index]<0.) field[index] = 0.;
+			index -= res[0];
+			if(field[index]<0.) field[index] = 0.;
+		}
+		
 }
 
 //////////////////////////////////////////////////////////////////////
@@ -121,15 +146,15 @@
 {
 	const int slabSize = res[0] * res[1];
 	const int totalCells = res[0] * res[1] * res[2];
-	size_t index;
+	int index;
 	for (int y = 0; y < res[1]; y++)
 		for (int x = 0; x < res[0]; x++)
 		{
-			// bottom slab
+			// front slab
 			index = x + y * res[0];
 			field[index] = field[index + 2 * slabSize];
 
-			// top slab
+			// back slab
 			index += totalCells - slabSize;
 			field[index] = field[index - 2 * slabSize];
 		}
@@ -139,11 +164,11 @@
 		for (int x = 0; x < res[0]; x++)
 		{
 			// top slab
-			index = x + y * res[0];
+			int index = x + y * res[0];
 			index += totalCells - slabSize;
-			if(field[index]<0.) field[index] = 0.0f;
+			if(field[index]<0.) field[index] = 0.;
 			index -= slabSize;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list