diff options
21 files changed, 68 insertions, 61 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); } diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cpp b/source/blender/compositor/nodes/COM_CompositorNode.cpp index fccb92ddd8b..6a6f2d1b4ff 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.cpp +++ b/source/blender/compositor/nodes/COM_CompositorNode.cpp @@ -35,7 +35,7 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte InputSocket *alphaSocket = this->getInputSocket(1); if (imageSocket->isConnected()) { CompositorOperation *colourAlphaProg = new CompositorOperation(); - colourAlphaProg->setScene(context->getScene()); + colourAlphaProg->setRenderData(context->getRenderData()); colourAlphaProg->setbNodeTree(context->getbNodeTree()); imageSocket->relinkConnections(colourAlphaProg->getInputSocket(0)); alphaSocket->relinkConnections(colourAlphaProg->getInputSocket(1)); diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.cpp b/source/blender/compositor/nodes/COM_IDMaskNode.cpp index 4005e5d2900..31d2ccb391e 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.cpp +++ b/source/blender/compositor/nodes/COM_IDMaskNode.cpp @@ -38,7 +38,7 @@ void IDMaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext * operation->setObjectIndex(bnode->custom1); this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); - if (bnode->custom2 == 0 || context->getScene()->r.scemode & R_FULL_SAMPLE) { + if (bnode->custom2 == 0 || context->getRenderData()->scemode & R_FULL_SAMPLE) { this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); } else { diff --git a/source/blender/compositor/nodes/COM_MaskNode.cpp b/source/blender/compositor/nodes/COM_MaskNode.cpp index d745fd85104..13037b61a56 100644 --- a/source/blender/compositor/nodes/COM_MaskNode.cpp +++ b/source/blender/compositor/nodes/COM_MaskNode.cpp @@ -36,7 +36,7 @@ MaskNode::MaskNode(bNode *editorNode) : Node(editorNode) void MaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { - const RenderData *data = &context->getScene()->r; + const RenderData *data = context->getRenderData(); OutputSocket *outputMask = this->getOutputSocket(0); diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp index db7fbffea4f..e85f521def0 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp @@ -47,7 +47,7 @@ void OutputFileNode::convertToOperations(ExecutionSystem *graph, CompositorConte if (storage->format.imtype == R_IMF_IMTYPE_MULTILAYER) { /* single output operation for the multilayer file */ OutputOpenExrMultiLayerOperation *outputOperation = new OutputOpenExrMultiLayerOperation( - context->getScene(), context->getbNodeTree(), storage->base_path, storage->format.exr_codec); + context->getRenderData(), context->getbNodeTree(), storage->base_path, storage->format.exr_codec); int num_inputs = getNumberOfInputSockets(); bool hasConnections = false; @@ -80,7 +80,7 @@ void OutputFileNode::convertToOperations(ExecutionSystem *graph, CompositorConte BLI_join_dirfile(path, FILE_MAX, storage->base_path, sockdata->path); OutputSingleLayerOperation *outputOperation = new OutputSingleLayerOperation( - context->getScene(), context->getbNodeTree(), input->getDataType(), format, path); + context->getRenderData(), context->getbNodeTree(), input->getDataType(), format, path); input->relinkConnections(outputOperation->getInputSocket(0)); graph->addOperation(outputOperation); if (!previewAdded) { diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cpp b/source/blender/compositor/nodes/COM_ScaleNode.cpp index 17b521c589d..95b048b6cad 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.cpp +++ b/source/blender/compositor/nodes/COM_ScaleNode.cpp @@ -52,7 +52,7 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c break; case CMP_SCALE_SCENEPERCENT: { SetValueOperation *scaleFactorOperation = new SetValueOperation(); - scaleFactorOperation->setValue(context->getScene()->r.size / 100.0f); + scaleFactorOperation->setValue(context->getRenderData()->size / 100.0f); ScaleOperation *operation = new ScaleOperation(); inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph); addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1)); @@ -64,7 +64,7 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c break; case CMP_SCALE_RENDERPERCENT: { - const RenderData *data = &context->getScene()->r; + const RenderData *data = context->getRenderData(); ScaleFixedSizeOperation *operation = new ScaleFixedSizeOperation(); /* framing options */ diff --git a/source/blender/compositor/nodes/COM_SplitViewerNode.cpp b/source/blender/compositor/nodes/COM_SplitViewerNode.cpp index 22a00410384..388466cee3c 100644 --- a/source/blender/compositor/nodes/COM_SplitViewerNode.cpp +++ b/source/blender/compositor/nodes/COM_SplitViewerNode.cpp @@ -39,8 +39,8 @@ void SplitViewerNode::convertToOperations(ExecutionSystem *graph, CompositorCont ImageUser *imageUser = (ImageUser *) this->getbNode()->storage; if (image1Socket->isConnected() && image2Socket->isConnected()) { SplitViewerOperation *splitViewerOperation = new SplitViewerOperation(); - splitViewerOperation->setColorManagement(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT); - splitViewerOperation->setColorPredivide(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE); + splitViewerOperation->setColorManagement(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT); + splitViewerOperation->setColorPredivide(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE); splitViewerOperation->setImage(image); splitViewerOperation->setImageUser(imageUser); splitViewerOperation->setActive((this->getbNode()->flag & NODE_DO_OUTPUT) && this->isInActiveGroup()); diff --git a/source/blender/compositor/nodes/COM_TextureNode.cpp b/source/blender/compositor/nodes/COM_TextureNode.cpp index a3526e3c1a1..b035e0a392c 100644 --- a/source/blender/compositor/nodes/COM_TextureNode.cpp +++ b/source/blender/compositor/nodes/COM_TextureNode.cpp @@ -38,7 +38,7 @@ void TextureNode::convertToOperations(ExecutionSystem *system, CompositorContext this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, system); this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, system); operation->setTexture(texture); - operation->setScene(context->getScene()); + operation->setRenderData(context->getRenderData()); system->addOperation(operation); addPreviewOperation(system, operation->getOutputSocket()); @@ -48,7 +48,7 @@ void TextureNode::convertToOperations(ExecutionSystem *system, CompositorContext addLink(system, operation->getInputSocket(0)->getConnection()->getFromSocket(), alphaOperation->getInputSocket(0)); addLink(system, operation->getInputSocket(1)->getConnection()->getFromSocket(), alphaOperation->getInputSocket(1)); alphaOperation->setTexture(texture); - alphaOperation->setScene(context->getScene()); + alphaOperation->setRenderData(context->getRenderData()); system->addOperation(alphaOperation); } } diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cpp b/source/blender/compositor/nodes/COM_ViewerNode.cpp index 9228fdbef85..1205767cb28 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewerNode.cpp @@ -40,8 +40,8 @@ void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext * bNode *editorNode = this->getbNode(); if (imageSocket->isConnected()) { ViewerOperation *viewerOperation = new ViewerOperation(); - viewerOperation->setColorManagement(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT); - viewerOperation->setColorPredivide(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE); + viewerOperation->setColorManagement(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT); + viewerOperation->setColorPredivide(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE); viewerOperation->setbNodeTree(context->getbNodeTree()); viewerOperation->setImage(image); viewerOperation->setImageUser(imageUser); diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp index 2b1a804b432..622cd50f349 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cpp +++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp @@ -41,7 +41,7 @@ CompositorOperation::CompositorOperation() : NodeOperation() this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VALUE); - this->setScene(NULL); + this->setRenderData(NULL); this->outputBuffer = NULL; this->imageInput = NULL; this->alphaInput = NULL; @@ -60,8 +60,8 @@ void CompositorOperation::initExecution() void CompositorOperation::deinitExecution() { if (!isBreaked()) { - const Scene *scene = this->scene; - Render *re = RE_GetRender(scene->id.name); + const RenderData *rd = this->rd; + Render *re = RE_GetRender_FromData(rd); RenderResult *rr = RE_AcquireResultWrite(re); if (rr) { if (rr->rectf != NULL) { @@ -127,12 +127,12 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber, Mem void CompositorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) { - int width = this->scene->r.xsch * this->scene->r.size / 100; - int height = this->scene->r.ysch * this->scene->r.size / 100; + int width = this->rd->xsch * this->rd->size / 100; + int height = this->rd->ysch * this->rd->size / 100; // check actual render resolution with cropping it may differ with cropped border.rendering // FIX for: [31777] Border Crop gives black (easy) - Render *re = RE_GetRender(this->scene->id.name); + Render *re = RE_GetRender_FromData(this->rd); if (re) { RenderResult *rr = RE_AcquireResultRead(re); if (rr) { diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h index 0129c953946..280f39b7729 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.h +++ b/source/blender/compositor/operations/COM_CompositorOperation.h @@ -34,7 +34,7 @@ private: /** * @brief local reference to the scene */ - const Scene *scene; + const RenderData *rd; /** * @brief reference to the output float buffer @@ -53,7 +53,7 @@ private: public: CompositorOperation(); void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers); - void setScene(const Scene *scene) { this->scene = scene; } + void setRenderData(const RenderData *rd) { this->rd = rd; } bool isOutputOperation(bool rendering) const { return true; } void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp index e71178a811d..c0aa139b032 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp @@ -92,9 +92,9 @@ static void write_buffer_rect(rcti *rect, MemoryBuffer **memoryBuffers, const bN OutputSingleLayerOperation::OutputSingleLayerOperation( - const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path) + const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path) { - this->scene = scene; + this->rd = rd; this->tree = tree; this->addInputSocket(datatype); @@ -130,13 +130,13 @@ void OutputSingleLayerOperation::deinitExecution() ibuf->channels = size; ibuf->rect_float = this->outputBuffer; ibuf->mall |= IB_rectfloat; - ibuf->dither = scene->r.dither_intensity; + ibuf->dither = this->rd->dither_intensity; - if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) + if (this->rd->color_mgt_flag & R_COLOR_MANAGEMENT) ibuf->profile = IB_PROFILE_LINEAR_RGB; - BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, this->format->imtype, - (this->scene->r.scemode & R_EXTENSION), true); + BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, this->format->imtype, + (this->rd->scemode & R_EXTENSION), true); if (0 == BKE_imbuf_write(ibuf, filename, this->format)) printf("Cannot save Node File Output to %s\n", filename); @@ -160,9 +160,9 @@ OutputOpenExrLayer::OutputOpenExrLayer(const char *name, DataType datatype) } OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation( - const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec) + const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec) { - this->scene = scene; + this->rd = rd; this->tree = tree; BLI_strncpy(this->path, path, sizeof(this->path)); @@ -199,8 +199,8 @@ void OutputOpenExrMultiLayerOperation::deinitExecution() char filename[FILE_MAX]; void *exrhandle = IMB_exr_get_handle(); - BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, R_IMF_IMTYPE_MULTILAYER, - (this->scene->r.scemode & R_EXTENSION), true); + BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, R_IMF_IMTYPE_MULTILAYER, + (this->rd->scemode & R_EXTENSION), true); BLI_make_existing_file(filename); for (unsigned int i = 0; i < layers.size(); ++i) { diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h index cfc5f7e41f2..25ee5b31ec0 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.h +++ b/source/blender/compositor/operations/COM_OutputFileOperation.h @@ -32,7 +32,7 @@ /* Writes the image to a single-layer file. */ class OutputSingleLayerOperation : public NodeOperation { private: - const Scene *scene; + const RenderData *rd; const bNodeTree *tree; ImageFormatData *format; @@ -43,7 +43,7 @@ private: SocketReader *imageInput; public: - OutputSingleLayerOperation(const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path); + OutputSingleLayerOperation(const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path); void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers); bool isOutputOperation(bool rendering) const { return true; } @@ -67,7 +67,7 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation { private: typedef std::vector<OutputOpenExrLayer> LayerList; - const Scene *scene; + const RenderData *rd; const bNodeTree *tree; char path[FILE_MAX]; @@ -75,7 +75,7 @@ private: LayerList layers; public: - OutputOpenExrMultiLayerOperation(const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec); + OutputOpenExrMultiLayerOperation(const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec); void add_layer(const char *name, DataType datatype); diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 072528f3fc6..dbdd17adbe4 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -32,7 +32,7 @@ TextureBaseOperation::TextureBaseOperation() : NodeOperation() this->texture = NULL; this->inputSize = NULL; this->inputOffset = NULL; - this->scene = NULL; + this->rd = NULL; } TextureOperation::TextureOperation() : TextureBaseOperation() { @@ -57,8 +57,8 @@ void TextureBaseOperation::deinitExecution() void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) { if (preferredResolution[0] == 0 || preferredResolution[1] == 0) { - int width = this->scene->r.xsch * this->scene->r.size / 100; - int height = this->scene->r.ysch * this->scene->r.size / 100; + int width = this->rd->xsch * this->rd->size / 100; + int height = this->rd->ysch * this->rd->size / 100; resolution[0] = width; resolution[1] = height; } diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h index e862a1f1910..14714242511 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.h +++ b/source/blender/compositor/operations/COM_TextureOperation.h @@ -43,7 +43,7 @@ extern "C" { class TextureBaseOperation : public NodeOperation { private: Tex *texture; - const Scene *scene; + const RenderData *rd; SocketReader *inputSize; SocketReader *inputOffset; @@ -65,7 +65,7 @@ public: void setTexture(Tex *texture) { this->texture = texture; } void initExecution(); void deinitExecution(); - void setScene(const Scene *scene) { this->scene = scene; } + void setRenderData(const RenderData *rd) { this->rd = rd; } }; class TextureOperation : public TextureBaseOperation { diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 2a3c8e60638..4e33e4d7e2d 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -154,6 +154,7 @@ typedef struct RenderStats { /* calling a new render with same name, frees automatic existing render */ struct Render *RE_NewRender (const char *name); struct Render *RE_GetRender(const char *name); +struct Render *RE_GetRender_FromData(const struct RenderData *rd); /* returns 1 while render is working (or renders called from within render) */ int RE_RenderInProgress(struct Render *re); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index eab152262f8..3de64996311 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -245,6 +245,18 @@ Render *RE_GetRender(const char *name) return re; } +Render *RE_GetRender_FromData(const RenderData *rd) +{ + Render *re; + + /* search for existing renders */ + for (re = RenderGlobal.renderlist.first; re; re = re->next) + if (&re->r == rd) + break; + + return re; +} + /* if you want to know exactly what has been done */ RenderResult *RE_AcquireResultRead(Render *re) { |