Commit: a97d7a829f75ae6ca80d24672ea340e0c50bfbd3
Author: Sebastián Barschkis
Date:   Sun Aug 18 21:53:07 2019 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBa97d7a829f75ae6ca80d24672ea340e0c50bfbd3

Mantaflow: Addressed all issues from the review / diff

===================================================================

M       build_files/cmake/macros.cmake
M       build_files/cmake/platform/platform_apple.cmake
M       build_files/cmake/platform/platform_win32.cmake
M       intern/mantaflow/CMakeLists.txt
M       release/scripts/startup/bl_operators/object_quick_effects.py
M       source/blender/blenkernel/intern/pointcache.c
M       source/blender/editors/physics/physics_manta.c
M       source/blender/makesdna/DNA_manta_types.h

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index a094fd26042..18a0968a61c 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -482,7 +482,9 @@ function(setup_liblinks
     target_link_libraries(${target} ${ALEMBIC_LIBRARIES} ${HDF5_LIBRARIES})
   endif()
   if(WITH_MOD_MANTA)
-    target_link_libraries(${target} ${TBB_LIBRARIES})
+    if(NOT WITH_OPENMP OR NOT WITH_MANTA_OMP)
+      target_link_libraries(${target} ${TBB_LIBRARIES})
+    endif()
   endif()
   if(WITH_IMAGE_TIFF)
     target_link_libraries(${target} ${TIFF_LIBRARY})
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 8a34d0d0adf..62de7eda1f9 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -404,8 +404,10 @@ if(WITH_OPENMP)
 endif()
 
 if(WITH_MOD_MANTA)
-  set(TBB_INCLUDE_DIRS ${LIBDIR}/tbb/include)
-  set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/libtbb.a)
+  if(NOT WITH_OPENMP OR NOT WITH_MANTA_OMP)
+    set(TBB_INCLUDE_DIRS ${LIBDIR}/tbb/include)
+    set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/libtbb.a)
+  endif()
 endif()
 
 set(EXETYPE MACOSX_BUNDLE)
diff --git a/build_files/cmake/platform/platform_win32.cmake 
b/build_files/cmake/platform/platform_win32.cmake
index 10feb0bc48e..34f52fdcdc0 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -547,8 +547,10 @@ if(WITH_SYSTEM_AUDASPACE)
 endif()
 
 if(WITH_MOD_MANTA)
-  set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug 
${LIBDIR}/tbb/lib/tbb_debug.lib)
-  set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
+  if(NOT WITH_OPENMP OR NOT WITH_MANTA_OMP)
+    set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug 
${LIBDIR}/tbb/lib/tbb_debug.lib)
+    set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
+  endif()
 endif()
 
 # used in many places so include globally, like OpenGL
diff --git a/intern/mantaflow/CMakeLists.txt b/intern/mantaflow/CMakeLists.txt
index 116bd60749a..15268903dc1 100644
--- a/intern/mantaflow/CMakeLists.txt
+++ b/intern/mantaflow/CMakeLists.txt
@@ -34,13 +34,14 @@ set(MANTA_HLP
 set(MANTA_PP
   intern/manta_develop/preprocessed/tbb
 )
-add_definitions(-DTBB=1)
 
 if(WITH_OPENMP AND WITH_MANTA_OMP)
   set(MANTA_PP
     intern/manta_develop/preprocessed/omp
   )
   add_definitions(-DOPENMP=1)
+else()
+  add_definitions(-DTBB=1)
 endif()
 
 if(WITH_OPENVDB)
@@ -61,16 +62,20 @@ set(INC
   ../../source/blender/blenlib
 )
 
-if(WITH_PYTHON)
-  add_definitions(-DWITH_PYTHON)
-endif()
+# Python is always required
+add_definitions(-DWITH_PYTHON)
 
 set(INC_SYS
   ${PYTHON_INCLUDE_DIRS}
   ${ZLIB_INCLUDE_DIRS}
-  ${TBB_INCLUDE_DIRS}
 )
 
+if(NOT WITH_OPENMP OR NOT WITH_MANTA_OMP)
+  list(APPEND INC_SYS
+    ${TBB_INCLUDE_DIRS}
+  )
+endif()
+
 if(WITH_OPENVDB)
   list(APPEND INC_SYS
     ${BOOST_INCLUDE_DIR}
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py 
b/release/scripts/startup/bl_operators/object_quick_effects.py
index 99d42a68653..48c196be754 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -437,141 +437,6 @@ class QuickSmoke(ObjectModeOperator, Operator):
         return {'FINISHED'}
 
 
-class QuickFluid(ObjectModeOperator, Operator):
-    """Use selected objects in a fluid simulation"""
-    bl_idname = "object.quick_fluid"
-    bl_label = "Quick Fluid"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    style: EnumProperty(
-        name="Fluid Style",
-        items=(
-            ('INFLOW', "Inflow", ""),
-            ('BASIC', "Basic", ""),
-        ),
-        default='BASIC',
-    )
-    initial_velocity: FloatVectorProperty(
-        name="Initial Velocity",
-        description="Initial velocity of the fluid",
-        min=-100.0, max=100.0,
-        default=(0.0, 0.0, 0.0),
-        subtype='VELOCITY',
-    )
-    show_flows: BoolProperty(
-        name="Render Fluid Objects",
-        description="Keep the fluid objects visible during rendering",
-        default=False,
-    )
-    start_baking: BoolProperty(
-        name="Start Fluid Bake",
-        description=("Start baking the fluid immediately "
-                     "after creating the domain object"),
-        default=False,
-    )
-
-    def execute(self, context):
-        if not bpy.app.build_options.mod_fluid:
-            self.report({'ERROR'}, "Built without Fluid modifier support")
-            return {'CANCELLED'}
-
-        fake_context = context.copy()
-        mesh_objects = [obj for obj in context.selected_objects
-                        if (obj.type == 'MESH' and 0.0 not in obj.dimensions)]
-        min_co = Vector((100000.0, 100000.0, 100000.0))
-        max_co = -min_co
-
-        if not mesh_objects:
-            self.report({'ERROR'}, "Select at least one mesh object")
-            return {'CANCELLED'}
-
-        for obj in mesh_objects:
-            fake_context["object"] = obj
-            # make each selected object a fluid
-            bpy.ops.object.modifier_add(fake_context, type='FLUID_SIMULATION')
-
-            # fluid has to be before constructive modifiers,
-            # so it might not be the last modifier
-            for mod in obj.modifiers:
-                if mod.type == 'FLUID_SIMULATION':
-                    break
-
-            if self.style == 'INFLOW':
-                mod.settings.type = 'INFLOW'
-                mod.settings.inflow_velocity = self.initial_velocity
-            else:
-                mod.settings.type = 'FLUID'
-                mod.settings.initial_velocity = self.initial_velocity
-
-            obj.hide_render = not self.show_flows
-            if not self.show_flows:
-                obj.display_type = 'WIRE'
-
-            # store bounding box min/max for the domain object
-            obj_bb_minmax(obj, min_co, max_co)
-
-        # add the fluid domain object
-        bpy.ops.mesh.primitive_cube_add()
-        obj = context.active_object
-        obj.name = "Fluid Domain"
-
-        # give the fluid some room below the flows
-        # and scale with initial velocity
-        v = 0.5 * self.initial_velocity
-        obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, -1.0)) + v
-        obj.scale = (
-            0.5 * (max_co - min_co) +
-            Vector((1.0, 1.0, 2.0)) +
-            Vector((abs(v[0]), abs(v[1]), abs(v[2])))
-        )
-
-        # setup smoke domain
-        bpy.ops.object.modifier_add(type='FLUID_SIMULATION')
-        obj.modifiers[-1].settings.type = 'DOMAIN'
-
-        # make the domain smooth so it renders nicely
-        bpy.ops.object.shade_smooth()
-
-        # create a ray-transparent material for the domain
-        bpy.ops.object.material_slot_add()
-
-        mat = bpy.data.materials.new("Fluid Domain Material")
-        obj.material_slots[0].material = mat
-
-        # Make sure we use nodes
-        mat.use_nodes = True
-
-        # Set node variables and clear the default nodes
-        tree = mat.node_tree
-        nodes = tree.nodes
-        links = tree.links
-
-        nodes.clear()
-
-        # Create shader nodes
-
-        # Material output
-        node_out = nodes.new(type='ShaderNodeOutputMaterial')
-        node_out.location = grid_location(6, 1)
-
-        # Add Glass
-        node_glass = nodes.new(type='ShaderNodeBsdfGlass')
-        node_glass.location = grid_location(4, 1)
-        links.new(node_glass.outputs["BSDF"], node_out.inputs["Surface"])
-        node_glass.inputs["IOR"].default_value = 1.33
-
-        # Add Absorption
-        node_absorption = nodes.new(type='ShaderNodeVolumeAbsorption')
-        node_absorption.location = grid_location(4, 2)
-        links.new(node_absorption.outputs["Volume"], node_out.inputs["Volume"])
-        node_absorption.inputs["Color"].default_value = (0.8, 0.9, 1.0, 1.0)
-
-        if self.start_baking:
-            bpy.ops.fluid.bake('INVOKE_DEFAULT')
-
-        return {'FINISHED'}
-
-
 class QuickLiquid(Operator):
     bl_idname = "object.quick_liquid"
     bl_label = "Quick Liquid"
@@ -681,7 +546,6 @@ class QuickLiquid(Operator):
 
 classes = (
     QuickExplode,
-    QuickFluid,
     QuickFur,
     QuickSmoke,
     QuickLiquid,
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index ff51c6f5f19..cd5ed381da1 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1737,17 +1737,14 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct 
Object *ob, struct MantaMo
 
   if (mds->fluid) {
     pid->data_types |= (1 << BPHYS_DATA_SMOKE_LOW);
-    //  (sebbas): Option deprecated in manta cache
-    //  if (mds->wt) {
-    //      pid->data_types |= (1<<BPHYS_DATA_SMOKE_HIGH);
-    //  }
+      if (mds->flags & FLUID_DOMAIN_USE_NOISE) {
+        pid->data_types |= (1<<BPHYS_DATA_SMOKE_HIGH);
+      }
   }
 
   pid->default_step = 1;
   pid->max_step = 1;
-
-  //  (sebbas): Option deprecated in manta cache
-  //  pid->file_type = mmd->domain->cache_file_format;
+  pid->file_type = mmd->domain->cache_file_format;
 }
 
 void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, 
DynamicPaintSurface *surface)
diff --git a/source/blender/editors/physics/physics_manta.c 
b/source/blender/editors/physics/physics_manta.c
index 1b215ca2aa6..4fdbe15d808 100644
--- a/source/blender/editors/physics/physics_manta.c
+++ b/source/blender/editors/physics/physics_manta.c
@@ -73,7 +73,7 @@
 #include "DNA_manta_types.h"
 #include "DNA_mesh_types.h"
 
-typedef struct FluidMantaflowJob {
+typedef struct MantaJob {
   /* from wmJob */
   void *owner;
   short *stop, *do_update;
@@ -92,11 +92,11 @@ typedef struct FluidMantaflowJob {
   double start;
 
   int *pause_frame;
-} FluidMantaflowJob;
+} MantaJob;
 
 
-static bool fluid_manta_initjob(
-    bContext *C, FluidMantaflowJob *job, wmOperator *op, char *error_msg, int 
error_size)
+static bool manta_initjob(
+    bContext *C, MantaJob *job, wmOperator *op, char *error_msg, int 
error_size)
 {
   MantaModifierData *mmd = NULL;
   MantaDomainSettings *mds;
@@ -124,7 +124,7 @@ static bool 

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to