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
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-09-28 20:33:06 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-28 23:00:17 +0300
commitf84fb12f5d72433780a96c3cc4381399f153cf1a (patch)
tree62ca25765b3b5ccc2bc8ca35449ddd8f3999071a /source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
parent76377f0176b9561a7fc8f46b4ed704c631ddd90d (diff)
Compositor: Add support for canvas compositing
This commit adds functionality for operations that require pixel translation or resizing on "Full Frame" mode, allowing to adjust their canvas. It fixes most cropping issues in translate, scale, rotate and transform nodes by adjusting their canvas to the result, instead of the input canvas. Operations output buffer is still always on (0,0) position for easier image algorithm implementation, even when the canvas is not. Current limitations (will be addressed on bcon2): - Displayed translation in Viewer node is limited to 6000px. - When scaling up the canvas size is limited to the scene resolution size x 1.5 . From that point it crops. If none of these limitations are hit, the Viewer node displays the full input with any translation. Differential Revision: https://developer.blender.org/D12466
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
index 5654ea0425d..aed91d4d46e 100644
--- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
+++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cc
@@ -31,6 +31,7 @@ MovieClipAttributeOperation::MovieClipAttributeOperation()
this->m_invert = false;
needs_canvas_to_get_constant_ = true;
is_value_calculated_ = false;
+ stabilization_resolution_socket_ = nullptr;
}
void MovieClipAttributeOperation::initExecution()
@@ -53,8 +54,17 @@ void MovieClipAttributeOperation::calc_value()
scale = 1.0f;
angle = 0.0f;
int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_clip, this->m_framenumber);
- BKE_tracking_stabilization_data_get(
- this->m_clip, clip_framenr, getWidth(), getHeight(), loc, &scale, &angle);
+ NodeOperation &stabilization_operation =
+ stabilization_resolution_socket_ ?
+ stabilization_resolution_socket_->getLink()->getOperation() :
+ *this;
+ BKE_tracking_stabilization_data_get(this->m_clip,
+ clip_framenr,
+ stabilization_operation.getWidth(),
+ stabilization_operation.getHeight(),
+ loc,
+ &scale,
+ &angle);
switch (this->m_attribute) {
case MCA_SCALE:
this->m_value = scale;