[Bf-blender-cvs] [a38c14aecb8] fluid-mantaflow: Merge branch 'particleSystem' into rnaSmoke
Sebastián Barschkis
noreply at git.blender.org
Sat Apr 6 22:13:39 CEST 2019
Commit: a38c14aecb8c01b3c3c8b6f9af427bd3e2ef69a4
Author: Sebastián Barschkis
Date: Tue Mar 26 20:04:36 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBa38c14aecb8c01b3c3c8b6f9af427bd3e2ef69a4
Merge branch 'particleSystem' into rnaSmoke
===================================================================
===================================================================
diff --cc source/blender/makesrna/intern/rna_smoke.c
index 5c7aabc6009,3f44d488497..708dba9628a
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@@ -30,10 -22,7 +22,9 @@@
#include <stdlib.h>
#include <limits.h>
+#include "BLI_utildefines.h"
+#include "BLI_path_util.h"
#include "BLI_sys_types.h"
- #include "BLI_threads.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@@ -69,12 -58,7 +62,11 @@@
static void rna_Smoke_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
- DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
+ DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY);
+
+ // Needed for liquid domain objects
+ Object *ob = ptr->id.data;
- DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@@ -88,8 -72,24 +80,8 @@@ static void rna_Smoke_resetCache(Main *
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
if (settings->smd && settings->smd->domain)
settings->point_cache[0]->flag |= PTCACHE_OUTDATED;
- DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
+ DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY);
}
-
-static void rna_Smoke_cachetype_set(struct PointerRNA *ptr, int value)
-{
- SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
- Object *ob = (Object *)ptr->id.data;
-
- if (value != settings->cache_file_format) {
- /* Clear old caches. */
- PTCacheID id;
- BKE_ptcache_id_from_smoke(&id, ob, settings->smd);
- BKE_ptcache_id_clear(&id, PTCACHE_CLEAR_ALL, 0);
-
- settings->cache_file_format = value;
- }
-}
-
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
@@@ -995,15 -443,13 +987,15 @@@ static void rna_def_smoke_domain_settin
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem smoke_domain_types[] = {
+ {FLUID_DOMAIN_TYPE_GAS, "GAS", 0, "Gas", "Create domain for gases"},
+ {FLUID_DOMAIN_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Create domain for liquids"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static const EnumPropertyItem prop_noise_type_items[] = {
- {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
-#ifdef WITH_FFTW3
- {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
-#endif
- /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
+ {FLUID_NOISE_TYPE_WAVELET, "NOISEWAVE", 0, "Wavelet", ""},
- {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem prop_compression_items[] = {
@@@ -1034,28 -480,26 +1026,28 @@@
{0, NULL, 0, NULL, NULL},
};
- static const EnumPropertyItem smoke_domain_colli_items[] = {
- {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
- {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
- "Smoke doesn't collide with top and bottom sides"},
- {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
+ static EnumPropertyItem fluid_mesh_quality_items[] = {
+ {FLUID_DOMAIN_MESH_IMPROVED, "IMPROVED", 0, "Final", "Use improved particle levelset (slower but more precise and with mesh smoothening options)"},
+ {FLUID_DOMAIN_MESH_UNION, "UNION", 0, "Preview", "Use union particle levelset (faster but lower quality)"},
- {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL},
};
- static const 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
+ static EnumPropertyItem fluid_guiding_source_items[] = {
+ {FLUID_DOMAIN_GUIDING_SRC_DOMAIN, "DOMAIN", 0, "Domain", "Use a fluid domain for guiding (domain needs to be baked already so that velocities can be extracted but can be of any type)"},
+ {FLUID_DOMAIN_GUIDING_SRC_EFFECTOR, "EFFECTOR", 0, "Effector", "Use guiding (effector) objects to create fluid guiding (guiding objects should be animated and baked once set up completely)"},
- {0, NULL, 0, NULL, NULL}
++ {0, NULL, 0, NULL, NULL},
+ };
+
+ /* Cache type - generated dynamically based on domain type */
+ static EnumPropertyItem cache_file_type_items[] = {
+ {0, "NONE", 0, "", ""},
- {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL},
};
static const 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"},
+ {FLUID_DOMAIN_SLICE_VIEW_ALIGNED, "VIEW_ALIGNED", 0, "View", "Slice volume parallel to the view plane"},
+ {FLUID_DOMAIN_SLICE_AXIS_ALIGNED, "AXIS_ALIGNED", 0, "Axis", "Slice volume parallel to the major axis"},
- {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem axis_slice_method_items[] = {
@@@ -1075,51 -525,79 +1073,51 @@@
static const EnumPropertyItem vector_draw_items[] = {
{VECTOR_DRAW_NEEDLE, "NEEDLE", 0, "Needle", "Display vectors as needles"},
{VECTOR_DRAW_STREAMLINE, "STREAMLINE", 0, "Streamlines", "Display vectors as streamlines"},
- {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL},
};
+ static const EnumPropertyItem sndparticle_boundary_items[] = {
+ { SNDPARTICLE_BOUNDARY_DELETE, "DELETE", 0, "Delete", "Delete secondary particles that are inside obstacles or left the domain" },
+ { SNDPARTICLE_BOUNDARY_PUSHOUT, "PUSHOUT", 0, "Push Out", "Push secondary particles that left the domain back into the domain" },
+ { 0, NULL, 0, NULL, NULL }
+ };
+
+ static const EnumPropertyItem sndparticle_combined_export_items[] = {
+ { SNDPARTICLE_COMBINED_EXPORT_OFF, "OFF", 0, "Off", "Create a seperate particle system for every secondary particle type" },
+ { SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM, "SPRAY_FOAM", 0, "Spray + Foam", "Spray and foam particles are saved in the same particle system" },
+ { SNDPARTICLE_COMBINED_EXPORT_SPRAY_BUBBLE, "SPRAY_BUBBLES", 0, "Spray + Bubbles", "Spray and bubble particles are saved in the same particle system" },
+ { SNDPARTICLE_COMBINED_EXPORT_FOAM_BUBBLE, "FOAM_BUBBLES", 0, "Foam + Bubbles", "Foam and bubbles particles are saved in the same particle system" },
+ { SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM_BUBBLE, "SPRAY_FOAM_BUBBLES", 0, "Spray + Foam + Bubbles", "Create one particle system that contains all three secondary particle types" },
+ { 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_struct_path_func(srna, "rna_SmokeDomainSettings_path");
- prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "maxres");
- RNA_def_property_range(prop, 6, 512);
- RNA_def_property_ui_range(prop, 24, 512, 2, -1);
- RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
-
- prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "amplify");
- RNA_def_property_range(prop, 1, 10);
- RNA_def_property_ui_range(prop, 1, 10, 1, -1);
- RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
+ prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EffectorWeights");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Weights", "");
- prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
- RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
+ /* object collections */
- prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOW_HIGHRES);
- RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
- RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+ prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
+ RNA_def_property_struct_type(prop, "Collection");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Collision Collection", "Limit collisions to this collection");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependency");
- prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "noise");
- RNA_def_property_enum_items(prop, prop_noise_type_items);
- RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
-
- prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "alpha");
- RNA_def_property_range(prop, -5.0, 5.0);
- RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
- RNA_def_property_ui_text(prop, "Density",
- "How much density affects smoke motion (higher value results in faster rising smoke)");
- RNA_def_property_update(prop, NC_OBJECT |
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list