Skip to content

Commit

Permalink
new demo version 0.6.3!
Browse files Browse the repository at this point in the history
  • Loading branch information
rlguy committed Apr 20, 2023
1 parent 4b2b759 commit 9b4f628
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 125 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h

### Getting Started

Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.6.2_demo_(29_mar_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.6.2/FLIP_Fluids_addon_0.6.2_demo_.29_mar_2023.zip)
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)

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.

Expand Down
4 changes: 2 additions & 2 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ set(CMAKE_BUILD_TYPE Release)
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
set(FLUIDENGINE_VERSION_MAJOR 0)
set(FLUIDENGINE_VERSION_MINOR 6)
set(FLUIDENGINE_VERSION_REVISION 2)
set(FLUIDENGINE_VERSION_DATE "29-MAR-2023")
set(FLUIDENGINE_VERSION_REVISION 3)
set(FLUIDENGINE_VERSION_DATE "20-APR-2023")

if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
Expand Down
6 changes: 5 additions & 1 deletion src/addon/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ def __delete_outdated_savestates(cache_directory, savestate_id):
if savestate_number > savestate_id:
path = os.path.join(savestate_directory, d)
try:
print("Delete savestate", path)
fpl.delete_files_in_directory(path, extensions, remove_directory=True)
except:
print("Error: unable to delete directory <" + path + "> (skipping)")
Expand Down Expand Up @@ -786,11 +787,14 @@ def __load_save_state_data(fluidsim, data, cache_directory, savestate_id):
current_autosave_directory = os.path.join(savestate_directory, "autosave")
if savestate_name != "autosave" and os.path.isdir(current_autosave_directory):
backup_autosave_directory = current_autosave_directory + ".backup"
if os.path.isdir(backup_autosave_directory):
# Backup autosave directory may already exist from a previous bake, remove if so
fpl.delete_files_in_directory(backup_autosave_directory, [".state", ".data"], remove_directory=True)
os.rename(current_autosave_directory, backup_autosave_directory)
try:
old_directory = autosave_directory
new_directory = os.path.join(savestate_directory, "autosave")
os.rename(old_directory, new_directory)
shutil.copytree(old_directory, new_directory, dirs_exist_ok=True)
fpl.delete_files_in_directory(backup_autosave_directory, [".state", ".data"], remove_directory=True)
except Exception as e:
os.rename(backup_autosave_directory, current_autosave_directory)
Expand Down
12 changes: 6 additions & 6 deletions src/addon/operators/draw_force_field_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

import bpy, blf, math, colorsys

try:
import bgl
except ImportError:
# bgl module may be deprecated depending on Blender version
pass

from bpy.props import (
IntProperty
)
Expand Down Expand Up @@ -194,9 +188,15 @@ def draw_callback_3d(self, context):
# be deprecated in Blender 3.7. Use gpu module instead.
gpu.state.point_size_set(dprops.debug.force_field_line_size)
else:
# only attempt to import bgl when necessary (older versions of Blender). In Blender >= 3.5,
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.force_field_line_size)
particle_batch_draw.draw(particle_shader)
else:
# only attempt to import bgl when necessary (older versions of Blender). In Blender >= 3.5,
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.force_field_line_size)
bgl.glBegin(bgl.GL_POINTS)

Expand Down
7 changes: 1 addition & 6 deletions src/addon/operators/draw_grid_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

import bpy, blf, math, colorsys

try:
import bgl
except ImportError:
# bgl module may be deprecated depending on Blender version
pass

from bpy.props import (
IntProperty
)
Expand Down Expand Up @@ -395,6 +389,7 @@ def draw_callback_3d(self, context):
shader.uniform_float("color", (bounds_color[0], bounds_color[1], bounds_color[2], 1.0))
batch.draw(shader)
else:
import bgl
bgl.glLineWidth(1)
bgl.glBegin(bgl.GL_LINES)

Expand Down
12 changes: 6 additions & 6 deletions src/addon/operators/draw_particles_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

import bpy, blf, math, colorsys

try:
import bgl
except ImportError:
# bgl module may be deprecated depending on Blender version
pass

from bpy.props import (
IntProperty
)
Expand Down Expand Up @@ -233,9 +227,15 @@ def draw_callback_3d(self, context):
# be deprecated in Blender 3.7. Use gpu module instead.
gpu.state.point_size_set(dprops.debug.particle_size)
else:
# only attempt to import bgl when necessary (older versions of Blender). In Blender >= 3.5,
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.particle_size)
particle_batch_draw.draw(particle_shader)
else:
# only attempt to import bgl when necessary (older versions of Blender). In Blender >= 3.5,
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.particle_size)
bgl.glBegin(bgl.GL_POINTS)

Expand Down
6 changes: 6 additions & 0 deletions src/addon/operators/helper_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,8 @@ def execute(self, context):
subprocess.call(["open", "-a", "Terminal", script_filepath])
else:
if shutil.which("gnome-terminal") is not None and shutil.which("bash") is not None:
# Requited to escape spaces for the script_filepath + "; exec bash" command to run
script_filepath = script_filepath.replace(" ", "\\ ")
subprocess.call(["gnome-terminal", "--", "bash", "-c", script_filepath + "; exec bash"])
elif shutil.which("xterm") is not None:
subprocess.call(["xterm", "-hold", "-e", script_filepath])
Expand Down Expand Up @@ -1517,6 +1519,8 @@ def execute(self, context):
subprocess.call(["open", "-a", "Terminal", script_filepath])
else:
if shutil.which("gnome-terminal") is not None and shutil.which("bash") is not None:
# Requited to escape spaces for the script_filepath + "; exec bash" command to run
script_filepath = script_filepath.replace(" ", "\\ ")
subprocess.call(["gnome-terminal", "--", "bash", "-c", script_filepath + "; exec bash"])
elif shutil.which("xterm") is not None:
subprocess.call(["xterm", "-hold", "-e", script_filepath])
Expand Down Expand Up @@ -1658,6 +1662,8 @@ def execute(self, context):
subprocess.call(["open", "-a", "Terminal", script_filepath])
else:
if shutil.which("gnome-terminal") is not None and shutil.which("bash") is not None:
# Requited to escape spaces for the script_filepath + "; exec bash" command to run
script_filepath = script_filepath.replace(" ", "\\ ")
subprocess.call(["gnome-terminal", "--", "bash", "-c", script_filepath + "; exec bash"])
elif shutil.which("xterm") is not None:
subprocess.call(["xterm", "-hold", "-e", script_filepath])
Expand Down
5 changes: 3 additions & 2 deletions src/addon/properties/domain_advanced_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ class DomainAdvancedProperties(bpy.types.PropertyGroup):
description="Attempt to remove extreme particle velocities that"
" cause the simulator to exceed the maximum number of allowed"
" frame substeps. Enabling this option may prevent simulation"
" blow-up in extreme cases. Disable this option if fast moving"
" fluid is disappearing from the simulation domain",
" blow-up in extreme cases. It is not recommended to disable"
" this option outside of experimentation and testing. Disabling"
" can result in unstable simulations and/or extreme simulation times",
default=True,
); exec(conv("enable_extreme_velocity_removal"))
enable_gpu_features = BoolProperty(
Expand Down
1 change: 1 addition & 0 deletions src/addon/properties/domain_cache_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def is_linked_geometry_directory(self):
if os.path.isdir(linked_export_directory):
return True
else:
database_filename = "export_data.sqlite3"
incorrect_filepath_test = os.path.join(linked_geometry_directory, database_filename)
if os.path.isfile(incorrect_filepath_test):
return True
Expand Down
5 changes: 4 additions & 1 deletion src/addon/properties/domain_whitewater_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ class DomainWhitewaterProperties(bpy.types.PropertyGroup):
name="Max Particles (in millions)",
description="Maximum number of whitewater particles (in millions)"
" to simulate. The solver will stop generating new whitewater"
" particles to prevent exceeding this limit",
" particles to prevent exceeding this limit. If set to 0, the"
" solver will not limit the number of whitewater particles,"
" however this may require large amounts of storage space depending"
" on the simulation",
min=0, max=2000,
default=12,
precision=2,
Expand Down
47 changes: 26 additions & 21 deletions src/addon/properties/fluid_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,32 @@ def refresh_property_registry(self):


def _initialize_property_registry(self):
self.property_registry.clear()
add = self.property_registry.add_property
add("fluid.initial_velocity", "")
add("fluid.append_object_velocity", "")
add("fluid.append_object_velocity_influence", "")
add("fluid.priority", "")
add("fluid.fluid_velocity_mode", "")
add("fluid.initial_speed", "")
add("fluid.fluid_axis_mode", "")
add("fluid.source_id", "")
add("fluid.viscosity", "")
add("fluid.color", "")
add("fluid.target_object", "")
add("fluid.export_animated_target", "")
add("fluid.export_animated_mesh", "")
add("fluid.skip_reexport", "")
add("fluid.force_reexport_on_next_bake", "")
add("fluid.frame_offset_type", "")
add("fluid.frame_offset", "")
add("fluid.timeline_offset", "")
self._validate_property_registry()
try:
self.property_registry.clear()
add = self.property_registry.add_property
add("fluid.initial_velocity", "")
add("fluid.append_object_velocity", "")
add("fluid.append_object_velocity_influence", "")
add("fluid.priority", "")
add("fluid.fluid_velocity_mode", "")
add("fluid.initial_speed", "")
add("fluid.fluid_axis_mode", "")
add("fluid.source_id", "")
add("fluid.viscosity", "")
add("fluid.color", "")
add("fluid.target_object", "")
add("fluid.export_animated_target", "")
add("fluid.export_animated_mesh", "")
add("fluid.skip_reexport", "")
add("fluid.force_reexport_on_next_bake", "")
add("fluid.frame_offset_type", "")
add("fluid.frame_offset", "")
add("fluid.timeline_offset", "")
self._validate_property_registry()
except:
# Object is immutable if it is a linked library or library_override
# In this case, pass on modifying the object
pass


def _validate_property_registry(self):
Expand Down
63 changes: 34 additions & 29 deletions src/addon/properties/force_field_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,35 +281,40 @@ def refresh_property_registry(self):


def _initialize_property_registry(self):
self.property_registry.clear()
add = self.property_registry.add_property
add("force_field.force_field_type", "")
add("force_field.is_enabled", "")
add("force_field.strength", "")
add("force_field.flow_strength", "")
add("force_field.spin_strength", "")
add("force_field.enable_endcaps", "")
add("force_field.falloff_power", "")
add("force_field.falloff_shape", "")
add("force_field.enable_min_distance", "")
add("force_field.enable_max_distance", "")
add("force_field.min_max_distance", "")
add("force_field.maximum_force_limit_factor", "")
add("force_field.gravity_scale_point", "")
add("force_field.gravity_scale_surface", "")
add("force_field.enable_frontfacing", "")
add("force_field.enable_backfacing", "")
add("force_field.enable_edgefacing", "")
add("force_field.gravity_scale_volume", "")
add("force_field.gravity_scale_curve", "")
add("force_field.gravity_scale_width_point", "")
add("force_field.gravity_scale_width_surface", "")
add("force_field.gravity_scale_width_volume", "")
add("force_field.gravity_scale_width_curve", "")
add("force_field.export_animated_mesh", "")
add("force_field.skip_reexport", "")
add("force_field.force_reexport_on_next_bake", "")
self._validate_property_registry()
try:
self.property_registry.clear()
add = self.property_registry.add_property
add("force_field.force_field_type", "")
add("force_field.is_enabled", "")
add("force_field.strength", "")
add("force_field.flow_strength", "")
add("force_field.spin_strength", "")
add("force_field.enable_endcaps", "")
add("force_field.falloff_power", "")
add("force_field.falloff_shape", "")
add("force_field.enable_min_distance", "")
add("force_field.enable_max_distance", "")
add("force_field.min_max_distance", "")
add("force_field.maximum_force_limit_factor", "")
add("force_field.gravity_scale_point", "")
add("force_field.gravity_scale_surface", "")
add("force_field.enable_frontfacing", "")
add("force_field.enable_backfacing", "")
add("force_field.enable_edgefacing", "")
add("force_field.gravity_scale_volume", "")
add("force_field.gravity_scale_curve", "")
add("force_field.gravity_scale_width_point", "")
add("force_field.gravity_scale_width_surface", "")
add("force_field.gravity_scale_width_volume", "")
add("force_field.gravity_scale_width_curve", "")
add("force_field.export_animated_mesh", "")
add("force_field.skip_reexport", "")
add("force_field.force_reexport_on_next_bake", "")
self._validate_property_registry()
except:
# Object is immutable if it is a linked library or library_override
# In this case, pass on modifying the object
pass


def _validate_property_registry(self):
Expand Down
47 changes: 26 additions & 21 deletions src/addon/properties/inflow_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,32 @@ def refresh_property_registry(self):


def _initialize_property_registry(self):
self.property_registry.clear()
add = self.property_registry.add_property
add("inflow.is_enabled", "")
add("inflow.substep_emissions", "")
add("inflow.inflow_velocity_mode", "")
add("inflow.inflow_velocity", "")
add("inflow.append_object_velocity", "")
add("inflow.append_object_velocity_influence", "")
add("inflow.priority", "")
add("inflow.constrain_fluid_velocity", "")
add("inflow.inflow_speed", "")
add("inflow.inflow_axis_mode", "")
add("inflow.source_id", "")
add("inflow.viscosity", "")
add("inflow.color", "")
add("inflow.target_object", "")
add("inflow.export_animated_target", "")
add("inflow.export_animated_mesh", "")
add("inflow.skip_reexport", "")
add("inflow.force_reexport_on_next_bake", "")
self._validate_property_registry()
try:
self.property_registry.clear()
add = self.property_registry.add_property
add("inflow.is_enabled", "")
add("inflow.substep_emissions", "")
add("inflow.inflow_velocity_mode", "")
add("inflow.inflow_velocity", "")
add("inflow.append_object_velocity", "")
add("inflow.append_object_velocity_influence", "")
add("inflow.priority", "")
add("inflow.constrain_fluid_velocity", "")
add("inflow.inflow_speed", "")
add("inflow.inflow_axis_mode", "")
add("inflow.source_id", "")
add("inflow.viscosity", "")
add("inflow.color", "")
add("inflow.target_object", "")
add("inflow.export_animated_target", "")
add("inflow.export_animated_mesh", "")
add("inflow.skip_reexport", "")
add("inflow.force_reexport_on_next_bake", "")
self._validate_property_registry()
except:
# Object is immutable if it is a linked library or library_override
# In this case, pass on modifying the object
pass


def _validate_property_registry(self):
Expand Down
31 changes: 18 additions & 13 deletions src/addon/properties/obstacle_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,24 @@ def refresh_property_registry(self):


def _initialize_property_registry(self):
self.property_registry.clear()
add = self.property_registry.add_property
add("obstacle.is_enabled", "")
add("obstacle.is_inversed", "")
add("obstacle.export_animated_mesh", "")
add("obstacle.skip_reexport", "")
add("obstacle.force_reexport_on_next_bake", "")
add("obstacle.friction", "")
add("obstacle.whitewater_influence", "")
add("obstacle.dust_emission_strength", "")
add("obstacle.sheeting_strength", "")
add("obstacle.mesh_expansion", "")
self._validate_property_registry()
try:
self.property_registry.clear()
add = self.property_registry.add_property
add("obstacle.is_enabled", "")
add("obstacle.is_inversed", "")
add("obstacle.export_animated_mesh", "")
add("obstacle.skip_reexport", "")
add("obstacle.force_reexport_on_next_bake", "")
add("obstacle.friction", "")
add("obstacle.whitewater_influence", "")
add("obstacle.dust_emission_strength", "")
add("obstacle.sheeting_strength", "")
add("obstacle.mesh_expansion", "")
self._validate_property_registry()
except:
# Object is immutable if it is a linked library or library_override
# In this case, pass on modifying the object
pass


def _validate_property_registry(self):
Expand Down
Loading

0 comments on commit 9b4f628

Please sign in to comment.