Skip to content

Commit 6242b09

Browse files
committed
new demo version 0.3.0!
1 parent 830a9fc commit 6242b09

Some content is hidden

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

47 files changed

+2920
-99
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
src/engine/kernels/kernels.cpp
22
src/engine/versionutils.cpp
3-
src/addon/__init__.py
3+
src/addon/__init__.py
4+
src/addon/utils/installation_utils.py
5+
CMakeLists.txt
6+
build

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
Want to try FLIP Fluids addon before buying the full [Blender Market Product](https://blendermarket.com/products/flipfluids)? Try out the **[FLIP Fluids Demo](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/FLIP-Fluids-Demo-Addon)** addon! The FLIP Fluids Demo will let you create, run, and render your own fluid simulations with a few small limitations.
1+
Want to try the FLIP Fluids addon before buying the [full marketplace product](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Official-Marketplaces-of-the-FLIP-Fluids-Addon)? Try out the **FLIP Fluids Demo** addon! The FLIP Fluids demo can do everything that the full version can and will let you create, run, and render your own fluid simulations with a small limitation.
22

33
### Limitations
44

55
- Simulation meshes are watermarked with _FLIP Fluids Demo_ text
66

77
### Getting Started
88

9-
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.2.0_demo_(25_nov_2021.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/0.2.0/FLIP_Fluids_addon_0.2.0_demo_.25_nov_2021.zip)
9+
Download the latest FLIP Fluids Demo installation file here: [FLIP_Fluids_addon_0.3.0_demo_(11_mar_2022.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/0.2.0/FLIP_Fluids_addon_0.2.1_demo_.09_dec_2021.zip)
1010

1111
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.
1212

1313
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)!
1414

1515
### Have any questions?
1616

17-
Feel free to send us a message on the [Blender Market](https://blendermarket.com/products/flipfluids), or send us an email at [email protected]. We're always glad to help!
17+
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 [email protected]. We're always glad to help!

__init__.py

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def draw(self, context):
5959
"wm.url_open",
6060
text="Purchase the FLIP Fluids addon on the Blender Market",
6161
).url = "https://blendermarket.com/products/flipfluids"
62+
column.operator(
63+
"wm.url_open",
64+
text="Purchase the FLIP Fluids addon on Gumroad",
65+
).url = "https://flipfluids.gumroad.com/l/flipfluids"
66+
column.operator(
67+
"wm.url_open",
68+
text="Purchase the FLIP Fluids addon on FlippedNormals",
69+
).url = "https://flippednormals.com/downloads/the-flip-fluids-addon-for-blender/ref/FLIPFluids/"
6270

6371

6472
def register():

build.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import os, shutil, subprocess, platform, argparse
2424

2525

26-
def cmake_make(cmakelists_dir, cmake_path, make_path, build_debug=True, make_build=True, darwin_arch=""):
26+
def cmake_make(cmakelists_dir, cmake_path, make_path, build_debug=True, make_build=True, darwin_arch="", library_suffix=""):
2727
if build_debug:
2828
build_debug_flag = "-DBUILD_DEBUG=ON"
2929
else:
@@ -39,6 +39,9 @@ def cmake_make(cmakelists_dir, cmake_path, make_path, build_debug=True, make_bui
3939
elif system == "Linux":
4040
cmake_command = [cmake_path, cmakelists_dir, build_debug_flag]
4141

42+
if library_suffix:
43+
cmake_command.append("-DLIBRARY_SUFFIX=" + library_suffix)
44+
4245
subprocess.check_call(cmake_command)
4346

4447
if make_build:
@@ -76,6 +79,7 @@ def main():
7679
parser = argparse.ArgumentParser(description="FLIP Fluids Addon build and compile script")
7780
parser.add_argument("-build-directory", help="Path to destination build directory")
7881
parser.add_argument("-darwin-arch", help="Target architecture to set for CMAKE_OSX_ARCHITECTURES")
82+
parser.add_argument("-library-suffix", help="Specify suffix to add to the generated library name")
7983
parser.add_argument("-cmake-path", help="Specify path to CMake binary (www.cmake.org)")
8084
parser.add_argument("-make-path", help="Specify path to GNU Make binary (www.gnu.org/software/make)")
8185
parser.add_argument('--clean', action="store_true", help="Clear generated files in the build directory before building")
@@ -91,6 +95,10 @@ def main():
9195
if args.darwin_arch:
9296
darwin_arch = args.darwin_arch
9397

98+
library_suffix = ""
99+
if args.library_suffix:
100+
library_suffix = args.library_suffix
101+
94102
cmake_path = "cmake"
95103
if args.cmake_path:
96104
cmake_path = process_path(args.cmake_path)
@@ -127,8 +135,8 @@ def main():
127135
if args.clean:
128136
clean_build_directory(build_dir)
129137

130-
cmake_make(root_dir, cmake_path, make_path, build_debug=True, make_build=not args.no_compile, darwin_arch=darwin_arch)
131-
cmake_make(root_dir, cmake_path, make_path, build_debug=False, make_build=not args.no_compile, darwin_arch=darwin_arch)
138+
cmake_make(root_dir, cmake_path, make_path, build_debug=True, make_build=not args.no_compile, darwin_arch=darwin_arch, library_suffix=library_suffix)
139+
cmake_make(root_dir, cmake_path, make_path, build_debug=False, make_build=not args.no_compile, darwin_arch=darwin_arch, library_suffix=library_suffix)
132140

133141
lib_dir = os.path.join(build_dir, "bl_flip_fluids", "flip_fluids_addon", "pyfluid", "lib")
134142
if os.path.isdir(lib_dir):

cmake/CMakeLists.txt

+22-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ option(DISTRIBUTE_SOURCE "Include source code in addon" ON)
4040
option(WITH_OPENCL "Compile project with OpenCL features" OFF)
4141
option(WITH_ENGINE_TEST "Compile engine test executable" OFF)
4242
option(WITH_PYFLUID_MODULE "Compile pyfluid Python module" OFF)
43+
SET(LIBRARY_SUFFIX "" CACHE STRING "Optional suffix to add to the end of the library name")
4344

4445
if(APPLE)
4546
set(MACOSX_DEPLOYMENT_TARGET 10.10)
@@ -48,10 +49,21 @@ endif()
4849
project(bl_flip_fluids)
4950
set(CMAKE_BUILD_TYPE Release)
5051

52+
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
5153
set(FLUIDENGINE_VERSION_MAJOR 0)
52-
set(FLUIDENGINE_VERSION_MINOR 2)
54+
set(FLUIDENGINE_VERSION_MINOR 3)
5355
set(FLUIDENGINE_VERSION_REVISION 0)
54-
set(FLUIDENGINE_VERSION_LABEL "0.2.0 Demo 25-NOV-2021")
56+
set(FLUIDENGINE_VERSION_DATE "11-MAR-2022")
57+
58+
if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
59+
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
60+
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD_PYTHON "True")
61+
else()
62+
set(FLUIDENGINE_VERSION_TYPE_LABEL "Experimental")
63+
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD_PYTHON "False")
64+
endif()
65+
66+
set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_MAJOR}.${FLUIDENGINE_VERSION_MINOR}.${FLUIDENGINE_VERSION_REVISION} ${FLUIDENGINE_VERSION_TYPE_LABEL} ${FLUIDENGINE_VERSION_DATE}")
5567

5668
if(BUILD_DEBUG)
5769
set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_LABEL} (DEBUG BUILD)")
@@ -120,6 +132,10 @@ configure_file(
120132
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py.in"
121133
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py"
122134
)
135+
configure_file(
136+
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py.in"
137+
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py"
138+
)
123139

124140
# Generate kernels.cpp
125141
file(READ "src/engine/kernels/trilinearinterpolate.cl" TRILINEAR_INTERPOLATE_KERNEL_STRING)
@@ -160,16 +176,16 @@ endif()
160176
set(BLENDER_ADDON_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/flip_fluids_addon")
161177
set_output_directories("${BLENDER_ADDON_DIR}/pyfluid/lib")
162178
if(BUILD_DEBUG)
163-
add_library(blpyfluiddebug SHARED $<TARGET_OBJECTS:objects>)
179+
add_library("blpyfluiddebug${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:objects>)
164180
else()
165-
add_library(blpyfluidrelease SHARED $<TARGET_OBJECTS:objects>)
181+
add_library("blpyfluidrelease${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:objects>)
166182
endif()
167183

168184
if(WITH_OPENCL)
169185
if(BUILD_DEBUG)
170-
target_link_libraries(blpyfluiddebug "${OpenCL_LIBRARY}")
186+
target_link_libraries("blpyfluiddebug${LIBRARY_SUFFIX}" "${OpenCL_LIBRARY}")
171187
else()
172-
target_link_libraries(blpyfluidrelease "${OpenCL_LIBRARY}")
188+
target_link_libraries("blpyfluidrelease${LIBRARY_SUFFIX}" "${OpenCL_LIBRARY}")
173189
endif()
174190
endif()
175191

src/addon/__init__.py.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
bl_info = {
18-
"name" : "FLIP Fluids",
18+
"name" : "FLIP Fluids Demo @FLUIDENGINE_VERSION_MAJOR@.@FLUIDENGINE_VERSION_MINOR@.@FLUIDENGINE_VERSION_REVISION@",
1919
"description": "A FLIP Fluid Simulation Tool for Blender (v@FLUIDENGINE_VERSION_LABEL@)",
2020
"author" : "Ryan Guy <ryan.l.guy[at]gmail.com>, Dennis Fassbaender <info[at]df-videos.de>",
2121
"version" : (@FLUIDENGINE_VERSION_MAJOR@, @FLUIDENGINE_VERSION_MINOR@, @FLUIDENGINE_VERSION_REVISION@),

src/addon/bake.py

+109-1
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,15 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
809809
fluidsim.enable_whitewater_motion_blur = \
810810
__get_parameter_data(whitewater.generate_whitewater_motion_blur_data, frameno)
811811

812+
fluidsim.enable_whitewater_velocity_attribute = \
813+
__get_parameter_data(whitewater.enable_velocity_vector_attribute, frameno)
814+
815+
fluidsim.enable_whitewater_id_attribute = \
816+
__get_parameter_data(whitewater.enable_id_attribute, frameno)
817+
818+
fluidsim.enable_whitewater_lifetime_attribute = \
819+
__get_parameter_data(whitewater.enable_lifetime_attribute, frameno)
820+
812821
is_generating_whitewater = __get_parameter_data(whitewater.enable_whitewater_emission, frameno)
813822
fluidsim.enable_diffuse_particle_emission = is_generating_whitewater
814823

@@ -1012,6 +1021,8 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
10121021
__get_parameter_data(surface.enable_velocity_vector_attribute, frameno)
10131022
fluidsim.enable_surface_speed_attribute = \
10141023
__get_parameter_data(surface.enable_speed_attribute, frameno)
1024+
fluidsim.enable_surface_vorticity_attribute = \
1025+
__get_parameter_data(surface.enable_vorticity_vector_attribute, frameno)
10151026
fluidsim.enable_surface_age_attribute = \
10161027
__get_parameter_data(surface.enable_age_attribute, frameno)
10171028
fluidsim.enable_surface_color_attribute = \
@@ -1904,6 +1915,13 @@ def __write_surface_data(cache_directory, fluidsim, frameno):
19041915
with open(velocity_filepath, 'wb') as f:
19051916
f.write(filedata)
19061917

1918+
if fluidsim.enable_surface_vorticity_attribute:
1919+
vorticity_filename = "vorticity" + fstring + ".bobj"
1920+
vorticity_filepath = os.path.join(cache_directory, "bakefiles", vorticity_filename)
1921+
filedata = fluidsim.get_surface_vorticity_attribute_data()
1922+
with open(vorticity_filepath, 'wb') as f:
1923+
f.write(filedata)
1924+
19071925
if fluidsim.enable_surface_speed_attribute:
19081926
speed_filename = "speed" + fstring + ".data"
19091927
speed_filepath = os.path.join(cache_directory, "bakefiles", speed_filename)
@@ -1991,6 +2009,81 @@ def __write_whitewater_data(cache_directory, fluidsim, frameno):
19912009
with open(dust_blur_filepath, 'wb') as f:
19922010
f.write(filedata)
19932011

2012+
if fluidsim.enable_whitewater_velocity_attribute:
2013+
foam_velocity_filename = "velocityfoam" + fstring + ".wwp"
2014+
foam_velocity_filepath = os.path.join(cache_directory, "bakefiles", foam_velocity_filename)
2015+
filedata = fluidsim.get_whitewater_foam_velocity_attribute_data()
2016+
with open(foam_velocity_filepath, 'wb') as f:
2017+
f.write(filedata)
2018+
2019+
bubble_velocity_filename = "velocitybubble" + fstring + ".wwp"
2020+
bubble_velocity_filepath = os.path.join(cache_directory, "bakefiles", bubble_velocity_filename)
2021+
filedata = fluidsim.get_whitewater_bubble_velocity_attribute_data()
2022+
with open(bubble_velocity_filepath, 'wb') as f:
2023+
f.write(filedata)
2024+
2025+
spray_velocity_filename = "velocityspray" + fstring + ".wwp"
2026+
spray_velocity_filepath = os.path.join(cache_directory, "bakefiles", spray_velocity_filename)
2027+
filedata = fluidsim.get_whitewater_spray_velocity_attribute_data()
2028+
with open(spray_velocity_filepath, 'wb') as f:
2029+
f.write(filedata)
2030+
2031+
dust_velocity_filename = "velocitydust" + fstring + ".wwp"
2032+
dust_velocity_filepath = os.path.join(cache_directory, "bakefiles", dust_velocity_filename)
2033+
filedata = fluidsim.get_whitewater_dust_velocity_attribute_data()
2034+
with open(dust_velocity_filepath, 'wb') as f:
2035+
f.write(filedata)
2036+
2037+
if fluidsim.enable_whitewater_id_attribute:
2038+
foam_id_filename = "idfoam" + fstring + ".wwi"
2039+
foam_id_filepath = os.path.join(cache_directory, "bakefiles", foam_id_filename)
2040+
filedata = fluidsim.get_whitewater_foam_id_attribute_data()
2041+
with open(foam_id_filepath, 'wb') as f:
2042+
f.write(filedata)
2043+
2044+
bubble_id_filename = "idbubble" + fstring + ".wwi"
2045+
bubble_id_filepath = os.path.join(cache_directory, "bakefiles", bubble_id_filename)
2046+
filedata = fluidsim.get_whitewater_bubble_id_attribute_data()
2047+
with open(bubble_id_filepath, 'wb') as f:
2048+
f.write(filedata)
2049+
2050+
spray_id_filename = "idspray" + fstring + ".wwi"
2051+
spray_id_filepath = os.path.join(cache_directory, "bakefiles", spray_id_filename)
2052+
filedata = fluidsim.get_whitewater_spray_id_attribute_data()
2053+
with open(spray_id_filepath, 'wb') as f:
2054+
f.write(filedata)
2055+
2056+
dust_id_filename = "iddust" + fstring + ".wwi"
2057+
dust_id_filepath = os.path.join(cache_directory, "bakefiles", dust_id_filename)
2058+
filedata = fluidsim.get_whitewater_dust_id_attribute_data()
2059+
with open(dust_id_filepath, 'wb') as f:
2060+
f.write(filedata)
2061+
2062+
if fluidsim.enable_whitewater_lifetime_attribute:
2063+
foam_lifetime_filename = "lifetimefoam" + fstring + ".wwf"
2064+
foam_lifetime_filepath = os.path.join(cache_directory, "bakefiles", foam_lifetime_filename)
2065+
filedata = fluidsim.get_whitewater_foam_lifetime_attribute_data()
2066+
with open(foam_lifetime_filepath, 'wb') as f:
2067+
f.write(filedata)
2068+
2069+
bubble_lifetime_filename = "lifetimebubble" + fstring + ".wwf"
2070+
bubble_lifetime_filepath = os.path.join(cache_directory, "bakefiles", bubble_lifetime_filename)
2071+
filedata = fluidsim.get_whitewater_bubble_lifetime_attribute_data()
2072+
with open(bubble_lifetime_filepath, 'wb') as f:
2073+
f.write(filedata)
2074+
2075+
spray_lifetime_filename = "lifetimespray" + fstring + ".wwf"
2076+
spray_lifetime_filepath = os.path.join(cache_directory, "bakefiles", spray_lifetime_filename)
2077+
filedata = fluidsim.get_whitewater_spray_lifetime_attribute_data()
2078+
with open(spray_lifetime_filepath, 'wb') as f:
2079+
f.write(filedata)
2080+
2081+
dust_lifetime_filename = "lifetimedust" + fstring + ".wwf"
2082+
dust_lifetime_filepath = os.path.join(cache_directory, "bakefiles", dust_lifetime_filename)
2083+
filedata = fluidsim.get_whitewater_dust_lifetime_attribute_data()
2084+
with open(dust_lifetime_filepath, 'wb') as f:
2085+
f.write(filedata)
2086+
19942087

19952088
def __write_fluid_particle_data(cache_directory, fluidsim, frameno):
19962089
fstring = __frame_number_to_string(frameno)
@@ -2064,6 +2157,7 @@ def __get_frame_stats_dict(cstats):
20642157
stats["surfaceblur"] = __get_mesh_stats_dict(cstats.surfaceblur)
20652158
stats["surfacevelocity"] = __get_mesh_stats_dict(cstats.surfacevelocity)
20662159
stats["surfacespeed"] = __get_mesh_stats_dict(cstats.surfacespeed)
2160+
stats["surfacevorticity"] = __get_mesh_stats_dict(cstats.surfacevorticity)
20672161
stats["surfaceage"] = __get_mesh_stats_dict(cstats.surfaceage)
20682162
stats["surfacecolor"] = __get_mesh_stats_dict(cstats.surfacecolor)
20692163
stats["surfacesourceid"] = __get_mesh_stats_dict(cstats.surfacesourceid)
@@ -2075,6 +2169,18 @@ def __get_frame_stats_dict(cstats):
20752169
stats["bubbleblur"] = __get_mesh_stats_dict(cstats.bubbleblur)
20762170
stats["sprayblur"] = __get_mesh_stats_dict(cstats.sprayblur)
20772171
stats["dustblur"] = __get_mesh_stats_dict(cstats.dustblur)
2172+
stats["foamvelocity"] = __get_mesh_stats_dict(cstats.foamvelocity)
2173+
stats["bubblevelocity"] = __get_mesh_stats_dict(cstats.bubblevelocity)
2174+
stats["sprayvelocity"] = __get_mesh_stats_dict(cstats.sprayvelocity)
2175+
stats["dustvelocity"] = __get_mesh_stats_dict(cstats.dustvelocity)
2176+
stats["foamid"] = __get_mesh_stats_dict(cstats.foamid)
2177+
stats["bubbleid"] = __get_mesh_stats_dict(cstats.bubbleid)
2178+
stats["sprayid"] = __get_mesh_stats_dict(cstats.sprayid)
2179+
stats["dustid"] = __get_mesh_stats_dict(cstats.dustid)
2180+
stats["foamlifetime"] = __get_mesh_stats_dict(cstats.foamlifetime)
2181+
stats["bubblelifetime"] = __get_mesh_stats_dict(cstats.bubblelifetime)
2182+
stats["spraylifetime"] = __get_mesh_stats_dict(cstats.spraylifetime)
2183+
stats["dustlifetime"] = __get_mesh_stats_dict(cstats.dustlifetime)
20782184
stats["particles"] = __get_mesh_stats_dict(cstats.particles)
20792185
stats["obstacle"] = __get_mesh_stats_dict(cstats.obstacle)
20802186
stats["timing"] = __get_timing_stats_dict(cstats.timing)
@@ -2397,7 +2503,9 @@ def set_console_output(boolval):
23972503

23982504

23992505
def __get_addon_version():
2400-
module = sys.modules["flip_fluids_addon"]
2506+
module_dir = os.path.dirname(os.path.realpath(__file__))
2507+
module_name = os.path.basename(os.path.normpath(module_dir))
2508+
module = sys.modules[module_name]
24012509
addon_major, addon_minor, addon_revision = module.bl_info.get('version', (-1, -1, -1))
24022510
return str(addon_major) + "." + str(addon_minor) + "." + str(addon_revision)
24032511

0 commit comments

Comments
 (0)