Commit: 9ff1ebed52e0f858a395eeea4caf89304e068b2d
Author: Daniel Genrich
Date:   Thu Oct 23 15:12:28 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rB9ff1ebed52e0f858a395eeea4caf89304e068b2d

Merge remote-tracking branch 'origin/master' into soc-2014-fluid

Conflicts:
        .gitignore
        intern/cycles/CMakeLists.txt
        source/blender/blenkernel/intern/smoke.c
        source/blender/python/intern/bpy_interface.c
        source/creator/CMakeLists.txt

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



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

diff --cc .gitignore
index f5b00f4,b172c44..78ac65a
--- a/.gitignore
+++ b/.gitignore
@@@ -26,11 -26,9 +26,14 @@@ Desktop.in
  # local patches
  /*.patch
  /*.diff
--
- .gitignore
+ # in-source doc-gen
+ /doc/doxygen/html/
+ /doc/python_api/sphinx-in-tmp/
+ /doc/python_api/sphinx-in/
 -/doc/python_api/sphinx-out/
++/doc/python_api/sphinx-out/.gitignore
 +Roman_Pogribnyi/
 +Roman_Pogribnyi.tar.gz
 +Archive.zip
 +Roman_Pogribnyi 2/
 +make_diffs.txt
- series
++series
diff --cc CMakeLists.txt
index 05a8c99,497abb3..c412057
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -2189,11 -2434,15 +2463,15 @@@ if(CMAKE_COMPILER_IS_GNUCC
  
  elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
  
+       if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to 
not fail all tests due presence of -fopenmp !
+               set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # 
these are only used for the checks
+       endif()
+ 
        # strange, clang complains these are not supported, but then yses them.
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
 -      ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS 
C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
 -      ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS 
C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION 
-Werror=implicit-function-declaration)
 -      ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE  
-Werror=return-type)
 +#     ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS 
C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
 +#     ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS 
C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION 
-Werror=implicit-function-declaration)
 +#     ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE  
-Werror=return-type)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_AUTOLOGICAL_COMPARE 
-Wno-tautological-compare)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS 
-Wno-unknown-pragmas)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS 
-Wno-char-subscripts)
diff --cc intern/smoke/CMakeLists.txt
index 1ca8701,8cda0fd..be0c621
--- a/intern/smoke/CMakeLists.txt
+++ b/intern/smoke/CMakeLists.txt
@@@ -30,11 -30,9 +30,11 @@@ set(IN
  
  set(INC_SYS
        ${BULLET_INCLUDE_DIRS}
-       ${PNG_INCLUDE_DIR}
+       ${PNG_INCLUDE_DIRS}
        ${ZLIB_INCLUDE_DIRS}
 +      ${PYTHON_INCLUDE_DIRS}
  )
 +add_definitions(-DWITH_PYTHON)
  
  set(SRC
        intern/EIGENVALUE_HELPER.cpp
diff --cc source/blender/blenkernel/intern/smoke.c
index c0cc2cd,90ac712..50e0054
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@@ -211,10 -205,8 +211,10 @@@ void smoke_reallocate_highres_fluid(Smo
        /* smoke_turbulence_init uses non-threadsafe functions from fftw3 lib 
(like fftw_plan & co). */
        BLI_lock_thread(LOCK_FFTW);
  
-       sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, 
BLI_temporary_dir(), use_fire, use_colors);
+       sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, 
BLI_temp_dir_session(), use_fire, use_colors);
 -
 +      if (sds->flags & MOD_SMOKE_USE_MANTA){
 +              smoke_mantaflow_write_scene_file(sds->smd);
 +      }
        BLI_unlock_thread(LOCK_FFTW);
  
        sds->res_wt[0] = res[0] * (sds->amplify + 1);
@@@ -1578,9 -1552,7 +1578,8 @@@ static void sample_derivedmesh
  
  static void emit_from_derivedmesh(Object *flow_ob, SmokeDomainSettings *sds, 
SmokeFlowSettings *sfs, EmissionMap *em, float dt)
  {
 +      clock_t start = clock();
-       if (!sfs->dm) return;
-       {
+       if (sfs->dm) {
                DerivedMesh *dm;
                int defgrp_index = sfs->vgroup_density - 1;
                MDeformVert *dvert = NULL;
@@@ -1711,15 -1683,17 +1710,21 @@@
                free_bvhtree_from_mesh(&treeData);
                /* restore original mverts */
                CustomData_set_layer(&dm->vertData, CD_MVERT, mvert_orig);
-               if (mvert)
+ 
+               if (mvert) {
                        MEM_freeN(mvert);
+               }
+               if (vert_vel) {
+                       MEM_freeN(vert_vel);
+               }
  
-               if (vert_vel) MEM_freeN(vert_vel);
+               dm->needsFree = 1;
+               dm->release(dm);
        }
 +      clock_t end = clock();
 +      float seconds = (float)(end - start) / CLOCKS_PER_SEC;
 +      printf("TIME FOR RECONSTRUCTING SDF: %f \n", seconds);
 +      int kkk = 9;
  }
  
  /**********************************************************
diff --cc source/blender/editors/physics/physics_fluid.c
index 7c49319,b53891f..fb224da
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@@ -1133,130 -1129,3 +1133,130 @@@ void FLUID_OT_bake(wmOperatorType *ot
        ot->poll = ED_operator_object_active_editable;
  }
  
 +
 +
 +static int manta_make_file_invoke(bContext *C, wmOperator *op, const wmEvent 
*UNUSED(event))
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      SmokeModifierData *smd;
 +      Object * smokeDomain = CTX_data_active_object(C);
 +      smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      smoke_mantaflow_write_scene_file(smd);
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +static int manta_make_file_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      SmokeModifierData *smd;
 +      Object * smokeDomain = CTX_data_active_object(C);
 +      smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      
 +      if (smd->domain->fluid == NULL)
 +      {
 +              smoke_reallocate_fluid(smd->domain, smd->domain->dx, 
smd->domain->res, 1);
 +              if (smd->domain->flags & MOD_SMOKE_HIGHRES) {
 +                      smoke_reallocate_highres_fluid(smd->domain, 
smd->domain->dx, smd->domain->res, 1);
 +              }
 +              //              smd->domain->fluid = 
smoke_init(smd->domain->res, 0.1f, 0.1f, 0,0,0);
 +      }
 +      smoke_mantaflow_write_scene_file(smd);
 +
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +
 +void MANTA_OT_make_file(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Create Mantaflow File";
 +      ot->description = "Create Python Script for Simulation";
 +      ot->idname = "MANTA_OT_make_file";
 +      
 +      /* api callbacks */
 +      ot->invoke = manta_make_file_invoke;
 +      ot->exec = manta_make_file_exec;
 +      ot->poll = ED_operator_object_active_editable;
 +}
 +
 +static int manta_sim_step_invoke(bContext *C, wmOperator *op, const wmEvent 
*UNUSED(event))
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      SmokeModifierData *smd;
 +      Object * smokeDomain = CTX_data_active_object(C);
 +      smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      smoke_mantaflow_sim_step(scene,smd);
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +static int manta_sim_step_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      SmokeModifierData *smd;
 +      Object * smokeDomain = CTX_data_active_object(C);
 +      smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      smoke_mantaflow_sim_step(scene,smd);
 +      
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +
 +void MANTA_OT_sim_step(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Run Mantaflow Step";
 +      ot->description = "Run One Step of Mantaflow Simulation";
 +      ot->idname = "MANTA_OT_sim_step";
 +      
 +      /* api callbacks */
 +      ot->invoke = manta_sim_step_invoke;
 +      ot->exec = manta_sim_step_exec;
 +      ot->poll = ED_operator_object_active_editable;
 +}
 +
 +static int manta_stop_sim_invoke(bContext *C, wmOperator *op, const wmEvent 
*UNUSED(event))
 +{
 +//    Scene *scene= CTX_data_scene(C);
 +//    SmokeModifierData *smd;
 +//    Object * smokeDomain = CTX_data_active_object(C);
 +//    smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      smoke_mantaflow_stop_sim();
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +static int manta_stop_sim_exec(bContext *C, wmOperator *op)
 +{
 +//    Scene *scene= CTX_data_scene(C);
 +//    SmokeModifierData *smd;
 +//    Object * smokeDomain = CTX_data_active_object(C);
 +//    smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, 
eModifierType_Smoke);
 +      smoke_mantaflow_stop_sim();
 +      
 +      /*      return OPERATOR_CANCELLED;*/
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +
 +void MANTA_OT_stop_sim(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name = "Stop Mantaflow Sim";
 +      ot->description = "Stop Mantaflow Sim";
 +      ot->idname = "MANTA_OT_stop_sim";
 +      
 +      /* api callbacks */
 +      ot->invoke = manta_stop_sim_invoke;
 +      ot->exec = manta_stop_sim_exec;
 +      ot->poll = ED_operator_object_active_editable;
- }
++}
diff --cc source/blender/python/SConscript
index a008678,9988e09..d7c47d1
--- a/source/blender/python/SConscript
+++ b/source/blender/python/SConscript
@@@ -77,15 -78,9 +78,15 @@@ defs = [
  sources = env.Glob('mathutils/*.c')
  env.BlenderLib( libname = 'bf_python_mathutils', sources = Split(sources), 
includes = Split(incs), defines = defs, libtype = ['core','player'], priority = 
[362,165])
  
 +# manta
 +defs = []
 +
 +sources = env.Glob('manta_pp/source/*')
 +env.BlenderLib( libname = 'bf_python_manta', sources = Split(sources), 
includes = Split(incs), defines = defs, libtype = ['core','player'])
 +
  
  # bpy
- defs = []
+ defs = env['BF_GL_DEFINITIONS']
  
  if is_debug:
      defs.append('_DEBUG')

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

Reply via email to