WIP: Compositor: add aspect ratio display in node viewer #106338
Draft
Habib Gahbiche
wants to merge 3 commits from
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
zazizizou/blender:com-backdrop-aspect-ratio
into main
pull from: zazizizou/blender:com-backdrop-aspect-ratio
merge into: blender:main
blender:main
blender:universal-scene-description
blender:temp-sculpt-dyntopo
blender:blender-v3.3-release
blender:blender-v3.6-release
blender:asset-browser-frontend-split
blender:brush-assets-project
blender:asset-shelf
blender:anim/armature-drawing-refactor-3
blender:temp-sculpt-dyntopo-hive-alloc
blender:tmp-usd-python-mtl
blender:tmp-usd-3.6
blender:blender-v3.5-release
blender:blender-projects-basics
blender:blender-v2.93-release
blender:temp-sculpt-attr-api
blender:realtime-clock
blender:sculpt-dev
blender:gpencil-next
blender:bevelv2
blender:microfacet_hair
blender:xr-dev
blender:principled-v2
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Reviewers
Request review
No reviewers
Labels
Clear labels
This issue affects/is about backward or forward compatibility
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
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
This issue affects/is about backward or forward compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
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
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
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
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
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 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 & 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
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
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
5 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#106338
Reference in New Issue
There is no content yet.
Delete Branch "zazizizou/blender:com-backdrop-aspect-ratio"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Node viewer can now show the image with desired aspect ratio (does not affect render).
Attached gif shows how the UI looks like. Existing functionalities like backdrop offset and scaling through backdrop gizmo still behave the same as before.
WIP: defaults are not working / Might need tweeks to UI depending on feedback / Code style
@SteffenD behavior of aspect ratio is the same as in image and movie clip editors. Is that also how you would expect it to behave (see attached gif)?
@Jeroen-Bakker I'm having a hard time setting default values for the new values. I tried the following:
RNA_def_property_float_default(prop, 1.0f);
inrna_space.c
snode->xasp = 1.0f;
innode_create()
inspace_node.c
DNA_space_defaults.h
But Blender still sets values to
0.0f
on start. Could you help me by pointing out where defaults get set?Awesome! The behaviour in the GIF is perfect :)
@SteffenD ok thanks!
After some investigation I found out that creating a new compositor space will have the correct defaults (from step 2 above).
RNA_def_property_float_default
is called when user clicks "Reset to Default Value". So the only way of starting blender with the desired values is to edit the startup blend filestartup.blend
. Is this correct?Another approach would be to pass the aspect ratio via the meta data and use it. Might be better than adding an option. But requires more work as nodes can alter the aspect ratio.
I can imagine that the in the proposed solution the user has to alter the aspect ratio based on what they are looking at and that is adding more work towards the user. Although we might want the user to tweak final values, I do think this should be made as automatically as much as possible.
@Jeroen-Bakker but this is how the movie clip editor and the image editor change display ratio. The user has to alter the aspect ratio manually there also. So this patch addresses the consistency problem.
I agree this should be done as automatically as possible, but is it possible to do that as a next step after this patch?
In the image editor the aspect ratio is stored inside the image, so when switching the image the correct aspect ratio is used. Same for movie clip editor.
This patch stored the aspect ratio as node attribute, which in case you're switching inputs the aspect ratio will that of the node. This is different (from user point of view) compared to the other editors.
The display aspect inside the image/movie clip editor is read from the next locations.
Even render results have aspect ratios. There might be issues when mixing or other ways where aspect ratios cannot be decided. In these cases I can expect that the node will have an aspect ratio.
These limitations might require a different UI as there are quite a few options already:
So to find out the correct location we should collect user feedback.
@eyecandy do you have any ideas about viewer node display aspect ratios? and how you would use them
@eyecandy I was wondering if you had a chance to look at this? I have time to work on this next week...
I checked with @eyecandy and we are struggling with finding the usage/benefit of this patch. I still believe that this should be collected from the input of the node tree where the viewer is connected to and not being a setting on the viewer node.
Can someone clarify what actual issue this solves and why adding the aspect rations in the viewer node is needed.
@Jeroen-Bakker / @eyecandy I see, thanks for looking into this.
For me it's just a problem of consistent viewing across the different editors. If you work with anamorphic input then you will be able to display the correct aspect in movie clip editor and image editor but not in node editor (see attachment). I am not aware of a solution to this, that's why I submitted the patch.
As for implementation I don't have a strong opinion, I would go with Jeroen's suggestion if we agree backdrop must consider aspect ratio.
We discussed this in the VFX meeting, and I thought we might as well add the option here for those working with anamorphic video files. But I changed my mind after looking at this more closely.
The issue is that compositing in general doesn't work correctly on anamorphic video, filters and transforms will give wrong results. The workflow in a few other compositing apps seems to be to desqueeze the image with a node before processing it, rather than having viewer options for aspect ratio. I think that's what we should recommend too, rather than going in the direction of a workflow where we will hit limitations at some point anyway.
You indeed need to "unsquish" the input, otherwise things like lens distortion will not work (as it is in the non-squished space, and caibraiton can not be mapped form one to another).
What I am not sure is whether you "squish" the image back before writing it to disk. You probably don't for the final output, if you're creating a clean plate maybe there are some benefits for squishing things back.
But now when I think of it, you probably will not use the viewer node to look into the squished result, as it will be at the end. And if the output image is to be squished, and you still want to see it, you can use the aspect ratio in the image editor.
There are couple of things I am wondering though.
Thanks for looking into this patch.
I approached this as a bug after fixing #105590, not as a direct user request, so I don't have a strong opinion on how anamorphic input should be handled.
The idea of the patch #106121 is indeed to "squish" the mask before applying it to the image in order to have correct results. So I see 2 options on how to proceed here:
I think that if you're doing any non trivial compositing, your camera input may be anamorphic but there's no good reason to output it anamorphic again. It's a quirk that cameras work this way, and it's good to get raw data from the camera without scaling so that you have as much control as possible in compositing. But for the final output, I don't see the point.
A utility node to scale anamorphic footage could be nice. Or even an option for image reading also available in the sequencer.