Skip to content

Commit f353224

Browse files
committed
new demo version 0.6.4!
1 parent 9b4f628 commit f353224

38 files changed

+784
-215
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ src/engine/versionutils.cpp
33
src/addon/__init__.py
44
src/addon/utils/installation_utils.py
55
CMakeLists.txt
6-
build
6+
build
7+
.DS_Store

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -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.6.3_demo_(20_apr_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.3/FLIP_Fluids_addon_0.6.3_demo_.20_apr_2023.zip)
11+
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.6.4_demo_(23_may_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.3/FLIP_Fluids_addon_0.6.4_demo_.23_may_2023.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

+5-6
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 6)
56-
set(FLUIDENGINE_VERSION_REVISION 3)
57-
set(FLUIDENGINE_VERSION_DATE "20-APR-2023")
56+
set(FLUIDENGINE_VERSION_REVISION 4)
57+
set(FLUIDENGINE_VERSION_DATE "23-MAY-2023")
5858

5959
if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
6060
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
@@ -65,10 +65,9 @@ else()
6565
endif()
6666

6767
set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_MAJOR}.${FLUIDENGINE_VERSION_MINOR}.${FLUIDENGINE_VERSION_REVISION} ${FLUIDENGINE_VERSION_TYPE_LABEL} ${FLUIDENGINE_VERSION_DATE}")
68-
69-
if(BUILD_DEBUG)
70-
set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_LABEL} (DEBUG BUILD)")
71-
endif()
68+
#if(BUILD_DEBUG)
69+
# set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_LABEL} (DEBUG BUILD)")
70+
#endif()
7271

7372
message(STATUS "FLIP Fluids version ${FLUIDENGINE_VERSION_LABEL}")
7473
if(BUILD_DEBUG)

src/addon/bake.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ def __delete_outdated_savestates(cache_directory, savestate_id):
722722
if savestate_number > savestate_id:
723723
path = os.path.join(savestate_directory, d)
724724
try:
725-
print("Delete savestate", path)
726725
fpl.delete_files_in_directory(path, extensions, remove_directory=True)
727726
except:
728727
print("Error: unable to delete directory <" + path + "> (skipping)")
@@ -2371,6 +2370,7 @@ def __get_frame_stats_dict(cstats):
23712370
stats["fluid_particles"] = cstats.fluid_particles
23722371
stats["diffuse_particles"] = cstats.diffuse_particles
23732372
stats["substeps"] = cstats.substeps
2373+
stats["performance_score"] = cstats.performance_score
23742374
stats["pressure_solver_enabled"] = cstats.pressure_solver_enabled
23752375
stats["pressure_solver_success"] = cstats.pressure_solver_success
23762376
stats["pressure_solver_error"] = cstats.pressure_solver_error
@@ -2664,7 +2664,7 @@ def __write_autosave_data(domain_data, cache_directory, fluidsim, frameno):
26642664
savestate_dir = os.path.join(cache_directory, "savestates", "autosave" + numstr)
26652665
if os.path.isdir(savestate_dir):
26662666
fpl.delete_files_in_directory(savestate_dir, [".state", ".data"], remove_directory=True)
2667-
shutil.copytree(autosave_dir, savestate_dir)
2667+
shutil.copytree(autosave_dir, savestate_dir, dirs_exist_ok=True)
26682668

26692669

26702670
def __write_simulation_output(domain_data, fluidsim, frameno, cache_directory):

src/addon/filesystem/filesystem_protection_layer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def clear_cache_directory(cache_directory, clear_export=False, clear_logs=False,
219219

220220
savestates_dir = os.path.join(cache_directory, "savestates")
221221
if os.path.isdir(savestates_dir):
222-
extensions = [".data", ".state"]
222+
extensions = [".data", ".state", ".backup"]
223223
savestate_subdirs = [d for d in os.listdir(savestates_dir) if os.path.isdir(os.path.join(savestates_dir, d))]
224224
for subd in savestate_subdirs:
225225
if subd.startswith("autosave"):

src/addon/objects/flip_fluid_cache.py

+9
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def initialize_cache_object(self):
219219
def delete_cache_object(self):
220220
if self.cache_object is None:
221221
return
222+
if not bpy.context.scene.flip_fluid.is_domain_in_active_scene():
223+
return
222224
self.unload_duplivert_object()
223225
cache_object = self.cache_object
224226
vcu.delete_object(cache_object)
@@ -850,6 +852,8 @@ def unload_duplivert_object(self):
850852

851853

852854
def get_cache_object(self):
855+
if not bpy.context.scene.flip_fluid.is_domain_in_active_scene():
856+
return None
853857
if self.cache_object is None:
854858
return None
855859

@@ -1731,6 +1735,8 @@ def initialize_cache_objects(self):
17311735
self.initialize_cache_settings()
17321736
if not self._is_domain_set():
17331737
return
1738+
if not bpy.context.scene.flip_fluid.is_domain_in_active_scene():
1739+
return
17341740

17351741
self.surface.initialize_cache_object()
17361742

@@ -1785,6 +1791,9 @@ def reset_cache_objects(self):
17851791
self.initialize_cache_settings()
17861792
if not self._is_domain_set():
17871793
return
1794+
if not bpy.context.scene.flip_fluid.is_domain_in_active_scene():
1795+
return
1796+
17881797
self.surface.reset_cache_object()
17891798
self.foam.reset_cache_object()
17901799
self.bubble.reset_cache_object()

src/addon/operators/bake_operators.py

+12
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,12 @@ def execute(self, context):
307307
self.cancel(context)
308308
return {'CANCELLED'}
309309

310+
if not context.scene.flip_fluid.is_domain_in_active_scene():
311+
self.report({"ERROR"},
312+
"Active scene must contain domain object to begin baking. Select the scene that contains the domain object and try again.")
313+
self.cancel(context)
314+
return {'CANCELLED'}
315+
310316
dprops = self._get_domain_properties()
311317
if dprops.bake.is_simulation_running:
312318
self.cancel(context)
@@ -525,6 +531,12 @@ def execute(self, context):
525531
self.cancel(context)
526532
return {'CANCELLED'}
527533

534+
if not context.scene.flip_fluid.is_domain_in_active_scene():
535+
self.report({"ERROR"},
536+
"Active scene must contain domain object to begin baking. Select the scene that contains the domain object, save, and try again.")
537+
self.cancel(context)
538+
return {'CANCELLED'}
539+
528540
self._reset_bake(context)
529541
self._initialize_domain(context)
530542
success = self._export_simulation_data(context)

src/addon/operators/cache_operators.py

+104-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def execute(self, context):
411411

412412

413413
class FlipFluidIncreaseDecreaseCacheDirectory(bpy.types.Operator):
414-
bl_idname = "flip_fluid_operators.increment_decrease_cache_directory"
414+
bl_idname = "flip_fluid_operators.increase_decrease_cache_directory"
415415
bl_label = "Increase/Decrease Cache Directory"
416416
bl_description = ("Increase or decrease a numbered suffix on the cache directory." +
417417
" Note: this will not rename an existing cache directory")
@@ -468,6 +468,105 @@ def execute(self, context):
468468
return {'FINISHED'}
469469

470470

471+
class FlipFluidIncreaseDecreaseRenderDirectory(bpy.types.Operator):
472+
bl_idname = "flip_fluid_operators.increase_decrease_render_directory"
473+
bl_label = "Increase/Decrease Render Directory"
474+
bl_description = ("Increase or decrease a numbered suffix on the render output directory." +
475+
" Note: this will not rename an existing render output directory")
476+
477+
increment_mode = StringProperty(default="INCREASE")
478+
exec(vcu.convert_attribute_to_28("increment_mode"))
479+
480+
481+
@classmethod
482+
def poll(cls, context):
483+
return True
484+
485+
486+
def get_trailing_number(self, s):
487+
m = re.search(r'\d+$', s)
488+
return int(m.group()) if m else None
489+
490+
491+
def ends_with_slash(self, s):
492+
return s.endswith("/") or s.endswith("\\")
493+
494+
495+
def ends_with_underscore(self, s):
496+
return s.endswith("_")
497+
498+
499+
def execute(self, context):
500+
render_directory = context.scene.render.filepath
501+
502+
basename = render_directory
503+
endswith_slash = self.ends_with_slash(basename)
504+
endswith_underscore = self.ends_with_underscore(basename)
505+
506+
slash_character = ""
507+
if endswith_slash:
508+
slash_character = basename[-1]
509+
basename = basename[:-1]
510+
elif endswith_underscore:
511+
basename = basename[:-1]
512+
513+
suffix_number = self.get_trailing_number(basename)
514+
if suffix_number:
515+
basename = basename[:-len(str(suffix_number))]
516+
if endswith_underscore:
517+
if self.ends_with_underscore(basename):
518+
basename = basename[:-1]
519+
520+
if self.increment_mode == 'INCREASE':
521+
if not suffix_number:
522+
suffix_number = 0
523+
suffix_number += 1
524+
suffix_string = str(suffix_number)
525+
else:
526+
if not suffix_number:
527+
return {'FINISHED'}
528+
if suffix_number <= 1:
529+
suffix_string = ""
530+
531+
else:
532+
suffix_string = str(suffix_number - 1)
533+
534+
if endswith_slash:
535+
new_basename = basename + suffix_string + slash_character
536+
elif endswith_underscore:
537+
if suffix_string:
538+
new_basename = basename + "_" + suffix_string + "_"
539+
else:
540+
new_basename = basename + "_"
541+
else:
542+
new_basename = basename + suffix_string
543+
544+
context.scene.render.filepath = new_basename
545+
return {'FINISHED'}
546+
547+
548+
class FlipFluidIncreaseDecreaseCacheRenderVersion(bpy.types.Operator):
549+
bl_idname = "flip_fluid_operators.increase_decrease_cache_render_version"
550+
bl_label = "Increase/Decrease Cache and Render Version"
551+
bl_description = ("Increase or decrease a numbered suffix on both the cache" +
552+
" directory and render output directory. Note: this will not rename an" +
553+
" existing cache our render output directory")
554+
555+
increment_mode = StringProperty(default="INCREASE")
556+
exec(vcu.convert_attribute_to_28("increment_mode"))
557+
558+
559+
@classmethod
560+
def poll(cls, context):
561+
return True
562+
563+
564+
def execute(self, context):
565+
bpy.ops.flip_fluid_operators.increase_decrease_cache_directory(increment_mode=self.increment_mode)
566+
bpy.ops.flip_fluid_operators.increase_decrease_render_directory(increment_mode=self.increment_mode)
567+
return {'FINISHED'}
568+
569+
471570
class FlipFluidRelativeLinkedGeometryDirectory(bpy.types.Operator):
472571
bl_idname = "flip_fluid_operators.relative_linked_geometry_directory"
473572
bl_label = "Make Relative"
@@ -569,6 +668,8 @@ def register():
569668
bpy.utils.register_class(FlipFluidAbsoluteCacheDirectory)
570669
bpy.utils.register_class(FlipFluidMatchFilenameCacheDirectory)
571670
bpy.utils.register_class(FlipFluidIncreaseDecreaseCacheDirectory)
671+
bpy.utils.register_class(FlipFluidIncreaseDecreaseRenderDirectory)
672+
bpy.utils.register_class(FlipFluidIncreaseDecreaseCacheRenderVersion)
572673
bpy.utils.register_class(FlipFluidRelativeLinkedGeometryDirectory)
573674
bpy.utils.register_class(FlipFluidAbsoluteLinkedGeometryDirectory)
574675
bpy.utils.register_class(FlipFluidClearLinkedGeometryDirectory)
@@ -588,6 +689,8 @@ def unregister():
588689
bpy.utils.unregister_class(FlipFluidAbsoluteCacheDirectory)
589690
bpy.utils.unregister_class(FlipFluidMatchFilenameCacheDirectory)
590691
bpy.utils.unregister_class(FlipFluidIncreaseDecreaseCacheDirectory)
692+
bpy.utils.unregister_class(FlipFluidIncreaseDecreaseRenderDirectory)
693+
bpy.utils.unregister_class(FlipFluidIncreaseDecreaseCacheRenderVersion)
591694
bpy.utils.unregister_class(FlipFluidRelativeLinkedGeometryDirectory)
592695
bpy.utils.unregister_class(FlipFluidAbsoluteLinkedGeometryDirectory)
593696
bpy.utils.unregister_class(FlipFluidClearLinkedGeometryDirectory)

src/addon/operators/export_operators.py

+6
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def modal(self, context, event):
133133
self.cancel(context)
134134
return {'CANCELLED'}
135135

136+
if not context.scene.flip_fluid.is_domain_in_active_scene():
137+
self.report({"ERROR"},
138+
"Active scene must contain domain object during export - halting export and baking process. Please do not switch active scenes during export.")
139+
self.cancel(context)
140+
return {'CANCELLED'}
141+
136142
if dprops.bake.is_export_operator_cancelled:
137143
self.cancel(context)
138144
return {'FINISHED'}

0 commit comments

Comments
 (0)