Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 26 Sep 2016 15:19:03 +0000 (17:19 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 26 Sep 2016 15:19:03 +0000 (17:19 +0200)
WARNING! Full build is broken, alembic has not been merged in correctly and has some references to particle stuff.
Don't have time to tackle this now (and probably would be better if someone knowing what he's doing does it anyway).

Conflicts:
release/scripts/startup/bl_ui/properties_particle.py
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/smoke.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_view3d/drawvolume.c
source/blender/makesrna/intern/rna_smoke.c

17 files changed:
1  2 
release/scripts/startup/bl_ui/properties_physics_smoke.py
source/blender/alembic/intern/abc_exporter.cc
source/blender/alembic/intern/abc_mesh.cc
source/blender/blenkernel/BKE_sca.h
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/screen/screen_context.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/makesdna/DNA_smoke_types.h
source/blender/makesrna/intern/rna_smoke.c

Simple merge
index 69b52c92c3f50f31b187387736ce161539cb7aed,b468e6436c868d91ed381f48bb5d3aa2549c2a04..b7f7f2c19cc9d16e00eb49e39847b74c77a3856c
@@@ -98,6 -98,8 +98,7 @@@
  #include "BKE_node.h"
  #include "BKE_object.h"
  #include "BKE_paint.h"
 -#include "BKE_particle.h"
+ #include "BKE_sca.h"
  #include "BKE_speaker.h"
  #include "BKE_sound.h"
  #include "BKE_screen.h"
index 4a8629e40a308eab2dd62515514f385df879736d,05540f515880c81bb3b6ca9010cf944222d90c07..053561237274bd7441aa4eeca21065e5336fbce6
@@@ -523,6 -535,15 +523,14 @@@ void smokeModifier_createType(struct Sm
                        smd->domain->openvdb_comp = VDB_COMPRESSION_ZIP;
  #endif
                        smd->domain->data_depth = 0;
 -                      smd->domain->cache_file_format = PTCACHE_FILE_PTCACHE;
+                       smd->domain->display_thickness = 1.0f;
+                       smd->domain->slice_method = MOD_SMOKE_SLICE_VIEW_ALIGNED;
+                       smd->domain->axis_slice_method = AXIS_SLICE_FULL;
+                       smd->domain->slice_per_voxel = 5.0f;
+                       smd->domain->slice_depth = 0.5f;
+                       smd->domain->slice_axis = 0;
+                       smd->domain->vector_scale = 1.0f;
                }
                else if (smd->type & MOD_SMOKE_TYPE_FLOW)
                {
@@@ -614,8 -637,18 +622,17 @@@ void smokeModifier_copy(struct SmokeMod
                tsmd->domain->openvdb_comp = smd->domain->openvdb_comp;
                tsmd->domain->data_depth = smd->domain->data_depth;
                tsmd->domain->cache_file_format = smd->domain->cache_file_format;
+               tsmd->domain->slice_method = smd->domain->slice_method;
+               tsmd->domain->axis_slice_method = smd->domain->axis_slice_method;
+               tsmd->domain->slice_per_voxel = smd->domain->slice_per_voxel;
+               tsmd->domain->slice_depth = smd->domain->slice_depth;
+               tsmd->domain->slice_axis = smd->domain->slice_axis;
+               tsmd->domain->draw_velocity = smd->domain->draw_velocity;
+               tsmd->domain->vector_draw_type = smd->domain->vector_draw_type;
+               tsmd->domain->vector_scale = smd->domain->vector_scale;
        }
        else if (tsmd->flow) {
 -              tsmd->flow->psys = smd->flow->psys;
                tsmd->flow->noise_texture = smd->flow->noise_texture;
  
                tsmd->flow->vel_multi = smd->flow->vel_multi;
index 357259731d2ba6cfb44478c3b5b47529dce33eaf,7ba4b2be43bb4d9a6bfdbee6d1add396fea4dd61..d0cb7fd12a998ee9f0f3f973ba53399c56461055
@@@ -88,6 -225,12 +88,9 @@@ void ED_operatortypes_physics(void
        operatortypes_dynamicpaint();
  }
  
 -void ED_keymap_physics(wmKeyConfig *keyconf)
 +void ED_keymap_physics(wmKeyConfig *UNUSED(keyconf))
  {
 -      keymap_particle(keyconf);
 -      //keymap_pointcache(keyconf);
  }
index a65733ce667bb833e23d6732fa415357cb746842,a1663dd641da12613c4fb9c26aac866d777a6f3e..e95ca32048dde11fcb205a1be86b62e865e8240a
@@@ -61,8 -61,8 +61,8 @@@ typedef struct TreeElement 
  
  #define TREESTORE_ID_TYPE(_id) \
        (ELEM(GS((_id)->name), ID_SCE, ID_LI, ID_OB, ID_ME, ID_CU, ID_MB, ID_NT, ID_MA, ID_TE, ID_IM, ID_LT, ID_LA, ID_CA) || \
 -       ELEM(GS((_id)->name), ID_KE, ID_WO, ID_SPK, ID_GR, ID_AR, ID_AC, ID_BR, ID_PA, ID_GD, ID_LS) || \
 +       ELEM(GS((_id)->name), ID_KE, ID_WO, ID_SPK, ID_GR, ID_AR, ID_AC, ID_BR, ID_GD, ID_LS) || \
-        ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF))  /* Only in 'blendfile' mode ... :/ */
+        ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF, ID_PAL))  /* Only in 'blendfile' mode ... :/ */
  
  /* TreeElement->flag */
  #define TE_ACTIVE       1
index 75ba8bc15d9e7f1adfa08e2e4ece159f27d61d58,b0e21601b9c6d1b7c39a131cff7e74e181364dee..9cfcd6cef05c7b36e7347f3516000b08e06aa27e
@@@ -41,6 -40,9 +41,8 @@@
  #include "BLI_utildefines.h"
  #include "BLI_math.h"
  
 -#include "BKE_particle.h"
+ #include "BKE_DerivedMesh.h"
  #include "smoke_API.h"
  
  #include "BIF_gl.h"
index 3f9bcde4ce28ca4fe6f2da8a86f8b18bc7cb44d5,40a45416acae10c110af2fe9133dbdbd6eae4711..b0be30ac3555bd02dedee067036203fda836bde8
@@@ -400,6 -435,40 +400,32 @@@ static void rna_def_smoke_domain_settin
                {0, NULL, 0, NULL, NULL}
        };
  
 -      static EnumPropertyItem cache_file_type_items[] = {
 -              {PTCACHE_FILE_PTCACHE, "POINTCACHE", 0, "Point Cache", "Blender specific point cache file format"},
 -#ifdef WITH_OPENVDB
 -              {PTCACHE_FILE_OPENVDB, "OPENVDB", 0, "OpenVDB", "OpenVDB file format"},
 -#endif
 -              {0, NULL, 0, NULL, NULL}
 -      };
 -
+       static EnumPropertyItem smoke_view_items[] = {
+           {MOD_SMOKE_SLICE_VIEW_ALIGNED, "VIEW_ALIGNED", 0, "View", "Slice volume parallel to the view plane"},
+           {MOD_SMOKE_SLICE_AXIS_ALIGNED, "AXIS_ALIGNED", 0, "Axis", "Slice volume parallel to the major axis"},
+           {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem axis_slice_method_items[] = {
+           {AXIS_SLICE_FULL, "FULL", 0, "Full", "Slice the whole domain object"},
+           {AXIS_SLICE_SINGLE, "SINGLE", 0, "Single", "Perform a single slice of the domain object"},
+           {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem axis_slice_position_items[] = {
+           {SLICE_AXIS_AUTO, "AUTO", 0, "Auto", "Adjust slice direction according to the view direction"},
+           {SLICE_AXIS_X, "X", 0, "X", "Slice along the X axis"},
+           {SLICE_AXIS_Y, "Y", 0, "Y", "Slice along the Y axis"},
+           {SLICE_AXIS_Z, "Z", 0, "Z", "Slice along the Z axis"},
+           {0, NULL, 0, NULL, NULL}
+       };
+       static EnumPropertyItem vector_draw_items[] = {
+           {VECTOR_DRAW_NEEDLE, "NEEDLE", 0, "Needle", "Draw vectors as needles"},
+           {VECTOR_DRAW_STREAMLINE, "STREAMLINE", 0, "Streamlines", "Draw vectors as streamlines"},
+           {0, NULL, 0, NULL, NULL}
+       };
        srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
        RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
        RNA_def_struct_sdna(srna, "SmokeDomainSettings");
        RNA_def_property_ui_range(prop, 0.01, 0.5, 1.0, 5);
        RNA_def_property_ui_text(prop, "Threshold",
                                 "Maximum amount of fluid cell can contain before it is considered empty");
-       RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update");
 -      RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
 -
 -      prop = RNA_def_property(srna, "cache_file_format", PROP_ENUM, PROP_NONE);
 -      RNA_def_property_enum_sdna(prop, NULL, "cache_file_format");
 -      RNA_def_property_enum_items(prop, cache_file_type_items);
 -      RNA_def_property_enum_funcs(prop, NULL, "rna_Smoke_cachetype_set", NULL);
 -      RNA_def_property_ui_text(prop, "File Format", "Select the file format to be used for caching");
 -      RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
+       /* display settings */
+       prop = RNA_def_property(srna, "slice_method", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "slice_method");
+       RNA_def_property_enum_items(prop, smoke_view_items);
+       RNA_def_property_ui_text(prop, "View Method", "How to slice the volume for viewport rendering");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "axis_slice_method", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "axis_slice_method");
+       RNA_def_property_enum_items(prop, axis_slice_method_items);
+       RNA_def_property_ui_text(prop, "Method", "");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "slice_axis", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "slice_axis");
+       RNA_def_property_enum_items(prop, axis_slice_position_items);
+       RNA_def_property_ui_text(prop, "Axis", "");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "slice_per_voxel", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "slice_per_voxel");
+       RNA_def_property_range(prop, 0.0, 100.0);
+       RNA_def_property_ui_range(prop, 0.0, 5.0, 0.1, 1);
+       RNA_def_property_ui_text(prop, "Slice Per Voxel",
+                                "How many slices per voxel should be generated");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "slice_depth", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "slice_depth");
+       RNA_def_property_range(prop, 0.0, 1.0);
+       RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3);
+       RNA_def_property_ui_text(prop, "Position", "Position of the slice");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "display_thickness", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "display_thickness");
+       RNA_def_property_range(prop, 0.001, 1000.0);
+       RNA_def_property_ui_range(prop, 0.1, 100.0, 0.1, 3);
+       RNA_def_property_ui_text(prop, "Thickness", "Thickness of smoke drawing in the viewport");
+       RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
+       prop = RNA_def_property(srna, "draw_velocity", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "draw_velocity", 0);
+       RNA_def_property_ui_text(prop, "Draw Velocity", "Toggle visualation of the velocity field as needles");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "vector_draw_type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "vector_draw_type");
+       RNA_def_property_enum_items(prop, vector_draw_items);
+       RNA_def_property_ui_text(prop, "Draw Type", "");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+       prop = RNA_def_property(srna, "vector_scale", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "vector_scale");
+       RNA_def_property_range(prop, 0.0, 1000.0);
+       RNA_def_property_ui_range(prop, 0.0, 100.0, 0.1, 3);
+       RNA_def_property_ui_text(prop, "Scale", "Multiplier for scaling the vectors");
+       RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
  }
  
  static void rna_def_smoke_flow_settings(BlenderRNA *brna)