[video sequence editor] Offset and crop of strips are wrong #34013

Closed
opened 2013-01-27 21:01:33 +01:00 by Jehan Pagès · 4 comments

%%%Hi,

bug happening on the dev version (svn): setting offset or crop value gets completely wrong rendering. See bug_transform.png
As you can see from the image, here is the procedure:

  • I have a simple image bla.png, and I offset it of 200px.
  • check you have a 100% resolution.
  • check the actual offset. In my example, that's 100px.

Crops also have the same issue (the crops are completely different from the expected value).
See transform_bug.blend (though it is extremely easy to reproduce anyway).

The reason is that in source/blender/blenkernel/intern/sequencer.c: input_preprocess(), there is this strange code, which scales the crop or offset depending on the strip image size:
xscale /= (double)context.rectx / (double)ibuf->x;
yscale /= (double)context.recty / (double)ibuf->y;

This is wrong, and anyway even removing only this lines is not good either, because any scaling is wrong at this state as actual scaling is done later (so if you actually scale, you get double scaling of your transformation).
Then I saw I was basically reverting commit 52629 (which itself was reverting 50901, with this additional logics of scaling depending on image buffer dimensions).

So I checked this bug report #33295 (for which commit 52629 has been done), and looked at the bug.
Basically the bug in #33295 was because color strips are "preprocessed" strips (already at the scaled size). So in this case only you want to pre-scale the offsets and the crops (and they won't be scaled a second time because the finale render is already the right size as well in preprocessed strip case).

So the attached patch transform_bug.diff fixes both the current issue and the one from #33295 as you can see from my blend file and from the blend file in this other ticket.%%%

%%%Hi, bug happening on the dev version (svn): setting offset or crop value gets completely wrong rendering. See bug_transform.png As you can see from the image, here is the procedure: * I have a simple image bla.png, and I offset it of 200px. * check you have a 100% resolution. * check the actual offset. In my example, that's 100px. Crops also have the same issue (the crops are completely different from the expected value). See transform_bug.blend (though it is extremely easy to reproduce anyway). The reason is that in source/blender/blenkernel/intern/sequencer.c: input_preprocess(), there is this strange code, which scales the crop or offset depending on the strip image size: xscale /= (double)context.rectx / (double)ibuf->x; yscale /= (double)context.recty / (double)ibuf->y; This is wrong, and anyway even removing only this lines is not good either, because any scaling is wrong at this state as actual scaling is done later (so if you actually scale, you get double scaling of your transformation). Then I saw I was basically reverting commit 52629 (which itself was reverting 50901, with this additional logics of scaling depending on image buffer dimensions). So I checked this bug report #33295 (for which commit 52629 has been done), and looked at the bug. Basically the bug in #33295 was because color strips are "preprocessed" strips (already at the scaled size). So in *this case only* you want to pre-scale the offsets and the crops (and they won't be scaled a second time because the finale render is already the right size as well in preprocessed strip case). So the attached patch transform_bug.diff fixes both the current issue and the one from #33295 as you can see from my blend file and from the blend file in this other ticket.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%I attach a new version of the patch, transform_bug_v2.diff.
That's basically the same with a small fix (happening only with preprocessed sequences with crop only (no transform), and also a nicer code (more systematic).%%%

%%%I attach a new version of the patch, transform_bug_v2.diff. That's basically the same with a small fix (happening only with preprocessed sequences with crop only (no transform), and also a nicer code (more systematic).%%%
Member

%%%confirmed the issue and the patch is now in SVN.

Closing this now.

Thanks for the thorough investigation and the patch!

Regards
Peter%%%

%%%confirmed the issue and the patch is now in SVN. Closing this now. Thanks for the thorough investigation and the patch! Regards Peter%%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#34013
No description provided.