Commit: 5c64aa25541b973db4ec90c97e30b02d09b00075 Author: Roman Pogribnyi Date: Sun Mar 15 19:57:06 2015 +0100 Branches: soc-2014-fluid https://developer.blender.org/rB5c64aa25541b973db4ec90c97e30b02d09b00075
Merge branch 'master' into soc-2014-fluid =================================================================== =================================================================== diff --cc CMakeLists.txt index d66610c,8e54ddc..6b879b4 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -147,11 -218,10 +218,11 @@@ option(WITH_FFTW3 "Enable FFTW option(WITH_BULLET "Enable Bullet (Physics Engine)" ON) option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" ) mark_as_advanced(WITH_SYSTEM_BULLET) - option(WITH_GAMEENGINE "Enable Game Engine" ON) + option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE}) option(WITH_PLAYER "Build Player" OFF) - option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON) + option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO}) option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON) +option(WITH_MOD_MANTA "Enable Mantaflow Framework" ON) # GHOST Windowing Library Options option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF) diff --cc intern/ghost/intern/GHOST_ContextCGL.mm index c55935d,0b290c6..57cf53a --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@@ -192,11 -193,7 +193,8 @@@ static void makeAttribList * Maybe a command line flag is better... */ if (getenv("BLENDER_SOFTWAREGL")) { attribs.push_back(NSOpenGLPFARendererID); - #if defined(__ppc__) || defined(__ppc64__) - attribs.push_back(kCGLRendererAppleSWID); - #else - // attribs.push_back(kCGLRendererGenericFloatID); - #endif ++ + attribs.push_back(kCGLRendererGenericFloatID); } else { attribs.push_back(NSOpenGLPFAAccelerated); diff --cc intern/ghost/intern/GHOST_WindowCocoa.mm index 6fb73a3,65d371c..2914b36 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@@ -1344,15 -1355,10 +1355,10 @@@ GHOST_TSuccess GHOST_WindowCocoa::endPr // With OSX 10.8 and later, we can use notifications to inform the user when the progress reached 100% // Atm. just fire this when the progressbar ends, the behavior is controlled in the NotificationCenter // If Blender is not frontmost window, a message pops up with sound, in any case an entry in notifications - //PR commented temporarily - // if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) { - // NSUserNotification *notification = [[NSUserNotification alloc] init]; - // notification.title = @"Blender progress notification"; - // notification.informativeText = @"Calculation ended"; - // notification.soundName = NSUserNotificationDefaultSoundName; - // [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; - // [notification release]; - // } - ++ + if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) { + postNotification(); + } [dockIcon release]; diff --cc intern/smoke/intern/smoke_API.cpp index 3a61b39,d79aaf7..462af5b --- a/intern/smoke/intern/smoke_API.cpp +++ b/intern/smoke/intern/smoke_API.cpp @@@ -514,96 -506,3 +522,96 @@@ extern "C" void smoke_ensure_colors(FLU wt->initColors(init_r, init_g, init_b); } } + + +/*MantaFlow funcs*/ +extern "C" int smoke_mantaflow_read(struct SmokeDomainSettings *sds, char* name, bool with_wavelets) +{ + return read_mantaflow_sim(sds, name, with_wavelets); +} + + +extern "C" void manta_write_effectors(struct FLUID_3D *fluid) +{ + int size_x = fluid->_xRes; + int size_y = fluid->_yRes; + int size_z = fluid->_zRes; + + float *force_x = smoke_get_force_x(fluid); + float *force_y = smoke_get_force_y(fluid); + float *force_z = smoke_get_force_z(fluid); +// export_force_fields(size_x, size_y, size_z, force_x, force_y, force_z); + /*accumulate all force fields in one grid*/ + Manta::Vec3 * accumulated_force = NULL; + long index(0); + if (fluid->manta_resoution == 3){ + accumulated_force = (Manta::Vec3*)calloc(size_x * size_y * size_z , sizeof(Manta::Vec3)); + for (int z(0); z < size_z; z++){ + for (int y(0); y < size_y; y++){ + for (int x(0); x < size_x; x++){ + index = smoke_get_index(x, size_x, y, size_y, z); + accumulated_force[index] = Manta::Vec3(force_x[index], force_y[index], force_z[index]); + } + } + } + } + else if (fluid->manta_resoution == 2){ + accumulated_force = (Manta::Vec3*)malloc(size_x * size_z * sizeof(Manta::Vec3)); + int step(0); + for (int x(0); x < size_x; x++){ + for (int z(0); z < size_z; z++){ + index = smoke_get_index(x, size_x, size_y/2, size_y, z); + accumulated_force[x + z * size_x] = Manta::Vec3(force_x[index], force_z[index], 0.0); + } + } + } + else{ + cout << "ERROR: Manta solver resoltion is neither 2 nor 3; Cannot write forces"<<endl; + return; + } + + + bool is2D = (fluid->manta_resoution == 2); + Manta_API::addGrid(accumulated_force, "forces", "Vec3", size_x, size_y, size_z, is2D); +} + +extern "C" void manta_write_emitters(struct SmokeFlowSettings *sfs, bool highRes, int min_x, int min_y, int min_z, int max_x, int max_y, int max_z, int d_x, int d_y, int d_z,float *influence, float *vel) +{ +// manta_update_effectors(s, smd->domain->manta_obj, smd->domain, 0.1f); + bool is2D = (sfs->smd->domain->fluid->manta_resoution == 2); + if (! highRes) + Manta_API::addAdaptiveGrid(influence, "density", "s", "float", + min_x, min_y, min_z, max_x, max_y, max_z, is2D); + else + Manta_API::addAdaptiveGrid(influence, "xl_density", "xl", "float", min_x, min_y, min_z, max_x, max_y, max_z, is2D); + // export_em_fields(Manta_API::instance()->_emission_map,sfs->density, min_x, min_y, min_z, max_x, max_y, max_z, d_x, d_y, d_z, influence, vel); +} + +/*deprecated*/ +extern "C" void manta_export_obstacles(float * influence, int x, int y, int z) +{ + + cout << "!!!!!!!!!!Deprecated method manta_export_obstacles is being used" << endl; + if (influence == NULL){ + cout<< "ERROR: empty influence object when exporting smoke obstacles" << endl; + return; + } +// Manta_API::export_obstacles(influence, x, y, z); +} + +extern "C" void smoke_mantaflow_stop_sim(struct Manta_API * fluid) +{ + if (fluid == NULL){ + cout<< "ERROR: empty manta_API object when stopping smoke simulation" << endl; + return; + } + fluid->stop_manta_sim(); +} + +extern "C" int cell_index_3D(int index_2d, int sizex,int sizey, int sizez) +{ + + return int(sizey * 0.5) * sizex + + (index_2d % (sizex)) + + int(index_2d/(sizex)) * sizex * sizey; - } ++} diff --cc release/scripts/startup/bl_ui/properties_physics_smoke.py index d2a93e4,63268bc..c2a2b3b --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@@ -18,15 -18,15 +18,17 @@@ # <pep8 compliant> import bpy +import os +from copy import deepcopy from bpy.types import Panel - from bl_ui.properties_physics_common import (point_cache_ui, - effector_weights_ui) + from bl_ui.properties_physics_common import ( + point_cache_ui, + effector_weights_ui, + ) - class PhysicButtonsPanel(): + class PhysicButtonsPanel: bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "physics" diff --cc source/blender/editors/physics/physics_fluid.c index 5478ad2,b5adf38..d96bba4 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@@ -78,8 -72,7 +78,6 @@@ #include "DNA_scene_types.h" #include "DNA_mesh_types.h" - #include "PIL_time.h" -- static float get_fluid_viscosity(FluidsimSettings *settings) { return (1.0f/powf(10.0f, settings->viscosityExponent)) * settings->viscosityValue; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs