diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-22 19:06:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-22 19:06:52 +0400 |
commit | 0b0ac3aa9ee94ad8020639e9d1df4c94a23a3fcf (patch) | |
tree | 3652f4e913b6231abc4708bea8202ad651f1a547 /source/blender/compositor/intern | |
parent | 590f5fdbdfc2357c5b0490a406c9c39cf66de50a (diff) |
remove scene from new compositor classes. only needs RenderData
Diffstat (limited to 'source/blender/compositor/intern')
5 files changed, 15 insertions, 21 deletions
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp index bb8e7d9606d..c3470f0a16e 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.cpp +++ b/source/blender/compositor/intern/COM_CompositorContext.cpp @@ -26,7 +26,7 @@ CompositorContext::CompositorContext() { - this->scene = NULL; + this->rd = NULL; this->quality = COM_QUALITY_HIGH; this->hasActiveOpenCLDevices = false; this->activegNode = NULL; @@ -34,8 +34,8 @@ CompositorContext::CompositorContext() const int CompositorContext::getFramenumber() const { - if (this->scene) { - return this->scene->r.cfra; + if (this->rd) { + return this->rd->cfra; } else { return -1; /* this should never happen */ @@ -44,8 +44,8 @@ const int CompositorContext::getFramenumber() const const int CompositorContext::isColorManaged() const { - if (this->scene) { - return this->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; + if (this->rd) { + return this->rd->color_mgt_flag & R_COLOR_MANAGEMENT; } else { return 0; /* this should never happen */ diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h index 93872f4839f..81fd81b4117 100644 --- a/source/blender/compositor/intern/COM_CompositorContext.h +++ b/source/blender/compositor/intern/COM_CompositorContext.h @@ -51,11 +51,11 @@ private: CompositorQuality quality; /** - * @brief Reference to the scene that is being composited. + * @brief Reference to the render data that is being composited. * This field is initialized in ExecutionSystem and must only be read from that point on. * @see ExecutionSystem */ - Scene *scene; + RenderData *rd; /** * @brief reference to the bNodeTree @@ -93,7 +93,7 @@ public: /** * @brief set the scene of the context */ - void setScene(Scene *scene) { this->scene = scene; } + void setRenderData(RenderData *rd) { this->rd = rd; } /** * @brief set the bnodetree of the context @@ -118,7 +118,7 @@ public: /** * @brief get the scene of the context */ - const Scene *getScene() const { return this->scene; } + const RenderData *getRenderData() const { return this->rd; } /** * @brief set the quality diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 806f1db1bdf..7e09486fd0b 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -41,7 +41,7 @@ #include "BKE_global.h" -ExecutionSystem::ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rendering) +ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering) { context.setbNodeTree(editingtree); bNode *gnode; @@ -64,7 +64,7 @@ ExecutionSystem::ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rend ExecutionSystemHelper::addbNodeTree(*this, 0, editingtree, NULL); - context.setScene(scene); + context.setRenderData(rd); this->convertToOperations(); this->groupOperations(); /* group operations in ExecutionGroups */ unsigned int index; diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index 0cc9e3e6b4b..48ff2ef6af9 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -156,7 +156,7 @@ public: * @param editingtree [bNodeTree*] * @param rendering [true false] */ - ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rendering); + ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering); /** * Destructor diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp index cfae8f5f481..bec9ff95eed 100644 --- a/source/blender/compositor/intern/COM_compositor.cpp +++ b/source/blender/compositor/intern/COM_compositor.cpp @@ -56,15 +56,9 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering) editingtree->progress(editingtree->prh, 0.0); /* initialize execution system */ - Scene *scene; - for (scene = (Scene*)G.main->scene.first; scene != NULL ; scene = (Scene*)scene->id.next) { - if (&scene->r == rd) { - ExecutionSystem *system = new ExecutionSystem(scene, editingtree, rendering); - system->execute(); - delete system; - break; - } - } + ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering); + system->execute(); + delete system; BLI_mutex_unlock(compositorMutex); } |