Skip to content

Commit 0c1fd9a

Browse files
committed
new demo version 1.8.4!
1 parent 040615c commit 0c1fd9a

File tree

97 files changed

+2425
-6797
lines changed

Some content is hidden

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

97 files changed

+2425
-6797
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
src/engine/kernels/kernels.cpp
21
src/engine/versionutils.cpp
32
src/addon/__init__.py
43
src/addon/blender_manifest.toml
54
src/addon/utils/installation_utils.py
6-
CMakeLists.txt
7-
build
5+
/build
86
.DS_Store
Lines changed: 102 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#[[
2+
MIT License
3+
24
Copyright (C) 2025 Ryan L. Guy & Dennis Fassbaender
35
46
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2022
SOFTWARE.
2123
]]
2224

23-
cmake_minimum_required(VERSION 3.5)
25+
cmake_minimum_required(VERSION 3.5...4.0.2)
2426

2527
function(set_output_directories DIR)
2628
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DIR} PARENT_SCOPE)
@@ -31,30 +33,29 @@ function(set_output_directories DIR)
3133
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DIR} PARENT_SCOPE)
3234
endfunction(set_output_directories)
3335

34-
set(BUILD_DEBUG OFF CACHE BOOL "Turn on to build a debug release")
36+
include(CheckLinkerFlag)
3537

36-
# Disable distribute source (ON -> OFF) to speed up build. Remember to
37-
# turn back on before distribution!
38+
# Build Options
39+
set(BUILD_DEBUG OFF CACHE BOOL "Turn on to build a debug release")
3840
option(DISTRIBUTE_SOURCE "Include source code in addon" ON)
39-
40-
option(WITH_OPENCL "Compile project with OpenCL features" OFF)
41-
option(WITH_ENGINE_TEST "Compile engine test executable" OFF)
42-
option(WITH_PYFLUID_MODULE "Compile pyfluid Python module" OFF)
4341
option(WITH_MIXBOX "Compile with Mixbox pigment mixing feature" OFF)
44-
SET(LIBRARY_SUFFIX "" CACHE STRING "Optional suffix to add to the end of the library name")
45-
46-
if(APPLE)
47-
set(MACOSX_DEPLOYMENT_TARGET 10.10)
48-
endif()
42+
set(LIBRARY_SUFFIX "" CACHE STRING "Optional suffix to add to the end of the library name")
4943

44+
# Configure Project
5045
project(bl_flip_fluids)
5146
set(CMAKE_BUILD_TYPE Release)
47+
if(APPLE)
48+
set(MACOSX_DEPLOYMENT_TARGET 10.10) # OS X Yosemite
49+
endif()
5250

51+
# Set Version Info
5352
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD TRUE)
54-
set(FLUIDENGINE_VERSION_MAJOR 0)
53+
set(FLUIDENGINE_VERSION_MAJOR 1)
5554
set(FLUIDENGINE_VERSION_MINOR 8)
56-
set(FLUIDENGINE_VERSION_REVISION 3)
57-
set(FLUIDENGINE_VERSION_DATE "21-MAR-2025")
55+
set(FLUIDENGINE_VERSION_REVISION 4)
56+
set(FLUIDENGINE_VERSION_DATE_YYYY "2025")
57+
set(FLUIDENGINE_VERSION_DATE_MM "07")
58+
set(FLUIDENGINE_VERSION_DATE_DD "14")
5859

5960
if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
6061
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
@@ -64,11 +65,10 @@ else()
6465
set(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD_PYTHON "False")
6566
endif()
6667

68+
set(FLUIDENGINE_VERSION_DATE "${FLUIDENGINE_VERSION_DATE_YYYY}-${FLUIDENGINE_VERSION_DATE_MM}-${FLUIDENGINE_VERSION_DATE_DD}")
6769
set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_MAJOR}.${FLUIDENGINE_VERSION_MINOR}.${FLUIDENGINE_VERSION_REVISION} ${FLUIDENGINE_VERSION_TYPE_LABEL} ${FLUIDENGINE_VERSION_DATE}")
68-
#if(BUILD_DEBUG)
69-
# set(FLUIDENGINE_VERSION_LABEL "${FLUIDENGINE_VERSION_LABEL} (DEBUG BUILD)")
70-
#endif()
7170

71+
# Begin Build
7272
message(STATUS "FLIP Fluids version ${FLUIDENGINE_VERSION_LABEL}")
7373
if(BUILD_DEBUG)
7474
message(STATUS "Building in debug mode")
@@ -87,54 +87,45 @@ else()
8787
set(MIXBOX_SOURCE_CPP "src/engine/mixbox/mixbox_stub.cpp")
8888
endif()
8989

90-
# Configure OpenCL
91-
if(WITH_OPENCL)
92-
find_package(OpenCL)
93-
if(NOT OpenCL_FOUND)
94-
message(WARNING "WARNING: OpenCL was not found on your system.\nInstall an OpenCL SDK specific to your GPU vender (AMD, NVIDIA, Intel, etc.). This project will be built with OpenCL features disabled.")
95-
set(WITH_OPENCL OFF)
96-
endif()
97-
endif()
98-
99-
if(WITH_OPENCL)
100-
if(MSVC OR MINGW)
101-
# Set to OpenCL ICD loader instead of vendor library
102-
set(OpenCL_LIBRARY "C:/Windows/System32/OpenCL.dll")
103-
endif()
104-
105-
# Allows use os clCreateCommandQueue in OpenCL versions >= 2.0
106-
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
107-
108-
add_definitions(-DWITH_OPENCL=1)
109-
include_directories(src ${OpenCL_INCLUDE_DIRS})
110-
else()
111-
add_definitions(-DWITH_OPENCL=0)
112-
endif()
113-
114-
# Configure compiler/OS specific flags
90+
# Configure Compiler/OS Specific Flags
11591
if(MSVC)
11692
message(FATAL_ERROR "Error: Compilation using MSVC (Microsoft Visual Studio) is not supported. Building with MSVC will result in errors, performance issues, and broken simulation features. Change this FATAL_ERROR to WARNING in the CMake script to continue at your own risk.")
117-
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
93+
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
11894
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W4 /EHsc /wd4244")
11995
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
12096
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
12197
elseif(MINGW)
122-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++ -fopenmp -O3 -std=c++11 -Wall")
98+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++ -fopenmp -O3 -std=c++17 -Wall")
12399
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
124100
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
125101
elseif(APPLE)
126102
set(CMAKE_MACOSX_RPATH ON)
127-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++11 -Wall -Wno-return-type-c-linkage")
128-
else()
129-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -fopenmp -O3 -std=c++11 -Wall -fPIC -pthread")
103+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -Wall -Wno-return-type-c-linkage")
104+
105+
# Older compiler versions may not support or require -lstdc++fs linker flag
106+
check_linker_flag(CXX "-lstdc++fs" LINKER_SUPPORTS_FILESYSTEM)
107+
if(LINKER_SUPPORTS_FILESYSTEM)
108+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs")
109+
endif()
110+
elseif(UNIX AND NOT APPLE)
111+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -lstdc++fs -D_GLIBCXX_USE_NANOSLEEP -fopenmp -O3 -Wall -fPIC -pthread")
130112
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${PROJECT_SOURCE_DIR}/src/engine/glibc_version_header/force_link_glibc_2.5.h")
113+
else()
114+
message(FATAL_ERROR "Target OS/Compiler is not recognized.")
131115
endif()
132116

133117
if(BUILD_DEBUG)
134118
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBUILD_DEBUG")
135119
endif()
136120

137-
# Configure Version
121+
# Write Compiler Info
122+
set(COMPILER_DATA_DIRECTORY "${CMAKE_BINARY_DIR}/bl_flip_fluids/flip_fluids_addon/resources/compiler_data/")
123+
set(COMPILER_DATA_FILENAME "${CMAKE_SYSTEM_NAME}_${CMAKE_CXX_COMPILER_ID}_${CMAKE_CXX_COMPILER_VERSION}.txt")
124+
string(TIMESTAMP COMPILER_TIMSTAMP "%Y-%m-%d %H:%M:%S %z")
125+
set(COMPILER_INFO "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} ${CMAKE_COMPILER_IS_GNUCXX} ${COMPILER_TIMSTAMP}")
126+
file(WRITE "${COMPILER_DATA_DIRECTORY}/${COMPILER_DATA_FILENAME}" "${COMPILER_INFO}")
127+
128+
# Configure Files
138129
configure_file(
139130
"${PROJECT_SOURCE_DIR}/src/engine/versionutils.cpp.in"
140131
"${PROJECT_SOURCE_DIR}/src/engine/versionutils.cpp"
@@ -152,74 +143,87 @@ configure_file(
152143
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py"
153144
)
154145

155-
# Generate kernels.cpp
156-
file(READ "src/engine/kernels/trilinearinterpolate.cl" TRILINEAR_INTERPOLATE_KERNEL_STRING)
157-
file(READ "src/engine/kernels/scalarfield.cl" SCALAR_FIELD_KERNEL_STRING)
158-
configure_file(
159-
"${PROJECT_SOURCE_DIR}/src/engine/kernels/kernels.cpp.in"
160-
"${PROJECT_SOURCE_DIR}/src/engine/kernels/kernels.cpp"
161-
)
146+
# Configure Output Directories
147+
set(BLENDER_ADDON_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/flip_fluids_addon")
148+
set_output_directories("${BLENDER_ADDON_DIR}/ffengine/lib")
162149

163-
# Object library
164-
file(GLOB SOURCES "src/engine/*.cpp" "src/engine/c_bindings/*.cpp" "src/engine/kernels/*.cpp" "src/engine/opencl_bindings/*.cpp" ${MIXBOX_SOURCE_CPP})
165-
add_library(objects OBJECT ${SOURCES})
150+
# Alembic Exporter
151+
set(CMAKE_SKIP_BUILD_RPATH FALSE)
152+
set(CMAKE_INSTALL_RPATH "@executable_path")
166153

167-
if(WITH_ENGINE_TEST)
168-
# Test executable
169-
set(TEST_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/test")
170-
set_output_directories("${TEST_DIR}")
171-
add_executable(bl_flip_fluids $<TARGET_OBJECTS:objects>)
172-
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "engine_test")
173-
if(WITH_OPENCL)
174-
target_link_libraries(bl_flip_fluids "${OpenCL_LIBRARY}")
175-
endif()
154+
if(ALEMBIC_PACKAGE_ROOT)
155+
message(STATUS "Using ALEMBIC_PACKAGE_ROOT=" ${ALEMBIC_PACKAGE_ROOT})
156+
find_package(Alembic REQUIRED PATHS ${ALEMBIC_PACKAGE_ROOT} NO_DEFAULT_PATH)
157+
else()
158+
find_package(Alembic REQUIRED)
176159
endif()
177160

178-
if(WITH_PYFLUID_MODULE)
179-
# Pyfluid library
180-
set(PYTHON_MODULE_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/pyfluid")
181-
set(PYTHON_MODULE_LIB_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/pyfluid/lib")
182-
set_output_directories("${PYTHON_MODULE_LIB_DIR}")
183-
add_library(pyfluid SHARED $<TARGET_OBJECTS:objects>)
184-
if(WITH_OPENCL)
185-
target_link_libraries(pyfluid "${OpenCL_LIBRARY}")
186-
endif()
187-
file(COPY "${CMAKE_SOURCE_DIR}/src/engine/pyfluid/" DESTINATION "${PYTHON_MODULE_DIR}")
188-
endif()
161+
file(GLOB ALEMBIC_IO_SOURCES "src/alembic_io/src/*.cpp")
189162

190-
# Blender addon
191-
set(BLENDER_ADDON_DIR "${CMAKE_BINARY_DIR}/bl_flip_fluids/flip_fluids_addon")
192-
set_output_directories("${BLENDER_ADDON_DIR}/pyfluid/lib")
193-
if(BUILD_DEBUG)
194-
add_library("blpyfluiddebug${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:objects>)
195-
else()
196-
add_library("blpyfluidrelease${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:objects>)
197-
endif()
163+
add_library(alembic_io_objects OBJECT ${ALEMBIC_IO_SOURCES})
164+
set_target_properties(alembic_io_objects PROPERTIES INSTALL_RPATH "@executable_path")
165+
set_target_properties(alembic_io_objects PROPERTIES BUILD_RPATH "@executable_path")
166+
target_link_libraries(alembic_io_objects PUBLIC Alembic::Alembic)
167+
target_compile_features(alembic_io_objects PRIVATE cxx_std_17)
198168

199-
if(WITH_OPENCL)
200-
if(BUILD_DEBUG)
201-
target_link_libraries("blpyfluiddebug${LIBRARY_SUFFIX}" "${OpenCL_LIBRARY}")
202-
else()
203-
target_link_libraries("blpyfluidrelease${LIBRARY_SUFFIX}" "${OpenCL_LIBRARY}")
204-
endif()
169+
if(MSVC OR MSYS OR MINGW)
170+
set(ALEMBIC_EXECUTABLE_NAME "ff_alembic_exporter_windows")
171+
elseif(APPLE)
172+
set(ALEMBIC_EXECUTABLE_NAME "ff_alembic_exporter_macos")
173+
elseif(UNIX AND NOT APPLE)
174+
set(ALEMBIC_EXECUTABLE_NAME "ff_alembic_exporter_linux")
205175
endif()
206176

177+
add_executable(${ALEMBIC_EXECUTABLE_NAME} $<TARGET_OBJECTS:alembic_io_objects>)
178+
set_target_properties(${ALEMBIC_EXECUTABLE_NAME} PROPERTIES INSTALL_RPATH "@executable_path")
179+
set_target_properties(${ALEMBIC_EXECUTABLE_NAME} PROPERTIES BUILD_RPATH "@executable_path")
180+
target_link_libraries(${ALEMBIC_EXECUTABLE_NAME} PUBLIC Alembic::Alembic)
181+
182+
# Alembic IO Engine Objects
183+
file(GLOB ALEMBIC_IO_LIBRARY_SOURCES
184+
"src/engine/*.cpp"
185+
"src/engine/c_bindings/*.cpp"
186+
"src/alembic_io/src/alembic_io.cpp"
187+
"src/alembic_io/src/c_bindings/*.cpp"
188+
${MIXBOX_SOURCE_CPP})
189+
190+
add_library(alembic_objects OBJECT ${ALEMBIC_IO_LIBRARY_SOURCES})
191+
target_link_libraries(alembic_objects PUBLIC Alembic::Alembic)
192+
target_compile_features(alembic_objects PRIVATE cxx_std_17)
193+
194+
# Alembic IO Engine Library
195+
add_library("ffalembicengine${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:alembic_objects>)
196+
target_link_libraries("ffalembicengine${LIBRARY_SUFFIX}" PUBLIC Alembic::Alembic)
197+
198+
# FLIP Fluids Engine Objects
199+
file(GLOB SOURCES
200+
"src/engine/*.cpp"
201+
"src/engine/c_bindings/*.cpp"
202+
${MIXBOX_SOURCE_CPP})
203+
add_library(objects OBJECT ${SOURCES})
204+
205+
# FLIP Fluids Engine Library
206+
add_library("ffengine${LIBRARY_SUFFIX}" SHARED $<TARGET_OBJECTS:objects>)
207+
208+
# Copy Libraries To Addon
207209
file(COPY "${CMAKE_SOURCE_DIR}/src/addon/" DESTINATION "${BLENDER_ADDON_DIR}")
208-
file(COPY "${CMAKE_SOURCE_DIR}/src/engine/pyfluid/" DESTINATION "${BLENDER_ADDON_DIR}/pyfluid")
210+
file(COPY "${CMAKE_SOURCE_DIR}/src/engine/ffengine/" DESTINATION "${BLENDER_ADDON_DIR}/ffengine")
209211

212+
# Package Sources
210213
if(DISTRIBUTE_SOURCE)
211214
set(SOURCES_ARCHIVE_ROOT
215+
"${CMAKE_SOURCE_DIR}/.gitignore"
212216
"${CMAKE_SOURCE_DIR}/__init__.py"
213217
"${CMAKE_SOURCE_DIR}/build.py"
214-
"${CMAKE_SOURCE_DIR}/.gitignore"
218+
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
215219
"${CMAKE_SOURCE_DIR}/LICENSE_GPLv3.md"
216220
"${CMAKE_SOURCE_DIR}/LICENSE_MIT.md"
217221
"${CMAKE_SOURCE_DIR}/LICENSE_Standard_Royalty_Free.md"
218222
"${CMAKE_SOURCE_DIR}/README.md"
219223
)
220224

221-
file(GLOB_RECURSE SOURCES_ARCHIVE "${CMAKE_SOURCE_DIR}/src/*" "${CMAKE_SOURCE_DIR}/cmake/*")
225+
file(GLOB_RECURSE SOURCES_ARCHIVE "${CMAKE_SOURCE_DIR}/src/*")
222226
list (APPEND SOURCES_ARCHIVE ${SOURCES_ARCHIVE_ROOT})
223227
file(MAKE_DIRECTORY ${BLENDER_ADDON_DIR}/source)
224228
file(ARCHIVE_CREATE OUTPUT "${BLENDER_ADDON_DIR}/source/flip_fluids_addon_source.zip" PATHS ${SOURCES_ARCHIVE} FORMAT "zip")
225-
endif()
229+
endif()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h
1111

1212
### Getting Started
1313

14-
1. **Download** the latest FLIP Fluids Demo: [FLIP_Fluids_addon_0.8.3_demo_(21_mar_2025.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v0.8.3/FLIP_Fluids_addon_0.8.3_demo_.21_mar_2025.zip)
14+
1. **Download** the latest FLIP Fluids Demo: [FLIP_Fluids_addon_1.8.4_demo_(2025-07-14.zip)](https://github.com/rlguy/Blender-FLIP-Fluids/releases/download/v1.8.3/FLIP_Fluids_addon_1.8.3_demo_.2025-07-14.zip)
1515
2. **Install** the FLIP Fluids Demo: [Installation Instructions](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Addon-Installation-and-Uninstallation)
1616
3. **Get Started** with creating your first FLIP Fluids addon simulation:
1717
- [Video Learning Series](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Video-Learning-Series)
@@ -20,4 +20,4 @@ Want to try the FLIP Fluids addon before buying the [full marketplace product](h
2020

2121
### Have any questions?
2222

23-
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, or join the [FLIP Fluids Discord server](https://discord.gg/FLIPFluids). We're always glad to help!
23+
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, or join the [FLIP Fluids Discord server](https://discord.gg/FLIPFluids). We're always glad to help!

__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def draw(self, context):
5757
).url = "https://github.com/rlguy/Blender-FLIP-Fluids/wiki/FLIP-Fluids-Demo-Addon"
5858
column.operator(
5959
"wm.url_open",
60-
text="Purchase the FLIP Fluids addon on the Blender Market",
61-
).url = "https://blendermarket.com/products/flipfluids?ref=2685"
60+
text="Purchase the FLIP Fluids addon on Superhive",
61+
).url = "https://superhivemarket.com/products/flipfluids?ref=2685"
6262
column.operator(
6363
"wm.url_open",
6464
text="Purchase the FLIP Fluids addon on Gumroad",

0 commit comments

Comments
 (0)