diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-08-08 15:50:20 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-08-08 18:11:54 +0300 |
commit | 723c45a8e60077b570e20d6b1b774c83d82a8e70 (patch) | |
tree | 538b7c58e088d4404c84300dbad7b57a8f633a41 /source/blender/compositor/intern | |
parent | 80484794165c8a0a62dcb6309c111dede6f0c9be (diff) |
Compositor: Full frame Bokeh Blur and Blur nodes
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperation.cc | 6 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperation.h | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index 575e8446abe..1b87cdf72fb 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -82,8 +82,12 @@ void NodeOperation::determineResolution(unsigned int resolution[2], input.determineResolution(resolution, preferredResolution); used_resolution_index = m_resolutionInputSocketIndex; } - unsigned int temp2[2] = {resolution[0], resolution[1]}; + if (modify_determined_resolution_fn_) { + modify_determined_resolution_fn_(resolution); + } + + unsigned int temp2[2] = {resolution[0], resolution[1]}; unsigned int temp[2]; for (unsigned int index = 0; index < m_inputs.size(); index++) { if (index == used_resolution_index) { diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index 934007d25ce..b402dc7f174 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -287,6 +287,8 @@ class NodeOperation { */ unsigned int m_resolutionInputSocketIndex; + std::function<void(unsigned int resolution[2])> modify_determined_resolution_fn_; + /** * \brief mutex reference for very special node initializations * \note only use when you really know what you are doing. @@ -518,6 +520,15 @@ class NodeOperation { void setResolutionInputSocketIndex(unsigned int index); /** + * Set a custom function to modify determined resolution from main input just before setting it + * as preferred resolution for the other inputs. + */ + void set_determined_resolution_modifier(std::function<void(unsigned int resolution[2])> fn) + { + modify_determined_resolution_fn_ = fn; + } + + /** * \brief get the render priority of this node. * \note only applicable for output operations like ViewerOperation * \return eCompositorPriority |