Skip to content

Commit 6100c56

Browse files
committed
new demo version 0.6.0!
1 parent 46c216d commit 6100c56

39 files changed

+7288
-212
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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 small limitation.
1+
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.
22

33
### Limitations
44

@@ -8,7 +8,7 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h
88

99
### Getting Started
1010

11-
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.5.0_demo_(07_sep_2022.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.5.0/FLIP_Fluids_addon_0.5.0_demo_.07_sep_2022.zip)
11+
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.6.0_demo_(24_nov_2022.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.0/FLIP_Fluids_addon_0.6.0_demo_.24_nov_2022.zip)
1212

1313
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.
1414

cmake/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ set(CMAKE_BUILD_TYPE Release)
5252

5353
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
5454
set(FLUIDENGINE_VERSION_MAJOR 0)
55-
set(FLUIDENGINE_VERSION_MINOR 5)
55+
set(FLUIDENGINE_VERSION_MINOR 6)
5656
set(FLUIDENGINE_VERSION_REVISION 0)
57-
set(FLUIDENGINE_VERSION_DATE "07-SEP-2022")
57+
set(FLUIDENGINE_VERSION_DATE "24-NOV-2022")
5858

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

src/addon/bake.py

+36-3
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,6 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
10031003
surface_tension_number = mincfl + (1.0 - accuracy_pct) * (maxcfl - mincfl)
10041004
fluidsim.surface_tension_condition_number = surface_tension_number
10051005

1006-
st_solver_mode = __get_parameter_data(world.surface_tension_solver_method, frameno)
1007-
fluidsim.enable_smooth_surface_tension_kernel = st_solver_mode == 'SURFACE_TENSION_SOLVER_METHOD_SMOOTH'
1008-
10091006
is_sheet_seeding_enabled = __get_parameter_data(world.enable_sheet_seeding, frameno)
10101007
if is_sheet_seeding_enabled:
10111008
fluidsim.enable_sheet_seeding = is_sheet_seeding_enabled
@@ -1574,6 +1571,38 @@ def __update_animatable_obstacle_properties(data, frameid):
15741571
obstacle_objects = data.obstacle_objects
15751572
obstacle_data = data.obstacle_data
15761573

1574+
#### WORKAROUND ####
1575+
1576+
# Due to a current design issue in the simulator, if there is a mix of
1577+
# static and dynamic inverse obstacles in the simulation, then the combined
1578+
# inverse SDF will not be computed correctly. A workaround in previous
1579+
# versions of the addon was to enable "Export Animation Mesh" on all inverse
1580+
# obstacles so that there was not a mix and the SDF would be computed correctly.
1581+
#
1582+
# This section automatically applies this workaround by detecting if there
1583+
# are any dynamic inverse obstacles, and if so, treating all static inverse
1584+
# obstacles as dynamic ones. This is done by using the update_mesh_animated()
1585+
# method and supplying the static mesh for all frame_previous, frame_current, and
1586+
# frame_next.
1587+
#
1588+
# In future development, or in the next iteration of the simulator, this should
1589+
# be fixed properly inside of the simulation engine.
1590+
1591+
is_inverse_dynamic = False
1592+
for idx, mesh_object in enumerate(obstacle_objects):
1593+
data = obstacle_data[idx]
1594+
if mesh_object.inverse:
1595+
is_inverse_dynamic = is_inverse_dynamic or __is_object_dynamic(data.name)
1596+
1597+
if is_inverse_dynamic:
1598+
for idx, mesh_object in enumerate(obstacle_objects):
1599+
data = obstacle_data[idx]
1600+
if mesh_object.inverse and not __is_object_dynamic(data.name):
1601+
mesh = __extract_static_frame_mesh(data.name)
1602+
mesh_object.update_mesh_animated(mesh, mesh, mesh)
1603+
1604+
#### END WORKAROUND ####
1605+
15771606
for idx, mesh_object in enumerate(obstacle_objects):
15781607
data = obstacle_data[idx]
15791608

@@ -1797,6 +1826,10 @@ def __update_animatable_domain_properties(fluidsim, data, frameno):
17971826

17981827
world = dprops.world
17991828
gravity = __get_parameter_data(world.gravity, frameno)
1829+
if __get_parameter_data(world.gravity_type, frameno) == 'GRAVITY_TYPE_SCENE':
1830+
use_gravity = bool(__get_parameter_data(world.scene_use_gravity, frameno))
1831+
if not use_gravity:
1832+
gravity = [0.0, 0.0, 0.0]
18001833
__set_body_force_property(fluidsim, gravity)
18011834

18021835
is_viscosity_enabled = __get_parameter_data(world.enable_viscosity, frameno)

src/addon/export.py

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def __get_domain_data_dict(context, dobj):
135135
d['advanced']['num_threads_auto_detect'] = dprops.advanced.num_threads_auto_detect
136136
d['simulation']['frames_per_second'] = dprops.simulation.get_frame_rate_data_dict()
137137
d['world']['gravity'] = dprops.world.get_gravity_data_dict()
138+
d['world']['scene_use_gravity'] = dprops.world.get_scene_use_gravity_data_dict()
138139
d['world']['native_surface_tension_scale'] = dprops.world.native_surface_tension_scale
139140
d['world']['minimum_surface_tension_cfl'] = dprops.world.minimum_surface_tension_cfl
140141
d['world']['maximum_surface_tension_cfl'] = dprops.world.maximum_surface_tension_cfl

src/addon/filesystem/filesystem_protection_layer.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,41 @@
1616

1717
import bpy, os, pathlib
1818

19+
from ..utils import installation_utils
20+
1921

2022
__EXTENSION_WHITELIST = [
2123
".backup",
2224
".bat",
2325
".bbox",
2426
".bin",
27+
".blend",
2528
".bobj",
2629
".cpp",
2730
".data",
2831
".ffd",
2932
".fpd",
3033
".h",
3134
".info",
35+
".json",
3236
".md",
3337
".png",
3438
".preset",
3539
".sim",
3640
".sqlite3",
3741
".state",
3842
".txt",
43+
".txt~",
3944
".wwi",
4045
".wwf",
4146
".wwp"
4247
]
4348

49+
# These extensions are not allowed to be mass-deleted within a directory
50+
__DELETE_DIRECTORY_EXTENSION_BLACKLIST = [
51+
".blend"
52+
]
53+
4454

4555
class FilesystemProtectionError(Exception):
4656
def __init__(self, value):
@@ -54,6 +64,11 @@ def get_extension_whitelist():
5464
return __EXTENSION_WHITELIST
5565

5666

67+
def get_delete_directory_extension_blacklist():
68+
global __DELETE_DIRECTORY_EXTENSION_BLACKLIST
69+
return __DELETE_DIRECTORY_EXTENSION_BLACKLIST
70+
71+
5772
def get_directory_whitelist():
5873
whitelist = []
5974
dprops = bpy.context.scene.flip_fluid.get_domain_properties()
@@ -64,6 +79,10 @@ def get_directory_whitelist():
6479
addon_filepath = os.path.dirname(os.path.dirname(this_filepath))
6580
whitelist.append(addon_filepath)
6681

82+
preset_library_installations = installation_utils.get_preset_library_installations()
83+
for install in preset_library_installations:
84+
whitelist.append(install["path"])
85+
6786
return whitelist
6887

6988

@@ -110,6 +129,14 @@ def check_directory_valid(base_directory):
110129

111130

112131
def delete_files_in_directory(base_directory, extensions, remove_directory=False):
132+
extension_blacklist = get_delete_directory_extension_blacklist()
133+
for ext in extension_blacklist:
134+
if ext in extensions:
135+
error_msg = "Extension in directory deletion blacklist: "
136+
error_msg += "<" + ext + "> "
137+
error_msg += "***Please contact the developers with this error message***"
138+
raise FilesystemProtectionError(error_msg)
139+
113140
check_extensions_valid(extensions)
114141
check_directory_valid(base_directory)
115142

@@ -142,7 +169,7 @@ def delete_files_in_directory(base_directory, extensions, remove_directory=False
142169

143170
if remove_error_count > 0:
144171
errmsg = "Error encountered attempting to remove " + str(remove_error_count) + " file(s). Reason: <" + first_error + ">. "
145-
errmsg += "Try closing all applications accessing the cache directory, restarting Blender/System, or deleting cache directory manually."
172+
errmsg += "Try closing all applications accessing the directory, restarting Blender/System, or deleting directory manually."
146173
bpy.ops.flip_fluid_operators.display_error(
147174
'INVOKE_DEFAULT',
148175
error_message="Error Removing Files",
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/addon/operators/__init__.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
'draw_grid_operators',
3131
'draw_particles_operators',
3232
'draw_force_field_operators',
33-
'helper_operators'
33+
'helper_operators',
34+
'support_operators'
3435
]
3536
for module_name in reloadable_modules:
3637
if module_name in locals():
@@ -52,7 +53,8 @@
5253
draw_grid_operators,
5354
draw_particles_operators,
5455
draw_force_field_operators,
55-
helper_operators
56+
helper_operators,
57+
support_operators
5658
)
5759

5860

@@ -71,6 +73,7 @@ def register():
7173
draw_particles_operators.register()
7274
draw_force_field_operators.register()
7375
helper_operators.register()
76+
support_operators.register()
7477

7578

7679
def unregister():
@@ -87,4 +90,4 @@ def unregister():
8790
draw_grid_operators.unregister()
8891
draw_particles_operators.unregister()
8992
draw_force_field_operators.unregister()
90-
helper_operators.unregister()
93+
support_operators.unregister()

src/addon/operators/bake_operators.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,16 @@ def update_stats(context=None):
7474
return
7575

7676
temp_dir = os.path.join(cache_dir, "temp")
77-
match_str = "framestats" + "[0-9]"*6 + ".data"
78-
stat_files = glob.glob(os.path.join(temp_dir, match_str))
77+
if not os.path.isdir(temp_dir):
78+
return
79+
80+
stat_prefix = "framestats"
81+
stat_extension = ".data"
82+
stat_files = [f for f in os.listdir(temp_dir) if os.path.isfile(os.path.join(temp_dir, f))]
83+
stat_files = [f for f in stat_files if f.endswith(stat_extension)]
84+
stat_files = [f for f in stat_files if (f[len(stat_prefix):-len(stat_extension)]).isdigit()]
85+
stat_files = [os.path.join(temp_dir, f) for f in stat_files if f.endswith(stat_extension)]
86+
7987
if not stat_files:
8088
return
8189

@@ -84,7 +92,7 @@ def update_stats(context=None):
8492

8593
for statpath in stat_files:
8694
filename = os.path.basename(statpath)
87-
frameno = int(filename[len("framestats"):-len(".data")])
95+
frameno = int(filename[len(stat_prefix):-len(stat_extension)])
8896
with open(statpath, 'r', encoding='utf-8') as frame_stats:
8997
try:
9098
frame_stats_dict = json.loads(frame_stats.read())
@@ -295,7 +303,7 @@ def execute(self, context):
295303

296304
if context.scene.flip_fluid.get_num_domain_objects() > 1:
297305
self.report({"ERROR_INVALID_INPUT"},
298-
"There must be only one domain object")
306+
"There must be only one domain object in the Blend file")
299307
self.cancel(context)
300308
return {'CANCELLED'}
301309

src/addon/operators/draw_grid_operators.py

+4
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ def poll(cls, context):
165165

166166

167167
def draw_callback_2d(self, context):
168+
draw_text = False
169+
if not draw_text:
170+
return
171+
168172
if render.is_rendering():
169173
# This method does not need to be run while rendering. Can cause
170174
# crashes on certain systems.

0 commit comments

Comments
 (0)