Skip to content

Commit

Permalink
new demo version 0.7.1!
Browse files Browse the repository at this point in the history
  • Loading branch information
rlguy committed Jul 24, 2023
1 parent ae971e6 commit 48112c0
Show file tree
Hide file tree
Showing 47 changed files with 1,481 additions and 112 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ 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.7.0_demo_(27_jun_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.0/FLIP_Fluids_addon_0.7.0_demo_.27_jun_2023.zip)
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.7.1_demo_(25_jul_2023.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.1/FLIP_Fluids_addon_0.7.1_demo_.25_jul_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.

Get started creating your first simulation with our [beginners guide](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Creating-Your-First-FLIP-Fluids-Simulation) or [video learning series](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Video-Learning-Series)!

### Have any questions?

Feel free to send us a message on any of the [official marketplaces](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon), or send us an email at support@flipfluids.com. We're always glad to help!
Feel free to send us a message on any of the [official marketplaces](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon), or send us an email at support@flipfluids.com. We're always glad to help!
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 7)
set(FLUIDENGINE_VERSION_REVISION 0)
set(FLUIDENGINE_VERSION_DATE "27-JUN-2023")
set(FLUIDENGINE_VERSION_REVISION 1)
set(FLUIDENGINE_VERSION_DATE "25-JUL-2023")

if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
Expand Down
33 changes: 32 additions & 1 deletion src/addon/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ from .utils import version_compatibility_utils as vcu

@bpy.app.handlers.persistent
def scene_update_post(scene):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

installation_utils.scene_update_post(scene)
if installation_utils.is_addon_active():
if not render.is_rendering():
Expand All @@ -86,42 +89,64 @@ def scene_update_post(scene):

@bpy.app.handlers.persistent
def render_init(scene):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

render.render_init(scene)


@bpy.app.handlers.persistent
def render_complete(scene):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

render.render_complete(scene)


@bpy.app.handlers.persistent
def render_cancel(scene):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

render.render_cancel(scene)


@bpy.app.handlers.persistent
def frame_change_pre(scene, depsgraph=None):
pass
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return


@bpy.app.handlers.persistent
def frame_change_post(scene, depsgraph=None):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

properties.frame_change_post(scene, depsgraph)
render.frame_change_post(scene, depsgraph)


@bpy.app.handlers.persistent
def render_pre(scene, depsgraph=None):
if scene.flip_fluid.is_addon_disabled_in_blend_file():
return

render.render_pre(scene)


@bpy.app.handlers.persistent
def load_pre(nonedata):
if bpy.context.scene.flip_fluid.is_addon_disabled_in_blend_file():
return

properties.load_pre()


@bpy.app.handlers.persistent
def load_post(nonedata):
if bpy.context.scene.flip_fluid.is_addon_disabled_in_blend_file():
return

if vcu.is_blender_28() and not vcu.is_blender_281():
print("FLIP FLUIDS WARNING: Blender 2.80 contains bugs that can cause frequent crashes during render, Alembic export, and rigid/cloth simulation baking. Blender version 2.81 or higher is recommended.")

Expand All @@ -134,11 +159,17 @@ def load_post(nonedata):

@bpy.app.handlers.persistent
def save_pre(nonedata):
if bpy.context.scene.flip_fluid.is_addon_disabled_in_blend_file():
return

properties.save_pre()


@bpy.app.handlers.persistent
def save_post(nonedata):
if bpy.context.scene.flip_fluid.is_addon_disabled_in_blend_file():
return

properties.save_post()
exit_handler.save_post()

Expand Down
3 changes: 2 additions & 1 deletion src/addon/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,10 +1649,11 @@ def __update_animatable_obstacle_properties(data, frameid):

mesh_object.enable = __get_parameter_data(data.is_enabled, frameid)
mesh_object.friction = __get_parameter_data(data.friction, frameid, value_min=0.0)
mesh_object.velocity_scale = __get_parameter_data(data.velocity_scale, frameid)
mesh_object.whitewater_influence = __get_parameter_data(data.whitewater_influence, frameid, value_min=0.0)
mesh_object.dust_emission_strength = __get_parameter_data(data.dust_emission_strength, frameid, value_min=0.0)
mesh_object.sheeting_strength = __get_parameter_data(data.sheeting_strength, frameid, value_min=0.0)
mesh_object.mesh_expansion = __get_parameter_data(data.mesh_expansion, frameid, value_min=0.0)
mesh_object.mesh_expansion = __get_parameter_data(data.mesh_expansion, frameid)


def __update_animatable_meshing_volume_properties(data, frameid):
Expand Down
12 changes: 12 additions & 0 deletions src/addon/objects/flip_fluid_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,18 @@ def initialize_cache_settings(self):
self.obstacle.cache_object_type = "CACHE_OBJECT_TYPE_OBSTACLE"


def is_simulation_mesh_load_enabled(self, mesh_name):
return render.is_simulation_mesh_load_enabled(mesh_name)


def enable_simulation_mesh_load(self, mesh_name):
return render.enable_simulation_mesh_load(mesh_name)


def disable_simulation_mesh_load(self, mesh_name):
return render.disable_simulation_mesh_load(mesh_name)


def load_post(self):
self._update_deprecated_mesh_storage()

Expand Down
2 changes: 1 addition & 1 deletion src/addon/operators/bake_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def execute(self, context):
os.makedirs(cache_directory)
except:
msg = "Unable to create cache directory: <" + cache_directory + "> "
msg += "Set the FLIP Fluid Cache directory to a location with write permissions."
msg += "Set the cache directory in the 'Domain > FLIP Fluid Cache panel' to a location on your system with write permissions."
self.report({"ERROR_INVALID_INPUT"}, msg)
return {'CANCELLED'}

Expand Down
2 changes: 1 addition & 1 deletion src/addon/operators/cache_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import bpy, os, re
import bpy, os, re, shutil

from ..filesystem import filesystem_protection_layer as fpl
from ..utils import version_compatibility_utils as vcu
Expand Down
21 changes: 20 additions & 1 deletion src/addon/operators/draw_force_field_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,18 @@ def update_debug_force_field_geometry(context):
}
"""

particle_shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
if vcu.is_blender_35():
# Needed for support on MacOS Apple Silicon systems in Blender 3.5 or later
# Could possibly be a Blender regression bug why the below method no longer
# works in Blender 3.5 or later for MacOS. Should file a report.
shader_name = '3D_SMOOTH_COLOR'
if vcu.is_blender_40():
shader_name = 'SMOOTH_COLOR'

particle_shader = gpu.shader.from_builtin(shader_name)
else:
particle_shader = gpu.types.GPUShader(vertex_shader, fragment_shader)

particle_batch_draw = batch_for_shader(
particle_shader, 'POINTS',
{"pos": particle_vertices, "color": particle_vertex_colors},
Expand Down Expand Up @@ -192,7 +203,15 @@ def draw_callback_3d(self, context):
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.force_field_line_size)

if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
particle_batch_draw.draw(particle_shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)

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.
Expand Down
25 changes: 25 additions & 0 deletions src/addon/operators/draw_grid_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,25 +373,50 @@ def draw_callback_3d(self, context):
batch = batch_for_shader(shader, 'LINES', {"pos": z_coords})
shader.bind()
shader.uniform_float("color", (z_color[0], z_color[1], z_color[2], 1.0))

if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
batch.draw(shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)
if display_grid and dprops.debug.enabled_debug_grids[1]:
shader = gpu.shader.from_builtin(line_draw_mode)
batch = batch_for_shader(shader, 'LINES', {"pos": y_coords})
shader.bind()
shader.uniform_float("color", (y_color[0], y_color[1], y_color[2], 1.0))
if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
batch.draw(shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)
if display_grid and dprops.debug.enabled_debug_grids[0]:
shader = gpu.shader.from_builtin(line_draw_mode)
batch = batch_for_shader(shader, 'LINES', {"pos": x_coords})
shader.bind()
shader.uniform_float("color", (x_color[0], x_color[1], x_color[2], 1.0))
if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
batch.draw(shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)
if dprops.debug.display_domain_bounds:
shader = gpu.shader.from_builtin(line_draw_mode)
batch = batch_for_shader(shader, 'LINES', {"pos": bounds_coords})
shader.bind()
shader.uniform_float("color", (bounds_color[0], bounds_color[1], bounds_color[2], 1.0))
if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
batch.draw(shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)
else:
import bgl
bgl.glLineWidth(1)
Expand Down
21 changes: 20 additions & 1 deletion src/addon/operators/draw_particles_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,18 @@ def update_debug_particle_geometry(context):
}
"""

particle_shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
if vcu.is_blender_35():
# Needed for support on MacOS Apple Silicon systems in Blender 3.5 or later
# Could possibly be a Blender regression bug why the below method no longer
# works in Blender 3.5 or later for MacOS. Should file a report.
shader_name = '3D_SMOOTH_COLOR'
if vcu.is_blender_40():
shader_name = 'SMOOTH_COLOR'

particle_shader = gpu.shader.from_builtin(shader_name)
else:
particle_shader = gpu.types.GPUShader(vertex_shader, fragment_shader)

particle_batch_draw = batch_for_shader(
particle_shader, 'POINTS',
{"pos": particle_vertices, "color": particle_vertex_colors},
Expand Down Expand Up @@ -231,7 +242,15 @@ def draw_callback_3d(self, context):
# importing bgl generates a warning, and possibly an error in Blender >= 4.0.
import bgl
bgl.glPointSize(dprops.debug.particle_size)

if vcu.is_blender_35():
# Can be drawn with depth in Blender 3.5 or later
gpu.state.depth_test_set('LESS_EQUAL')
gpu.state.depth_mask_set(True)
particle_batch_draw.draw(particle_shader)
if vcu.is_blender_35():
gpu.state.depth_mask_set(False)

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.
Expand Down
Loading

0 comments on commit 48112c0

Please sign in to comment.