diff options
Diffstat (limited to 'source/blender/compositor/operations')
5 files changed, 21 insertions, 11 deletions
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp index c52d50bdb8c..6529b533361 100644 --- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp @@ -26,12 +26,13 @@ #include "COM_OutputFileMultiViewOperation.h" #include <string.h> + #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" -#include "BKE_image.h" + #include "BKE_global.h" -#include "BKE_library.h" +#include "BKE_image.h" #include "BKE_main.h" #include "BKE_scene.h" diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp index e73f2e46fb9..0397d172ab3 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp @@ -22,13 +22,15 @@ */ #include "COM_OutputFileOperation.h" + #include <string.h> + #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" -#include "BKE_image.h" + #include "BKE_global.h" -#include "BKE_library.h" +#include "BKE_image.h" #include "BKE_main.h" #include "BKE_scene.h" diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp index 2388e9e3302..58ea2ffe38b 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp @@ -55,10 +55,10 @@ void RenderLayersProg::initExecution() rr = RE_AcquireResultRead(re); if (rr) { - SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&scene->r.layers, getLayerId()); - if (srl) { + ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&scene->view_layers, getLayerId()); + if (view_layer) { - RenderLayer *rl = RE_GetRenderLayer(rr, srl->name); + RenderLayer *rl = RE_GetRenderLayer(rr, view_layer->name); if (rl) { this->m_inputBuffer = RE_RenderLayerGetPass(rl, this->m_passName.c_str(), this->m_viewName); } @@ -189,9 +189,9 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], unsigned rr = RE_AcquireResultRead(re); if (rr) { - SceneRenderLayer *srl = (SceneRenderLayer *)BLI_findlink(&sce->r.layers, getLayerId()); - if (srl) { - RenderLayer *rl = RE_GetRenderLayer(rr, srl->name); + ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&sce->view_layers, getLayerId()); + if (view_layer) { + RenderLayer *rl = RE_GetRenderLayer(rr, view_layer->name); if (rl) { resolution[0] = rl->rectx; resolution[1] = rl->recty; diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index 5a05d14087f..f1746323d78 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -26,6 +26,7 @@ extern "C" { # include "BLI_math.h" # include "BLI_utildefines.h" # include "BLI_rand.h" +# include "PIL_time.h" } ScreenLensDistortionOperation::ScreenLensDistortionOperation() : NodeOperation() @@ -60,6 +61,10 @@ void ScreenLensDistortionOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); this->initMutex(); + uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX); + rng_seed ^= (uint)POINTER_AS_INT(m_inputProgram); + this->m_rng = BLI_rng_new(rng_seed); + this->m_cx = 0.5f * (float)getWidth(); this->m_cy = 0.5f * (float)getHeight(); @@ -142,7 +147,7 @@ void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer, float dk4 = m_dk4[a]; for (float z = 0; z < ds; ++z) { - float tz = (z + (m_jitter ? BLI_frand() : 0.5f)) * sd; + float tz = (z + (m_jitter ? BLI_rng_get_float(m_rng) : 0.5f)) * sd; float t = 1.0f - (k4 + tz * dk4) * r_sq; float xy[2]; @@ -192,6 +197,7 @@ void ScreenLensDistortionOperation::deinitExecution() { this->deinitMutex(); this->m_inputProgram = NULL; + BLI_rng_free(this->m_rng); } void ScreenLensDistortionOperation::determineUV(float result[6], float x, float y) const diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h index 2e1343694cc..654acc177d8 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h @@ -31,6 +31,7 @@ private: * Cached reference to the inputProgram */ SocketReader *m_inputProgram; + struct RNG *m_rng; bool m_fit; bool m_jitter; |