diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-29 19:48:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-29 19:48:15 +0400 |
commit | 3f45ad4d3fc903317525a7958b219383d6f8688a (patch) | |
tree | 583da239f1a4409c0d1fc52ae76ca21858f3a147 | |
parent | c285b16f6534ed077134d57df8345c11cd915357 (diff) |
svn merge ^/trunk/blender -c56930 -c56935 -c56943 -c56956
-rw-r--r-- | intern/smoke/extern/smoke_API.h | 4 | ||||
-rw-r--r-- | intern/smoke/intern/WTURBULENCE.cpp | 18 | ||||
-rw-r--r-- | intern/smoke/intern/WTURBULENCE.h | 4 | ||||
-rw-r--r-- | intern/smoke/intern/smoke_API.cpp | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp | 1 | ||||
-rw-r--r-- | source/creator/creator.c | 5 |
8 files changed, 22 insertions, 24 deletions
diff --git a/intern/smoke/extern/smoke_API.h b/intern/smoke/extern/smoke_API.h index 98c63f08fbd..08dbded176e 100644 --- a/intern/smoke/extern/smoke_API.h +++ b/intern/smoke/extern/smoke_API.h @@ -74,7 +74,7 @@ size_t smoke_get_index2d(int x, int max_x, int y); void smoke_dissolve(struct FLUID_3D *fluid, int speed, int log); // wavelet turbulence functions -struct WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype, int use_fire, int use_colors); +struct WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype, const char *noisefile_path, int use_fire, int use_colors); void smoke_turbulence_free(struct WTURBULENCE *wt); void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid); @@ -89,7 +89,7 @@ float *smoke_turbulence_get_fuel(struct WTURBULENCE *wt); float *smoke_turbulence_get_react(struct WTURBULENCE *wt); void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res); int smoke_turbulence_get_cells(struct WTURBULENCE *wt); -void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type); +void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type, const char *noisefile_path); void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength); void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log); diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp index efc6c19a4c5..3d712d2124a 100644 --- a/intern/smoke/intern/WTURBULENCE.cpp +++ b/intern/smoke/intern/WTURBULENCE.cpp @@ -51,7 +51,7 @@ static const float persistence = 0.56123f; ////////////////////////////////////////////////////////////////////// // constructor ////////////////////////////////////////////////////////////////////// -WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype, int init_fire, int init_colors) +WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype, const char *noisefile_path, int init_fire, int init_colors) { // if noise magnitude is below this threshold, its contribution // is negilgible, so stop evaluating new octaves @@ -131,15 +131,7 @@ WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int no // noise tiles _noiseTile = new float[noiseTileSize * noiseTileSize * noiseTileSize]; - /* - std::string noiseTileFilename = std::string("noise.wavelets"); - generateTile_WAVELET(_noiseTile, noiseTileFilename); - */ - setNoise(noisetype); - /* - std::string noiseTileFilename = std::string("noise.fft"); - generatTile_FFT(_noiseTile, noiseTileFilename); - */ + setNoise(noisetype, noisefile_path); } void WTURBULENCE::initFire() @@ -216,13 +208,13 @@ WTURBULENCE::~WTURBULENCE() { // type (1<<1) = FFT / 4 // type (1<<2) = curl / 8 ////////////////////////////////////////////////////////////////////// -void WTURBULENCE::setNoise(int type) +void WTURBULENCE::setNoise(int type, const char *noisefile_path) { if(type == (1<<1)) // FFT { #ifdef WITH_FFTW3 // needs fft - std::string noiseTileFilename = std::string("noise.fft"); + std::string noiseTileFilename = std::string(noisefile_path) + std::string("noise.fft"); generatTile_FFT(_noiseTile, noiseTileFilename); return; #else @@ -237,7 +229,7 @@ void WTURBULENCE::setNoise(int type) } #endif - std::string noiseTileFilename = std::string("noise.wavelets"); + std::string noiseTileFilename = std::string(noisefile_path) + std::string("noise.wavelets"); generateTile_WAVELET(_noiseTile, noiseTileFilename); } diff --git a/intern/smoke/intern/WTURBULENCE.h b/intern/smoke/intern/WTURBULENCE.h index 4e76466bde5..36635325f62 100644 --- a/intern/smoke/intern/WTURBULENCE.h +++ b/intern/smoke/intern/WTURBULENCE.h @@ -36,7 +36,7 @@ struct WTURBULENCE { public: // both config files can be NULL, altCfg might override values from noiseCfg - WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype, int init_fire, int init_colors); + WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int noisetype, const char *noisefile_path, int init_fire, int init_colors); /// destructor virtual ~WTURBULENCE(); @@ -44,7 +44,7 @@ struct WTURBULENCE void initFire(); void initColors(float init_r, float init_g, float init_b); - void setNoise(int type); + void setNoise(int type, const char *noisefile_path); void initBlenderRNA(float *strength); // step more readable version -- no rotation correction diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp index 67f1ea29533..e25dff00d23 100644 --- a/intern/smoke/intern/smoke_API.cpp +++ b/intern/smoke/intern/smoke_API.cpp @@ -44,10 +44,10 @@ extern "C" FLUID_3D *smoke_init(int *res, float dx, float dtdef, int use_heat, i return fluid; } -extern "C" WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype, int use_fire, int use_colors) +extern "C" WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype, const char *noisefile_path, int use_fire, int use_colors) { if (amplify) - return new WTURBULENCE(res[0],res[1],res[2], amplify, noisetype, use_fire, use_colors); + return new WTURBULENCE(res[0],res[1],res[2], amplify, noisetype, noisefile_path, use_fire, use_colors); else return NULL; } @@ -436,9 +436,9 @@ extern "C" unsigned char *smoke_get_obstacle_anim(FLUID_3D *fluid) } #endif -extern "C" void smoke_turbulence_set_noise(WTURBULENCE *wt, int type) +extern "C" void smoke_turbulence_set_noise(WTURBULENCE *wt, int type, const char *noisefile_path) { - wt->setNoise(type); + wt->setNoise(type, noisefile_path); } extern "C" void flame_get_spectrum(unsigned char *spec, int width, float t1, float t2) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index f0c1542fd40..3a3955aa519 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -146,7 +146,7 @@ struct SmokeModifierData; #else /* WITH_SMOKE */ /* Stubs to use when smoke is disabled */ -struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype), int UNUSED(use_fire), int UNUSED(use_colors)) { return NULL; } +struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype), const char *UNUSED(noisefile_path), int UNUSED(use_fire), int UNUSED(use_colors)) { return NULL; } //struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(dx), float *UNUSED(dtdef), int UNUSED(use_heat), int UNUSED(use_fire), int UNUSED(use_colors)) { return NULL; } void smoke_free(struct FLUID_3D *UNUSED(fluid)) {} float *smoke_get_density(struct FLUID_3D *UNUSED(fluid)) { return NULL; } @@ -196,7 +196,7 @@ void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[ sds->wt = NULL; return; } - sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, use_fire, use_colors); + sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, BLI_temporary_dir(), use_fire, use_colors); sds->res_wt[0] = res[0] * (sds->amplify + 1); sds->res_wt[1] = res[1] * (sds->amplify + 1); sds->res_wt[2] = res[2] * (sds->amplify + 1); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index ae8193d1f26..f38eee1f432 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -307,7 +307,7 @@ static void transformops_loopsel_hack(bContext *C, wmOperator *op) int mesh_select_mode[3]; PropertyRNA *prop = RNA_struct_find_property(op_prev->ptr, "mesh_select_mode_init"); - if (RNA_property_is_set(op_prev->ptr, prop)) { + if (prop && RNA_property_is_set(op_prev->ptr, prop)) { ToolSettings *ts = scene->toolsettings; short selectmode_orig; diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 8199f5b8021..48aaa2ed910 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -186,6 +186,7 @@ static PyObject *Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject { return NULL; } + ((BPy_StrokeVertex *)py_sv)->py_cp.py_if0D.borrowed = 1; /* make the wrapped StrokeVertex internal */ StrokeVertex *sv = ((BPy_StrokeVertex *)py_sv)->sv; StrokeInternal::StrokeVertexIterator sv_it(*(((BPy_StrokeVertexIterator *)py_sv_it)->sv_it)); self->s->InsertVertex(sv, sv_it); diff --git a/source/creator/creator.c b/source/creator/creator.c index 5c6f85c918d..b02d7d97c8a 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -634,6 +634,11 @@ static int playback_mode(int argc, const char **argv, void *UNUSED(data)) { /* not if -b was given first */ if (G.background == 0) { +#ifdef WITH_FFMPEG + /* Setup FFmpeg with current debug flags. */ + IMB_ffmpeg_init(); +#endif + WM_main_playanim(argc, argv); /* not the same argc and argv as before */ exit(0); /* 2.4x didn't do this */ } |