Skip to content

Commit 9403e6c

Browse files
committed
new demo version 0.7.4!
1 parent 76f7c30 commit 9403e6c

File tree

263 files changed

+1231
-612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+1231
-612
lines changed

LICENSE_MIT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2023 Ryan L. Guy
1+
Copyright (C) 2024 Ryan L. Guy
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h
1111

1212
### Getting Started
1313

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)
14+
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.7.4_demo_(22_jan_2024.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.4/FLIP_Fluids_addon_0.7.4_demo_.22_jan_2024.zip)
1515

1616
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.
1717

__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22
#
3-
# Copyright (C) 2023 Ryan L. Guy
3+
# Copyright (C) 2024 Ryan L. Guy
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal

cmake/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[[
2-
Copyright (C) 2023 Ryan L. Guy
2+
Copyright (C) 2024 Ryan L. Guy
33
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
@@ -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 3)
57-
set(FLUIDENGINE_VERSION_DATE "24-NOV-2023")
56+
set(FLUIDENGINE_VERSION_REVISION 4)
57+
set(FLUIDENGINE_VERSION_DATE "22-JAN-2024")
5858

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

src/addon/__init__.py.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/bake.py

+37-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -758,7 +758,11 @@ def __delete_outdated_savestates(cache_directory, savestate_id):
758758
if savestate_number > savestate_id:
759759
path = os.path.join(savestate_directory, d)
760760
try:
761-
fpl.delete_files_in_directory(path, extensions, remove_directory=True)
761+
fpl.delete_files_in_directory(
762+
path, extensions,
763+
remove_directory=True,
764+
display_popup_on_error=False
765+
)
762766
except:
763767
print("Error: unable to delete directory <" + path + "> (skipping)")
764768

@@ -828,15 +832,27 @@ def __load_save_state_data(fluidsim, data, cache_directory, savestate_id):
828832
backup_autosave_directory = current_autosave_directory + ".backup"
829833
if os.path.isdir(backup_autosave_directory):
830834
# Backup autosave directory may already exist from a previous bake, remove if so
831-
fpl.delete_files_in_directory(backup_autosave_directory, [".state", ".data"], remove_directory=True)
835+
fpl.delete_files_in_directory(
836+
backup_autosave_directory, [".state", ".data"],
837+
remove_directory=True,
838+
display_popup_on_error=False
839+
)
832840
os.rename(current_autosave_directory, backup_autosave_directory)
833841
try:
834842
old_directory = autosave_directory
835843
new_directory = os.path.join(savestate_directory, "autosave")
836844
shutil.copytree(old_directory, new_directory, dirs_exist_ok=True)
837-
fpl.delete_files_in_directory(backup_autosave_directory, [".state", ".data"], remove_directory=True)
845+
fpl.delete_files_in_directory(
846+
backup_autosave_directory, [".state", ".data"],
847+
remove_directory=True,
848+
display_popup_on_error=False
849+
)
838850
except Exception as e:
839-
os.rename(backup_autosave_directory, current_autosave_directory)
851+
try:
852+
os.rename(backup_autosave_directory, current_autosave_directory)
853+
except FileNotFoundError:
854+
pass
855+
raise
840856

841857
if init_data.delete_outdated_meshes:
842858
__delete_outdated_meshes(cache_directory, autosave_info["frame"])
@@ -2884,7 +2900,7 @@ def __write_autosave_data(domain_data, cache_directory, fluidsim, frameno):
28842900
)
28852901
for filepath in data_filepaths:
28862902
if os.path.isfile(filepath):
2887-
fpl.delete_file(filepath)
2903+
fpl.delete_file(filepath, display_popup_on_error=False)
28882904
except Exception as e:
28892905
print("FLIP Fluids: OS/Filesystem Error: Unable to delete older autosave files from storage")
28902906
print("Error Message: ", e)
@@ -2931,10 +2947,23 @@ def __write_autosave_data(domain_data, cache_directory, fluidsim, frameno):
29312947
numstr = str(frameno).zfill(6)
29322948
savestate_dir = os.path.join(cache_directory, "savestates", "autosave" + numstr)
29332949
if os.path.isdir(savestate_dir):
2934-
fpl.delete_files_in_directory(savestate_dir, [".state", ".data"], remove_directory=True)
2950+
fpl.delete_files_in_directory(
2951+
savestate_dir, [".state", ".data"],
2952+
remove_directory=True,
2953+
display_popup_on_error=False
2954+
)
29352955
shutil.copytree(autosave_dir, savestate_dir, dirs_exist_ok=True)
29362956

29372957

2958+
def __write_finished_file(cache_directory, frameno):
2959+
fstring = __frame_number_to_string(frameno)
2960+
finished_filename = "finished" + fstring + ".txt"
2961+
finished_filepath = os.path.join(cache_directory, "bakefiles", finished_filename)
2962+
filestring = fstring
2963+
with open(finished_filepath, 'w') as f:
2964+
f.write(filestring)
2965+
2966+
29382967
def __write_simulation_output(domain_data, fluidsim, frameno, cache_directory):
29392968
__write_bounds_data(cache_directory, fluidsim, frameno)
29402969

@@ -2959,6 +2988,7 @@ def __write_simulation_output(domain_data, fluidsim, frameno, cache_directory):
29592988
__write_logfile_data(cache_directory, domain_data.initialize.logfile_name, fluidsim)
29602989
__write_frame_stats_data(cache_directory, fluidsim, frameno)
29612990
__write_autosave_data(domain_data, cache_directory, fluidsim, frameno)
2991+
__write_finished_file(cache_directory, frameno)
29622992

29632993

29642994
def __get_current_frame_delta_time(domain_data, frameno):

src/addon/exit_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/export.py

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -411,9 +411,14 @@ def __generate_meshing_volume_export_object(bl_meshing_object, bl_domain_object)
411411
def add_objects_to_geometry_exporter(geometry_exporter):
412412
domain = bpy.context.scene.flip_fluid.get_domain_object()
413413
dprops = bpy.context.scene.flip_fluid.get_domain_properties()
414-
objects = bpy.context.scene.flip_fluid.get_simulation_objects()
414+
415+
# Objects disabled in the viewport shouldn't be exported for the simulation, so skip these
416+
objects = bpy.context.scene.flip_fluid.get_simulation_objects(skip_hide_viewport=True)
415417
disable_topology_warning = dprops.advanced.disable_changing_topology_warning
416418

419+
for obj in objects:
420+
print(obj)
421+
417422
# Add regular FLIP Fluid objects
418423
for obj in objects:
419424
props = obj.flip_fluid.get_property_group()
@@ -472,11 +477,13 @@ def export_simulation_data(context, data_filepath):
472477

473478
simulation_objects = flip_fluid_map.Map({})
474479
simulation_objects.domain = domain_object
475-
simulation_objects.fluid_objects = simprops.get_fluid_objects()
476-
simulation_objects.obstacle_objects = simprops.get_obstacle_objects()
477-
simulation_objects.inflow_objects = simprops.get_inflow_objects()
478-
simulation_objects.outflow_objects = simprops.get_outflow_objects()
479-
simulation_objects.force_field_objects = simprops.get_force_field_objects()
480+
481+
# Objects disabled in the viewport shouldn't be exported for the simulation, so skip these
482+
simulation_objects.fluid_objects = simprops.get_fluid_objects(skip_hide_viewport=True)
483+
simulation_objects.obstacle_objects = simprops.get_obstacle_objects(skip_hide_viewport=True)
484+
simulation_objects.inflow_objects = simprops.get_inflow_objects(skip_hide_viewport=True)
485+
simulation_objects.outflow_objects = simprops.get_outflow_objects(skip_hide_viewport=True)
486+
simulation_objects.force_field_objects = simprops.get_force_field_objects(skip_hide_viewport=True)
480487

481488
success = __export_simulation_data_to_file(context, simulation_objects, data_filepath)
482489

src/addon/filesystem/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/filesystem/filesystem_protection_layer.py

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -129,7 +129,7 @@ def check_directory_valid(base_directory):
129129
raise FilesystemProtectionError(error_msg)
130130

131131

132-
def delete_files_in_directory(base_directory, extensions, remove_directory=False):
132+
def delete_files_in_directory(base_directory, extensions, remove_directory=False, display_popup_on_error=True):
133133
extension_blacklist = get_delete_directory_extension_blacklist()
134134
for ext in extension_blacklist:
135135
if ext in extensions:
@@ -169,17 +169,23 @@ def delete_files_in_directory(base_directory, extensions, remove_directory=False
169169
first_error = str(e)
170170

171171
if remove_error_count > 0:
172-
errmsg = "Error encountered attempting to remove " + str(remove_error_count) + " file(s). Reason: <" + first_error + ">. "
172+
errmsg = "Error encountered attempting to remove " + str(remove_error_count) + " file(s) in <" + base_directory + ">. Reason: <" + first_error + ">. "
173173
errmsg += "Try closing all applications accessing the directory, restarting Blender/System, or deleting directory manually."
174-
bpy.ops.flip_fluid_operators.display_error(
175-
'INVOKE_DEFAULT',
176-
error_message="Error Removing Files",
177-
error_description=errmsg,
178-
popup_width=700
179-
)
174+
if display_popup_on_error:
175+
# Method may be run from bake.py script where there is not window from this context
176+
# in this case, 'display_popup_on_error' should be set so this operator does not run.
177+
bpy.ops.flip_fluid_operators.display_error(
178+
'INVOKE_DEFAULT',
179+
error_message="Error Removing Files",
180+
error_description=errmsg,
181+
popup_width=700
182+
)
183+
else:
184+
print(errmsg)
185+
raise PermissionError(errmsg)
180186

181187

182-
def delete_file(filepath, error_ok=False):
188+
def delete_file(filepath, error_ok=False, display_popup_on_error=True):
183189
if not os.path.isfile(filepath):
184190
return
185191

@@ -194,20 +200,26 @@ def delete_file(filepath, error_ok=False):
194200
pass
195201
else:
196202
errmsg = "Error encountered attempting to remove file. Reason: <" + str(e) + ">."
197-
bpy.ops.flip_fluid_operators.display_error(
198-
'INVOKE_DEFAULT',
199-
error_message="Error Removing Files",
200-
error_description=errmsg,
201-
popup_width=700
202-
)
203+
if display_popup_on_error:
204+
# Method may be run from bake.py script where there is not window from this context
205+
# in this case, 'display_popup_on_error' should be set so this operator does not run.
206+
bpy.ops.flip_fluid_operators.display_error(
207+
'INVOKE_DEFAULT',
208+
error_message="Error Removing Files",
209+
error_description=errmsg,
210+
popup_width=700
211+
)
212+
else:
213+
print(errmsg)
214+
raise PermissionError(errmsg)
203215

204216

205217
def clear_cache_directory(cache_directory, clear_export=False, clear_logs=False, remove_directory=False):
206218
stats_filepath = os.path.join(cache_directory, "flipstats.data")
207219
delete_file(stats_filepath)
208220

209221
bakefiles_dir = os.path.join(cache_directory, "bakefiles")
210-
extensions = [".bbox", ".bobj", ".data", ".wwp", ".wwf", ".wwi", ".fpd", ".ffd", ".ffp3"]
222+
extensions = [".bbox", ".bobj", ".data", ".wwp", ".wwf", ".wwi", ".fpd", ".ffd", ".ffp3", ".txt"]
211223
delete_files_in_directory(bakefiles_dir, extensions, remove_directory=True)
212224

213225
temp_dir = os.path.join(cache_directory, "temp")

src/addon/materials/LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ and subdirectories are licensed under the MIT License:
55

66
MIT License
77

8-
Copyright (C) 2023 Ryan L. Guy
8+
Copyright (C) 2024 Ryan L. Guy
99

1010
Permission is hereby granted, free of charge, to any person obtaining a copy
1111
of this software and associated documentation files (the "Software"), to deal

src/addon/materials/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/materials/material_library.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_aabb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_cache.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_geometry_database.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_geometry_export_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_geometry_exporter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_map.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_material_library.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/objects/flip_fluid_preset_stack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/operators/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/operators/bake_operators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/operators/cache_operators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

src/addon/operators/draw_force_field_operators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Blender FLIP Fluids Add-on
2-
# Copyright (C) 2023 Ryan L. Guy
2+
# Copyright (C) 2024 Ryan L. Guy
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)