diff options
Diffstat (limited to 'source/blender/compositor/nodes')
4 files changed, 55 insertions, 3 deletions
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp index 90b2481cc7d..b209e36dd48 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BlurNode.cpp @@ -37,10 +37,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c { bNode *editorNode = this->getbNode(); NodeBlurData * data = (NodeBlurData*)editorNode->storage; -#if 0 + InputSocket * inputSizeSocket = this->getInputSocket(1); + bool connectedSizeSocket = inputSizeSocket->isConnected(); + const bNodeSocket *sock = this->getInputSocket(1)->getbNodeSocket(); const float size = ((const bNodeSocketValueFloat*)sock->default_value)->value; -#endif CompositorQuality quality = context->getQuality(); @@ -71,6 +72,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0)); addLink(graph, operationx->getInputSocket(1)->getConnection()->getFromSocket(), operationy->getInputSocket(1)); addPreviewOperation(graph, operationy->getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operationx->setSize(size); + operationy->setSize(size); + } } else { GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation(); @@ -81,5 +87,9 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c graph->addOperation(operation); this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); addPreviewOperation(graph, operation->getOutputSocket(), 5); + + if (!connectedSizeSocket) { + operation->setSize(size); + } } } diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp index cc96f672ebd..47791956865 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp @@ -35,7 +35,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont { bNode *editorNode = this->getbNode(); - if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeDistanceOperation *operation = new DilateErodeDistanceOperation(); operation->setDistance(editorNode->custom2); operation->setInset(editorNode->custom3); @@ -53,6 +53,22 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont } graph->addOperation(operation); } + else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom2 > 0) { + DilateDistanceOperation * operation = new DilateDistanceOperation(); + operation->setDistance(editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + else { + ErodeDistanceOperation * operation = new ErodeDistanceOperation(); + operation->setDistance(-editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + } else { if (editorNode->custom2 > 0) { DilateStepOperation * operation = new DilateStepOperation(); diff --git a/source/blender/compositor/nodes/COM_GlareNode.cpp b/source/blender/compositor/nodes/COM_GlareNode.cpp index 9382e726d76..dc367040c9a 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.cpp +++ b/source/blender/compositor/nodes/COM_GlareNode.cpp @@ -29,6 +29,7 @@ #include "COM_SetValueOperation.h" #include "COM_MixBlendOperation.h" #include "COM_FastGaussianBlurOperation.h" +#include "COM_GlareGhostOperation.h" GlareNode::GlareNode(bNode *editorNode): Node(editorNode) { @@ -42,6 +43,30 @@ void GlareNode::convertToOperations(ExecutionSystem *system, CompositorContext * switch (glare->type) { default: + case 3: + { + GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation(); + GlareGhostOperation * glareoperation = new GlareGhostOperation(); + SetValueOperation * mixvalueoperation = new SetValueOperation(); + MixBlendOperation * mixoperation = new MixBlendOperation(); + + this->getInputSocket(0)->relinkConnections(thresholdOperation->getInputSocket(0), 0, system); + addLink(system, thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0)); + addLink(system, mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0)); + addLink(system, glareoperation->getOutputSocket(), mixoperation->getInputSocket(2)); + addLink(system, thresholdOperation->getInputSocket(0)->getConnection()->getFromSocket(), mixoperation->getInputSocket(1)); + this->getOutputSocket()->relinkConnections(mixoperation->getOutputSocket()); + + thresholdOperation->setThreshold(glare->threshold); + glareoperation->setGlareSettings(glare); + mixvalueoperation->setValue(0.5f+glare->mix*0.5f); + mixoperation->setResolutionInputSocketIndex(1); + + system->addOperation(glareoperation); + system->addOperation(thresholdOperation); + system->addOperation(mixvalueoperation); + system->addOperation(mixoperation); + } case 2: // streaks { GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation(); diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp index 5300d2deffc..7f14b068136 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cpp +++ b/source/blender/compositor/nodes/COM_ImageNode.cpp @@ -66,6 +66,7 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext * ImageUser *imageuser = (ImageUser*)editorNode->storage; int framenumber = context->getFramenumber(); int numberOfOutputs = this->getNumberOfOutputSockets(); + BKE_image_user_frame_calc(imageuser, context->getFramenumber(), 0); /* force a load, we assume iuser index will be set OK anyway */ if (image && image->type==IMA_TYPE_MULTILAYER) { |