Skip to content

Commit

Permalink
new demo version 0.8.1!
Browse files Browse the repository at this point in the history
  • Loading branch information
rlguy committed Jul 15, 2024
1 parent 29fd16c commit 4d5ab9a
Show file tree
Hide file tree
Showing 21 changed files with 570 additions and 307 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
src/engine/kernels/kernels.cpp
src/engine/versionutils.cpp
src/addon/__init__.py
src/addon/blender_manifest.toml
src/addon/utils/installation_utils.py
CMakeLists.txt
build
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,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.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)

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)!
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)
2. **Install** the FLIP Fluids Demo: [Installation Instructions](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Addon-Installation-and-Uninstallation)
3. **Get Started** with creating your first FLIP Fluids addon simulation:
- [Video Learning Series](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Video-Learning-Series)
- [Written Beginners Guide](https://github.com/rlguy/Blender-FLIP-Fluids/wiki/Creating-Your-First-FLIP-Fluids-Simulation)
- [Documentation and Wiki](https://github.com/rlguy/Blender-FLIP-Fluids/wiki)

### Have any questions?

Expand Down
25 changes: 15 additions & 10 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)

function(set_output_directories DIR)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DIR} PARENT_SCOPE)
Expand All @@ -33,7 +33,7 @@ endfunction(set_output_directories)

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

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

Expand All @@ -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 8)
set(FLUIDENGINE_VERSION_REVISION 0)
set(FLUIDENGINE_VERSION_DATE "21-MAY-2024")
set(FLUIDENGINE_VERSION_REVISION 1)
set(FLUIDENGINE_VERSION_DATE "16-JUL-2024")

if(FLUIDENGINE_VERSION_TYPE_IS_STABLE_BUILD)
set(FLUIDENGINE_VERSION_TYPE_LABEL "Demo")
Expand Down Expand Up @@ -143,6 +143,10 @@ configure_file(
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py.in"
"${PROJECT_SOURCE_DIR}/src/addon/__init__.py"
)
configure_file(
"${PROJECT_SOURCE_DIR}/src/addon/blender_manifest.toml.in"
"${PROJECT_SOURCE_DIR}/src/addon/blender_manifest.toml"
)
configure_file(
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py.in"
"${PROJECT_SOURCE_DIR}/src/addon/utils/installation_utils.py"
Expand Down Expand Up @@ -204,17 +208,18 @@ file(COPY "${CMAKE_SOURCE_DIR}/src/addon/" DESTINATION "${BLENDER_ADDON_DIR}")
file(COPY "${CMAKE_SOURCE_DIR}/src/engine/pyfluid/" DESTINATION "${BLENDER_ADDON_DIR}/pyfluid")

if(DISTRIBUTE_SOURCE)
set(SOURCE_COPY_PATHS
"${CMAKE_SOURCE_DIR}/src"
set(SOURCES_ARCHIVE_ROOT
"${CMAKE_SOURCE_DIR}/__init__.py"
"${CMAKE_SOURCE_DIR}/build.py"
"${CMAKE_SOURCE_DIR}/.gitignore"
"${CMAKE_SOURCE_DIR}/LICENSE_GPLv3.md"
"${CMAKE_SOURCE_DIR}/LICENSE_MIT.md"
"${CMAKE_SOURCE_DIR}/LICENSE_Standard_Royalty_Free.md"
"${CMAKE_SOURCE_DIR}/README.md"
"${CMAKE_SOURCE_DIR}/__init__.py"
)

foreach(SOURCE_PATH ${SOURCE_COPY_PATHS})
file(COPY "${SOURCE_PATH}" DESTINATION "${BLENDER_ADDON_DIR}/source/")
endforeach(SOURCE_PATH)
file(GLOB_RECURSE SOURCES_ARCHIVE "${CMAKE_SOURCE_DIR}/src/*" "${CMAKE_SOURCE_DIR}/cmake/*")
list (APPEND SOURCES_ARCHIVE ${SOURCES_ARCHIVE_ROOT})
file(MAKE_DIRECTORY ${BLENDER_ADDON_DIR}/source)
file(ARCHIVE_CREATE OUTPUT "${BLENDER_ADDON_DIR}/source/flip_fluids_addon_source.zip" PATHS ${SOURCES_ARCHIVE} FORMAT "zip")
endif()
15 changes: 11 additions & 4 deletions src/addon/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from .objects import flip_fluid_geometry_database
from .operators import bake_operators
from .filesystem import filesystem_protection_layer as fpl
from .utils import version_compatibility_utils as vcu
from . import bl_info

from .pyfluid import (
pyfluid,
Expand Down Expand Up @@ -3098,10 +3100,15 @@ def set_console_output(boolval):


def __get_addon_version():
module_dir = os.path.dirname(os.path.realpath(__file__))
module_name = os.path.basename(os.path.normpath(module_dir))
module = sys.modules[module_name]
addon_major, addon_minor, addon_revision = module.bl_info.get('version', (-1, -1, -1))
if vcu.is_blender_42():
bl_info_dict = bl_info
else:
module_dir = os.path.dirname(os.path.realpath(__file__))
module_name = os.path.basename(os.path.normpath(module_dir))
module = sys.modules[module_name]
bl_info_dict = module.bl_info

addon_major, addon_minor, addon_revision = bl_info_dict.get('version', (-1, -1, -1))
return str(addon_major) + "." + str(addon_minor) + "." + str(addon_revision)


Expand Down
17 changes: 17 additions & 0 deletions src/addon/blender_manifest.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
schema_version = "1.0.0"

id = "flip_fluids_addon"
type = "add-on"
version = "@FLUIDENGINE_VERSION_MAJOR@.@FLUIDENGINE_VERSION_MINOR@.@FLUIDENGINE_VERSION_REVISION@"
name = "FLIP Fluids"
tagline = "A FLIP Fluid Simulation Tool for Blender (v@FLUIDENGINE_VERSION_LABEL@)"
maintainer = "Ryan Guy & Dennis Fassbaender // support@flipfluids.com"
website = "https://github.com/rlguy/Blender-FLIP-Fluids/wiki"
tags = ["Animation", "Physics"]
blender_version_min = "4.2.0"
license = ["SPDX:GPL-3.0-or-later"]
platforms = ["windows-x64", "macos-x64", "macos-arm64", "linux-x64"]

[permissions]
files = "Read and write simulation cache files to the filesystem"
clipboard = "Copy and paste render and bake commands"
43 changes: 30 additions & 13 deletions src/addon/operators/command_line_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,25 @@

### PREPARE VISIBLITY SETTINGS FOR PASSES ###

def transfer_catchers_to_catcher_list(hprops):
# Leere die bestehende Catcher-Liste
hprops.render_passes_catcherlist.clear()

# Übertrage die Catcher-Objekte in die Catcher-Liste
for obj_prop in hprops.render_passes_objectlist:
if obj_prop.catcher:
new_catcher = hprops.render_passes_catcherlist.add()
new_catcher.name = obj_prop.name
new_catcher.catcher = obj_prop.catcher

def apply_visibility_settings_for_pass(pass_name):
visibility_settings = render_passes.visibility_settings
settings = visibility_settings.get(pass_name, {})
hprops = bpy.context.scene.flip_fluid_helper

# Übertrage Catcher-Objekte in die Catcher-Liste im Hintergrund
transfer_catchers_to_catcher_list(hprops)

print(f"Applying settings for pass: {pass_name}")
print(f"Settings being applied: {settings}")

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

if "catchers" in settings:
catcher_list_settings = settings["catchers"]
print(f"Settings for 'catchers' in pass '{pass_name}': {catcher_list_settings}")
for catcher_prop in hprops.render_passes_catcherlist:
catcher = bpy.data.objects.get(catcher_prop.name)
if catcher:
print(f"Applying '{pass_name}' settings to catcher {catcher_prop.name}")
apply_visibility_settings_for_object(catcher, catcher_list_settings)
else:
print(f"Catcher object not found in Blender: {catcher_prop.name}")

def apply_film_transparency(film_transparent):
bpy.context.scene.render.film_transparent = film_transparent
print(f"Film transparency set to: {film_transparent}")
Expand All @@ -82,7 +107,7 @@ def apply_visibility_settings_for_world(world, world_settings):
print("No world found in the current scene.")
return

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

#def apply_render_output_path_for_pass(suffix):
# render_output = bpy.context.scene.render.filepath
# render_output = render_output.replace('\\', '/')
# render_output_prefix = bpy.path.basename(render_output)
# render_output_directory = render_output.removesuffix(render_output_prefix)
# new_render_output_path = render_output_directory + suffix + "/" + render_output_prefix
# if render_output_prefix:
# new_render_output_path += suffix + "_"
# bpy.context.scene.render.filepath = new_render_output_path


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

pass_suffixes = [
("catchers_only", props.render_passes_catchers_only),
("objects_only", props.render_passes_objects_only),
("fluidparticles_only", props.render_passes_fluidparticles_only),
("fluid_only", props.render_passes_fluid_only),
Expand Down Expand Up @@ -173,18 +191,17 @@ def prepare_render_passes_blend_files():
for filename in files_to_remove:
blend_filepath = os.path.join(blend_file_directory, filename)

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


def apply_render_output_path_for_pass(suffix, number, base_file_name):
# Der Pfad zum Render-Verzeichnis
Expand Down
Loading

0 comments on commit 4d5ab9a

Please sign in to comment.