Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2012-05-22 13:54:08 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-05-22 13:54:08 +0400
commitdbd70c05f799afb4d8a3584eae58af384ee14353 (patch)
treecd2edf5b6920cedc3d6311680509cffc9b165404 /source
parente7647e15859f524c1989847656e4ea228507d71b (diff)
* Composite result is updated when editing (preview were already
calculated, now the final result is also updated in the image space * default texture size when not connected to any resolution depended operation defaults to render size
Diffstat (limited to 'source')
-rw-r--r--source/blender/compositor/nodes/COM_TextureNode.cpp2
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp37
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.cpp7
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.h2
5 files changed, 32 insertions, 18 deletions
diff --git a/source/blender/compositor/nodes/COM_TextureNode.cpp b/source/blender/compositor/nodes/COM_TextureNode.cpp
index 0f9a2ca4c26..5e59d86e7d9 100644
--- a/source/blender/compositor/nodes/COM_TextureNode.cpp
+++ b/source/blender/compositor/nodes/COM_TextureNode.cpp
@@ -37,6 +37,7 @@ void TextureNode::convertToOperations(ExecutionSystem *system, CompositorContext
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), true, 0, system);
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), true, 1, system);
operation->setTexture(texture);
+ operation->setScene(context->getScene());
system->addOperation(operation);
addPreviewOperation(system, operation->getOutputSocket(), 9);
@@ -46,6 +47,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());
system->addOperation(alphaOperation);
}
}
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index ce9484d0d9f..8b343374f1c 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -31,7 +31,7 @@ extern "C" {
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
#include "MEM_guardedalloc.h"
-#include "render_types.h"
+ #include "render_types.h"
}
#include "PIL_time.h"
@@ -55,24 +55,31 @@ void CompositorOperation::initExecution()
if (this->getWidth() * this->getHeight() != 0) {
this->outputBuffer=(float*) MEM_callocN(this->getWidth()*this->getHeight()*4*sizeof(float), "CompositorOperation");
}
- const Scene * scene = this->scene;
- Render *re = RE_GetRender(scene->id.name);
- RenderResult *rr = RE_AcquireResultWrite(re);
- if (rr) {
- if (rr->rectf != NULL) {
- MEM_freeN(rr->rectf);
- }
- rr->rectf = outputBuffer;
- }
- if (re) {
- RE_ReleaseResult(re);
- re = NULL;
- }
-
}
void CompositorOperation::deinitExecution()
{
+ if (tree->test_break && !tree->test_break(tree->tbh)) {
+ const Scene * scene = this->scene;
+ Render *re = RE_GetRender(scene->id.name);
+ RenderResult *rr = RE_AcquireResultWrite(re);
+ if (rr) {
+ if (rr->rectf != NULL) {
+ MEM_freeN(rr->rectf);
+ }
+ rr->rectf = outputBuffer;
+ }
+ if (re) {
+ RE_ReleaseResult(re);
+ re = NULL;
+ }
+ BKE_image_signal(BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"), NULL, IMA_SIGNAL_FREE);
+ } else {
+ if (this->outputBuffer) {
+ MEM_freeN(this->outputBuffer);
+ }
+ }
+
this->outputBuffer = NULL;
this->imageInput = NULL;
this->alphaInput = NULL;
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h
index 39c81b8292a..41d43f896bb 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.h
+++ b/source/blender/compositor/operations/COM_CompositorOperation.h
@@ -60,7 +60,7 @@ public:
void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer** memoryBuffers);
void setScene(const Scene *scene) {this->scene = scene;}
void setbNodeTree(const bNodeTree *tree) {this->tree = tree;}
- bool isOutputOperation(bool rendering) const {return rendering;}
+ bool isOutputOperation(bool rendering) const {return true;}
void initExecution();
void deinitExecution();
const int getRenderPriority() const {return 7;}
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp
index f7edd922376..0d85f71c691 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cpp
+++ b/source/blender/compositor/operations/COM_TextureOperation.cpp
@@ -32,6 +32,7 @@ TextureBaseOperation::TextureBaseOperation(): NodeOperation()
this->texture = NULL;
this->inputSize = NULL;
this->inputOffset = NULL;
+ this->scene = NULL;
}
TextureOperation::TextureOperation() : TextureBaseOperation()
{
@@ -56,8 +57,10 @@ void TextureBaseOperation::deinitExecution()
void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
- resolution[0] = COM_DEFAULT_RESOLUTION_WIDTH;
- resolution[1] = COM_DEFAULT_RESOLUTION_HEIGHT;
+ int width = this->scene->r.xsch*this->scene->r.size/100;
+ int height = this->scene->r.ysch*this->scene->r.size/100;
+ resolution[0] = width;
+ resolution[1] = height;
}
else {
resolution[0] = preferredResolution[0];
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index ee067df2c64..de42b144730 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -43,6 +43,7 @@ extern "C" {
class TextureBaseOperation : public NodeOperation {
private:
Tex *texture;
+ const Scene *scene;
SocketReader *inputSize;
SocketReader *inputOffset;
@@ -64,6 +65,7 @@ public:
void setTexture(Tex *texture) {this->texture = texture;}
void initExecution();
void deinitExecution();
+ void setScene(const Scene *scene) {this->scene = scene;}
};
class TextureOperation:public TextureBaseOperation {