Skip to content

Commit 4d5ab9a

Browse files
committed
new demo version 0.8.1!
1 parent 29fd16c commit 4d5ab9a

21 files changed

+570
-307
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
src/engine/kernels/kernels.cpp
22
src/engine/versionutils.cpp
33
src/addon/__init__.py
4+
src/addon/blender_manifest.toml
45
src/addon/utils/installation_utils.py
56
CMakeLists.txt
67
build

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ 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.5_demo_(12_mar_2024.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.7.5/FLIP_Fluids_addon_0.7.5_demo_.12_mar_2024.zip)
15-
16-
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.
17-
18-
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)!
14+
1. **Download** the latest FLIP Fluids Demo: [FLIP_Fluids_addon_0.8.1_demo_(16_jul_2024.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.8.1/FLIP_Fluids_addon_0.8.1_demo_.16_jul_2024.zip)
15+
2. **Install** the FLIP Fluids Demo: [Installation Instructions](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Addon-Installation-and-Uninstallation)
16+
3. **Get Started** with creating your first FLIP Fluids addon simulation:
17+
- [Video Learning Series](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Video-Learning-Series)
18+
- [Written Beginners Guide](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Creating-Your-First-FLIP-Fluids-Simulation)
19+
- [Documentation and Wiki](https://github.com/rlguy/Blender-FLIP-Fluids/wiki)
1920

2021
### Have any questions?
2122

cmake/CMakeLists.txt

+15-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
SOFTWARE.
2121
]]
2222

23-
cmake_minimum_required(VERSION 3.0)
23+
cmake_minimum_required(VERSION 3.5)
2424

2525
function(set_output_directories DIR)
2626
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DIR} PARENT_SCOPE)
@@ -33,7 +33,7 @@ endfunction(set_output_directories)
3333

3434
set(BUILD_DEBUG OFF CACHE BOOL "Turn on to build a debug release")
3535

36-
# Disable distribute source (ON -> OFF) to speed up copying files. Remember to
36+
# Disable distribute source (ON -> OFF) to speed up build. Remember to
3737
# turn back on before distribution!
3838
option(DISTRIBUTE_SOURCE "Include source code in addon" ON)
3939

@@ -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 8)
56-
set(FLUIDENGINE_VERSION_REVISION 0)
57-
set(FLUIDENGINE_VERSION_DATE "21-MAY-2024")
56+
set(FLUIDENGINE_VERSION_REVISION 1)
57+
set(FLUIDENGINE_VERSION_DATE "16-JUL-2024")
5858

5959
if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
6060
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
@@ -143,6 +143,10 @@ configure_file(
143143
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py.in"
144144
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py"
145145
)
146+
configure_file(
147+
"${PROJECT_SOURCE_DIR}/src/addon/blender_manifest.toml.in"
148+
"${PROJECT_SOURCE_DIR}/src/addon/blender_manifest.toml"
149+
)
146150
configure_file(
147151
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py.in"
148152
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py"
@@ -204,17 +208,18 @@ file(COPY "${CMAKE_SOURCE_DIR}/src/addon/" DESTINATION "${BLENDER_ADDON_DIR}")
204208
file(COPY "${CMAKE_SOURCE_DIR}/src/engine/pyfluid/" DESTINATION "${BLENDER_ADDON_DIR}/pyfluid")
205209

206210
if(DISTRIBUTE_SOURCE)
207-
set(SOURCE_COPY_PATHS
208-
"${CMAKE_SOURCE_DIR}/src"
211+
set(SOURCES_ARCHIVE_ROOT
212+
"${CMAKE_SOURCE_DIR}/__init__.py"
213+
"${CMAKE_SOURCE_DIR}/build.py"
209214
"${CMAKE_SOURCE_DIR}/.gitignore"
210215
"${CMAKE_SOURCE_DIR}/LICENSE_GPLv3.md"
211216
"${CMAKE_SOURCE_DIR}/LICENSE_MIT.md"
212217
"${CMAKE_SOURCE_DIR}/LICENSE_Standard_Royalty_Free.md"
213218
"${CMAKE_SOURCE_DIR}/README.md"
214-
"${CMAKE_SOURCE_DIR}/__init__.py"
215219
)
216220

217-
foreach(SOURCE_PATH ${SOURCE_COPY_PATHS})
218-
file(COPY "${SOURCE_PATH}" DESTINATION "${BLENDER_ADDON_DIR}/source/")
219-
endforeach(SOURCE_PATH)
221+
file(GLOB_RECURSE SOURCES_ARCHIVE "${CMAKE_SOURCE_DIR}/src/*" "${CMAKE_SOURCE_DIR}/cmake/*")
222+
list (APPEND SOURCES_ARCHIVE ${SOURCES_ARCHIVE_ROOT})
223+
file(MAKE_DIRECTORY ${BLENDER_ADDON_DIR}/source)
224+
file(ARCHIVE_CREATE OUTPUT "${BLENDER_ADDON_DIR}/source/flip_fluids_addon_source.zip" PATHS ${SOURCES_ARCHIVE} FORMAT "zip")
220225
endif()

src/addon/bake.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from .objects import flip_fluid_geometry_database
2121
from .operators import bake_operators
2222
from .filesystem import filesystem_protection_layer as fpl
23+
from .utils import version_compatibility_utils as vcu
24+
from . import bl_info
2325

2426
from .pyfluid import (
2527
pyfluid,
@@ -3098,10 +3100,15 @@ def set_console_output(boolval):
30983100

30993101

31003102
def __get_addon_version():
3101-
module_dir = os.path.dirname(os.path.realpath(__file__))
3102-
module_name = os.path.basename(os.path.normpath(module_dir))
3103-
module = sys.modules[module_name]
3104-
addon_major, addon_minor, addon_revision = module.bl_info.get('version', (-1, -1, -1))
3103+
if vcu.is_blender_42():
3104+
bl_info_dict = bl_info
3105+
else:
3106+
module_dir = os.path.dirname(os.path.realpath(__file__))
3107+
module_name = os.path.basename(os.path.normpath(module_dir))
3108+
module = sys.modules[module_name]
3109+
bl_info_dict = module.bl_info
3110+
3111+
addon_major, addon_minor, addon_revision = bl_info_dict.get('version', (-1, -1, -1))
31053112
return str(addon_major) + "." + str(addon_minor) + "." + str(addon_revision)
31063113

31073114

src/addon/blender_manifest.toml.in

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
schema_version = "1.0.0"
2+
3+
id = "flip_fluids_addon"
4+
type = "add-on"
5+
version = "@FLUIDENGINE_VERSION_MAJOR@.@FLUIDENGINE_VERSION_MINOR@.@FLUIDENGINE_VERSION_REVISION@"
6+
name = "FLIP Fluids"
7+
tagline = "A FLIP Fluid Simulation Tool for Blender (v@FLUIDENGINE_VERSION_LABEL@)"
8+
maintainer = "Ryan Guy & Dennis Fassbaender // [email protected]"
9+
website = "https://github.com/rlguy/Blender-FLIP-Fluids/wiki"
10+
tags = ["Animation", "Physics"]
11+
blender_version_min = "4.2.0"
12+
license = ["SPDX:GPL-3.0-or-later"]
13+
platforms = ["windows-x64", "macos-x64", "macos-arm64", "linux-x64"]
14+
15+
[permissions]
16+
files = "Read and write simulation cache files to the filesystem"
17+
clipboard = "Copy and paste render and bake commands"

src/addon/operators/command_line_operators.py

+30-13
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,25 @@
2525

2626
### PREPARE VISIBLITY SETTINGS FOR PASSES ###
2727

28+
def transfer_catchers_to_catcher_list(hprops):
29+
# Leere die bestehende Catcher-Liste
30+
hprops.render_passes_catcherlist.clear()
31+
32+
# Übertrage die Catcher-Objekte in die Catcher-Liste
33+
for obj_prop in hprops.render_passes_objectlist:
34+
if obj_prop.catcher:
35+
new_catcher = hprops.render_passes_catcherlist.add()
36+
new_catcher.name = obj_prop.name
37+
new_catcher.catcher = obj_prop.catcher
38+
2839
def apply_visibility_settings_for_pass(pass_name):
2940
visibility_settings = render_passes.visibility_settings
3041
settings = visibility_settings.get(pass_name, {})
3142
hprops = bpy.context.scene.flip_fluid_helper
3243

44+
# Übertrage Catcher-Objekte in die Catcher-Liste im Hintergrund
45+
transfer_catchers_to_catcher_list(hprops)
46+
3347
print(f"Applying settings for pass: {pass_name}")
3448
print(f"Settings being applied: {settings}")
3549

@@ -65,6 +79,17 @@ def apply_visibility_settings_for_pass(pass_name):
6579
else:
6680
print(f"Selected object not found in Blender: {obj_prop.name}")
6781

82+
if "catchers" in settings:
83+
catcher_list_settings = settings["catchers"]
84+
print(f"Settings for 'catchers' in pass '{pass_name}': {catcher_list_settings}")
85+
for catcher_prop in hprops.render_passes_catcherlist:
86+
catcher = bpy.data.objects.get(catcher_prop.name)
87+
if catcher:
88+
print(f"Applying '{pass_name}' settings to catcher {catcher_prop.name}")
89+
apply_visibility_settings_for_object(catcher, catcher_list_settings)
90+
else:
91+
print(f"Catcher object not found in Blender: {catcher_prop.name}")
92+
6893
def apply_film_transparency(film_transparent):
6994
bpy.context.scene.render.film_transparent = film_transparent
7095
print(f"Film transparency set to: {film_transparent}")
@@ -82,7 +107,7 @@ def apply_visibility_settings_for_world(world, world_settings):
82107
print("No world found in the current scene.")
83108
return
84109

85-
# Visiblitysettings for the world
110+
# Visibility settings for the world
86111
visibility_attributes = ['camera', 'diffuse', 'glossy', 'transmission', 'scatter', 'shadow']
87112
for attr in visibility_attributes:
88113
if attr in world_settings:
@@ -103,15 +128,7 @@ def apply_visibility_settings_for_object(obj, obj_visibility):
103128
if "is_holdout" in obj_visibility:
104129
obj.is_holdout = obj_visibility["is_holdout"]
105130

106-
#def apply_render_output_path_for_pass(suffix):
107-
# render_output = bpy.context.scene.render.filepath
108-
# render_output = render_output.replace('\\', '/')
109-
# render_output_prefix = bpy.path.basename(render_output)
110-
# render_output_directory = render_output.removesuffix(render_output_prefix)
111-
# new_render_output_path = render_output_directory + suffix + "/" + render_output_prefix
112-
# if render_output_prefix:
113-
# new_render_output_path += suffix + "_"
114-
# bpy.context.scene.render.filepath = new_render_output_path
131+
115132

116133
def prepare_render_passes_blend_files():
117134
props = bpy.context.scene.flip_fluid_helper
@@ -123,6 +140,7 @@ def prepare_render_passes_blend_files():
123140
base_file_name = pathlib.Path(bpy.path.basename(bpy.data.filepath)).stem
124141

125142
pass_suffixes = [
143+
("catchers_only", props.render_passes_catchers_only),
126144
("objects_only", props.render_passes_objects_only),
127145
("fluidparticles_only", props.render_passes_fluidparticles_only),
128146
("fluid_only", props.render_passes_fluid_only),
@@ -173,18 +191,17 @@ def prepare_render_passes_blend_files():
173191
for filename in files_to_remove:
174192
blend_filepath = os.path.join(blend_file_directory, filename)
175193

176-
# Disabled for the FLIP Fluids 1.8.0 release - just in case an unfound bug could
194+
# Note: Comment out os.remove() calls for the FLIP Fluids 1.8.0 release - just in case an unfound bug could
177195
# delete an incorrect Blend file.
178196
# All calls to os.remove should be implemented and checked in
179197
# filesystem/filesystem_protection_layer.py
180198
# According to the file and data protection guidelines:
181199
# https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Domain-Cache-Settings#file-and-data-protection-features
182200
#
183201
# TODO: update this later - Ryan
184-
"""
185202
os.remove(blend_filepath)
186203
print(f"Removed file: {blend_filepath}")
187-
"""
204+
188205

189206
def apply_render_output_path_for_pass(suffix, number, base_file_name):
190207
# Der Pfad zum Render-Verzeichnis

0 commit comments

Comments
 (0)