Skip to content

Commit 76f7c30

Browse files
committed
new demo version 0.7.3!
1 parent db3393c commit 76f7c30

12 files changed

+117
-38
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![image](https://github.com/rlguy/Blender-FLIP-Fluids/assets/4285191/53714857-6f04-45c8-8c97-694e37cfb6b9)
2+
13
Want to try the FLIP Fluids addon before buying the [full marketplace product](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon)? Try out the **FLIP Fluids Demo** addon! The FLIP Fluids demo can do almost everything that the full version can and will let you create, run, and render your own fluid simulations with a few small limitations. The demo version is always up-to-date with the latest features and fixes of the full version.
24

35
### Limitations
@@ -9,7 +11,7 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h
911

1012
### Getting Started
1113

12-
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.7.2_demo_(07_nov_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.2/FLIP_Fluids_addon_0.7.2_demo_.07_nov_2023.zip)
14+
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.7.3_demo_(24_nov_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.3/FLIP_Fluids_addon_0.7.3_demo_.24_nov_2023.zip)
1315

1416
After downloading the demo addon, follow our [Installation Instructions](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Addon-Installation-and-Uninstallation). The instructions are similar to installing any other Blender addon.
1517

cmake/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ set(CMAKE_BUILD_TYPE Release)
5353
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
5454
set(FLUIDENGINE_VERSION_MAJOR 0)
5555
set(FLUIDENGINE_VERSION_MINOR 7)
56-
set(FLUIDENGINE_VERSION_REVISION 2)
57-
set(FLUIDENGINE_VERSION_DATE "07-NOV-2023")
56+
set(FLUIDENGINE_VERSION_REVISION 3)
57+
set(FLUIDENGINE_VERSION_DATE "24-NOV-2023")
5858

5959
if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
6060
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")

src/addon/bake.py

+6
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,9 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
11001100
enable_fluid_particle_interior_output = __get_parameter_data(particles.enable_fluid_particle_interior_output, frameno)
11011101
fluidsim.enable_fluid_particle_interior_output = enable_fluid_particle_interior_output
11021102

1103+
source_id = __get_parameter_data(particles.fluid_particle_source_id_blacklist, frameno)
1104+
fluidsim.fluid_particle_source_id_blacklist = source_id
1105+
11031106
enable_velocity_attribute = __get_parameter_data(particles.enable_fluid_particle_velocity_vector_attribute, frameno)
11041107
fluidsim.enable_fluid_particle_velocity_attribute = enable_velocity_attribute
11051108

@@ -2046,6 +2049,9 @@ def __update_animatable_domain_properties(fluidsim, data, frameno):
20462049
enable_fluid_particle_interior_output = __get_parameter_data(particles.enable_fluid_particle_interior_output, frameno)
20472050
__set_property(fluidsim, 'enable_fluid_particle_interior_output', enable_fluid_particle_interior_output)
20482051

2052+
source_id = __get_parameter_data(particles.fluid_particle_source_id_blacklist, frameno)
2053+
__set_property(fluidsim, 'fluid_particle_source_id_blacklist', source_id)
2054+
20492055
# Surface Settings
20502056

20512057
surface = dprops.surface

src/addon/properties/domain_particles_properties.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ class DomainParticlesProperties(bpy.types.PropertyGroup):
6868
" to be interior particles if they are not classified as either surface or boundary particles",
6969
default=True,
7070
); exec(conv("enable_fluid_particle_interior_output"))
71+
fluid_particle_source_id_blacklist = IntProperty(
72+
name="Skip Source ID",
73+
description="If the Source ID attribute is enabled, do not export fluid particles with the specified"
74+
" Source ID value. Useful to reduce cache size and speed up playback in situations where particles"
75+
" are not needed from specific Fluid or Inflow objects",
76+
min=-1,
77+
default=-1,
78+
); exec(conv("fluid_particle_source_id_blacklist"))
7179
enable_fluid_particle_velocity_vector_attribute = BoolProperty(
7280
name="Generate Velocity Attributes",
7381
description="Generate fluid 3D velocity vector attributes for the fluid particles. After"
@@ -147,7 +155,7 @@ class DomainParticlesProperties(bpy.types.PropertyGroup):
147155
); exec(conv("enable_fluid_particle_source_id_attribute"))
148156

149157
fluid_particles_expanded = BoolProperty(default=True); exec(conv("fluid_particles_expanded"))
150-
fluid_particle_generation_expanded = BoolProperty(default=True); exec(conv("fluid_particle_generation_expanded"))
158+
fluid_particle_generation_expanded = BoolProperty(default=False); exec(conv("fluid_particle_generation_expanded"))
151159
fluid_particle_display_settings_expanded = BoolProperty(default=False); exec(conv("fluid_particle_display_settings_expanded"))
152160
geometry_attributes_expanded = BoolProperty(default=False); exec(conv("geometry_attributes_expanded"))
153161
velocity_attributes_expanded = BoolProperty(default=False); exec(conv("velocity_attributes_expanded"))
@@ -162,6 +170,7 @@ def register_preset_properties(self, registry, path):
162170
add(path + ".enable_fluid_particle_surface_output", "Export Surface Particles", group_id=0)
163171
add(path + ".enable_fluid_particle_boundary_output", "Export Boundary Particles", group_id=0)
164172
add(path + ".enable_fluid_particle_interior_output", "Export Interior Particles", group_id=0)
173+
add(path + ".fluid_particle_source_id_blacklist", "Skip Source ID", group_id=0)
165174
add(path + ".enable_fluid_particle_velocity_vector_attribute", "Velocity Attribute", group_id=0)
166175
add(path + ".enable_fluid_particle_speed_attribute", "Speed Attribute", group_id=0)
167176
add(path + ".enable_fluid_particle_vorticity_vector_attribute", "Vorticity Attribute", group_id=0)

src/addon/ui/domain_particles_ui.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ def draw(self, context):
238238
subcolumn.prop(pprops, "enable_fluid_particle_surface_output")
239239
subcolumn.prop(pprops, "enable_fluid_particle_boundary_output")
240240
subcolumn.prop(pprops, "enable_fluid_particle_interior_output")
241+
subcolumn.separator()
242+
subcolumn.prop(pprops, "fluid_particle_source_id_blacklist", text="Skip Particles With Source ID Value")
241243

242244
box = self.layout.box()
243245
row = box.row(align=True)
@@ -262,7 +264,6 @@ def draw(self, context):
262264

263265
box = self.layout.box()
264266
row = box.row(align=True)
265-
row.enabled = pprops.enable_fluid_particle_output
266267
row.prop(pprops, "fluid_particle_display_settings_expanded",
267268
icon="TRIA_DOWN" if pprops.fluid_particle_display_settings_expanded else "TRIA_RIGHT",
268269
icon_only=True,

src/addon/ui/fluid_ui.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def draw(self, context):
129129
box.label(text="Geometry Attributes:")
130130
column = box.column(align=True)
131131
if vcu.is_blender_293():
132-
is_color_attribute_enabled = (dprops.surface.enable_color_attribute or
133-
dprops.particles.enable_fluid_particle_color_attribute)
132+
is_color_attribute_enabled = dprops is not None and (dprops.surface.enable_color_attribute or
133+
dprops.particles.enable_fluid_particle_color_attribute)
134134
show_color = dprops is not None and is_color_attribute_enabled
135135
split = column.split(align=True)
136136
column_left = split.column(align=True)
@@ -162,8 +162,8 @@ def draw(self, context):
162162
row.label(text="Domain required for this option")
163163
column.separator()
164164

165-
is_lifetime_attribute_enabled = (dprops.surface.enable_lifetime_attribute or
166-
dprops.particles.enable_fluid_particle_lifetime_attribute)
165+
is_lifetime_attribute_enabled = dprops is not None and (dprops.surface.enable_lifetime_attribute or
166+
dprops.particles.enable_fluid_particle_lifetime_attribute)
167167
show_lifetime = dprops is not None and is_lifetime_attribute_enabled
168168
split = column.split(align=True)
169169
column_left = split.column(align=True)
@@ -182,8 +182,8 @@ def draw(self, context):
182182
row.label(text="Domain required for this option")
183183
column.separator()
184184

185-
is_source_id_attribute_enabled = (dprops.surface.enable_source_id_attribute or
186-
dprops.particles.enable_fluid_particle_source_id_attribute)
185+
is_source_id_attribute_enabled = dprops is not None and (dprops.surface.enable_source_id_attribute or
186+
dprops.particles.enable_fluid_particle_source_id_attribute)
187187
show_source_id = dprops is not None and is_source_id_attribute_enabled
188188
split = column.split(align=True)
189189
column_left = split.column(align=True)

src/addon/ui/inflow_ui.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def draw(self, context):
142142
box.label(text="Geometry Attributes:")
143143
column = box.column(align=True)
144144
if vcu.is_blender_293():
145-
is_color_attribute_enabled = (dprops.surface.enable_color_attribute or
146-
dprops.particles.enable_fluid_particle_color_attribute)
145+
is_color_attribute_enabled = dprops is not None and (dprops.surface.enable_color_attribute or
146+
dprops.particles.enable_fluid_particle_color_attribute)
147147
show_color = dprops is not None and is_color_attribute_enabled
148148
split = column.split(align=True)
149149
column_left = split.column(align=True)
@@ -175,8 +175,8 @@ def draw(self, context):
175175
row.label(text="Domain required for this option")
176176
column.separator()
177177

178-
is_lifetime_attribute_enabled = (dprops.surface.enable_lifetime_attribute or
179-
dprops.particles.enable_fluid_particle_lifetime_attribute)
178+
is_lifetime_attribute_enabled = dprops is not None and (dprops.surface.enable_lifetime_attribute or
179+
dprops.particles.enable_fluid_particle_lifetime_attribute)
180180
show_lifetime = dprops is not None and is_lifetime_attribute_enabled
181181
split = column.split(align=True)
182182
column_left = split.column(align=True)
@@ -195,8 +195,8 @@ def draw(self, context):
195195
row.label(text="Domain required for this option")
196196
column.separator()
197197

198-
is_source_id_attribute_enabled = (dprops.surface.enable_source_id_attribute or
199-
dprops.particles.enable_fluid_particle_source_id_attribute)
198+
is_source_id_attribute_enabled = dprops is not None and (dprops.surface.enable_source_id_attribute or
199+
dprops.particles.enable_fluid_particle_source_id_attribute)
200200
show_source_id = dprops is not None and is_source_id_attribute_enabled
201201
split = column.split(align=True)
202202
column_left = split.column(align=True)

src/engine/c_bindings/fluidsimulation_c.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,21 @@ extern "C" {
441441
);
442442
}
443443

444+
EXPORTDLL int FluidSimulation_get_fluid_particle_source_id_blacklist(FluidSimulation* obj,
445+
int *err) {
446+
return CBindings::safe_execute_method_ret_0param(
447+
obj, &FluidSimulation::getFluidParticleSourceIDBlacklist, err
448+
);
449+
}
450+
451+
EXPORTDLL void FluidSimulation_set_fluid_particle_source_id_blacklist(FluidSimulation* obj,
452+
int id,
453+
int *err) {
454+
CBindings::safe_execute_method_void_1param(
455+
obj, &FluidSimulation::setFluidParticleSourceIDBlacklist, id, err
456+
);
457+
}
458+
444459
EXPORTDLL int FluidSimulation_get_surface_subdivision_level(FluidSimulation* obj,
445460
int *err) {
446461
return CBindings::safe_execute_method_ret_0param(

src/engine/fluidsimulation.cpp

+40-12
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,16 @@ bool FluidSimulation::isFluidParticleInteriorOutputEnabled() {
405405
return _isFluidParticleInteriorOutputEnabled;
406406
}
407407

408+
int FluidSimulation::getFluidParticleSourceIDBlacklist() {
409+
return _fluidParticleSourceIDBlacklist;
410+
}
411+
412+
void FluidSimulation::setFluidParticleSourceIDBlacklist(int id) {
413+
_logfile.log(std::ostringstream().flush() <<
414+
_logfile.getTime() << " setFluidParticleSourceIDBlacklist: " << id << std::endl);
415+
_fluidParticleSourceIDBlacklist = id;
416+
}
417+
408418
int FluidSimulation::getSurfaceSubdivisionLevel() {
409419
return _outputFluidSurfaceSubdivisionLevel;
410420
}
@@ -10315,13 +10325,6 @@ void FluidSimulation::_calculateFluidCurvatureGridThread() {
1031510325
}
1031610326

1031710327
void FluidSimulation::_launchCalculateFluidCurvatureGridThread() {
10318-
if (!_isSurfaceTensionEnabled &&
10319-
!_isSheetSeedingEnabled &&
10320-
!_isDiffuseMaterialOutputEnabled &&
10321-
!_isFluidParticleOutputEnabled) {
10322-
return;
10323-
}
10324-
1032510328
_fluidCurvatureThread = std::thread(&FluidSimulation::_calculateFluidCurvatureGridThread,
1032610329
this);
1032710330
_isCalculateFluidCurvatureGridThreadRunning = true;
@@ -13975,11 +13978,18 @@ void FluidSimulation::_generateFluidParticleDataFFP3(ParticleSystem &fluidPartic
1397513978
bool isSurfaceEnabled = _isFluidParticleSurfaceOutputEnabled;
1397613979
bool isBoundaryEnabled = _isFluidParticleBoundaryOutputEnabled;
1397713980
bool isInteriorEnabled = _isFluidParticleInteriorOutputEnabled;
13981+
bool isSourceIDEnabled = _isFluidParticleSourceIDAttributeEnabled;
13982+
int skipSourceID = _fluidParticleSourceIDBlacklist;
1397813983

1397913984
std::vector<uint16_t> *particle_ids;
1398013985
_markerParticles.getAttributeValues("ID", particle_ids);
1398113986
int idLimit = (int)std::round(_fluidParticleIDLimit * _fluidParticleOutputAmount);
1398213987

13988+
std::vector<int> *source_ids = NULL;
13989+
if (isSourceIDEnabled) {
13990+
_markerParticles.getAttributeValues("SOURCEID", source_ids);
13991+
}
13992+
1398313993
int numsurface = 0;
1398413994
int numboundary = 0;
1398513995
int numinterior = 0;
@@ -13990,6 +14000,12 @@ void FluidSimulation::_generateFluidParticleDataFFP3(ParticleSystem &fluidPartic
1399014000
continue;
1399114001
}
1399214002

14003+
if (isSourceIDEnabled && skipSourceID >= 0) {
14004+
if (source_ids->at(i) == skipSourceID) {
14005+
continue;
14006+
}
14007+
}
14008+
1399314009
if (isSurfaceEnabled && ptype == MarkerParticleType::surface) {
1399414010
numsurface++;
1399514011
} else if (isBoundaryEnabled && ptype == MarkerParticleType::boundary) {
@@ -14012,6 +14028,12 @@ void FluidSimulation::_generateFluidParticleDataFFP3(ParticleSystem &fluidPartic
1401214028
continue;
1401314029
}
1401414030

14031+
if (isSourceIDEnabled && skipSourceID >= 0) {
14032+
if (source_ids->at(i) == skipSourceID) {
14033+
continue;
14034+
}
14035+
}
14036+
1401514037
if (isSurfaceEnabled && ptype == MarkerParticleType::surface) {
1401614038
idCountsSurface[pid]++;
1401714039
} else if (isBoundaryEnabled && ptype == MarkerParticleType::boundary) {
@@ -14044,6 +14066,12 @@ void FluidSimulation::_generateFluidParticleDataFFP3(ParticleSystem &fluidPartic
1404414066
continue;
1404514067
}
1404614068

14069+
if (isSourceIDEnabled && skipSourceID >= 0) {
14070+
if (source_ids->at(i) == skipSourceID) {
14071+
continue;
14072+
}
14073+
}
14074+
1404714075
if (isSurfaceEnabled && ptype == MarkerParticleType::surface) {
1404814076
dataFFP3.sortedFluidParticleIndexTable[i] = indexOffsetSurface + idBinStartIndexSurface[pid];
1404914077
idBinStartIndexSurface[pid]++;
@@ -14432,7 +14460,11 @@ void FluidSimulation::_stepFluid(double dt) {
1443214460
_joinUpdateLiquidLevelSetThread();
1443314461
_launchAdvectVelocityFieldThread();
1443414462
_joinAdvectVelocityFieldThread();
14435-
_launchCalculateFluidCurvatureGridThread();
14463+
14464+
if (_isSurfaceTensionEnabled or _isSheetSeedingEnabled or _isDiffuseMaterialOutputEnabled) {
14465+
_launchCalculateFluidCurvatureGridThread();
14466+
}
14467+
1443614468
_saveVelocityField();
1443714469
_applyBodyForcesToVelocityField(dt);
1443814470
_applyViscosityToVelocityField(dt);
@@ -14454,10 +14486,6 @@ void FluidSimulation::_stepFluid(double dt) {
1445414486
_joinCalculateFluidCurvatureGridThread();
1445514487
}
1445614488

14457-
if (_isFluidParticleOutputEnabled) {
14458-
_joinCalculateFluidCurvatureGridThread();
14459-
}
14460-
1446114489
_updateSheetSeeding();
1446214490
_updateMarkerParticleVelocities();
1446314491
_deleteSavedVelocityField();

src/engine/fluidsimulation.h

+4
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ class FluidSimulation
362362
void disableFluidParticleInteriorOutput();
363363
bool isFluidParticleInteriorOutputEnabled();
364364

365+
int getFluidParticleSourceIDBlacklist();
366+
void setFluidParticleSourceIDBlacklist(int id);
367+
365368
/*
366369
The surface subdivision level determines how many times the
367370
simulation grid is divided when converting marker particles
@@ -2162,6 +2165,7 @@ class FluidSimulation
21622165
double _fluidParticleOutputAmount = 1.0;
21632166
bool _isFluidParticleBoundaryOutputEnabled = true;
21642167
bool _isFluidParticleInteriorOutputEnabled = true;
2168+
int _fluidParticleSourceIDBlacklist = true;
21652169

21662170
bool _isFluidParticleVelocityAttributeEnabled = false;
21672171
bool _isFluidParticleSpeedAttributeEnabled = false;

0 commit comments

Comments
 (0)