Fix #100596: Use sequencer override camera for line art in render #110287

Merged
YimingWu merged 3 commits from ChengduLittleA/blender:fix-100596 into main 2023-09-19 15:27:54 +02:00
Member

Line art doesn't take sequencer scene override camera into account when
computing line results, now it will try to get override camera info from
render and use that camera if line art override camera itself isn't set.

This will however not fix VSE preview line art result, since the preview
render doesn't give actual camera object, but rather uses a set of clip
planes and matrix info, thus it's probably not possible to do preview
camera override under current architecture.

Line art doesn't take sequencer scene override camera into account when computing line results, now it will try to get override camera info from render and use that camera if line art override camera itself isn't set. This will however not fix VSE preview line art result, since the preview render doesn't give actual camera object, but rather uses a set of clip planes and matrix info, thus it's probably not possible to do preview camera override under current architecture.
YimingWu added the
Interest
Grease Pencil
Module
Grease Pencil
labels 2023-07-20 06:01:56 +02:00
Author
Member

This probably should be backported to 3.3 and 3.6 as well

This probably should be backported to 3.3 and 3.6 as well

Tested, works well in render
@iss, any idea how to bring correct previews in VSE?

Attaching rendered video with the patch to see it in action

Tested, works well in render @iss, any idea how to bring correct previews in VSE? Attaching rendered video with the patch to see it in action

image
attaching screenshot of preview issue

![image](/attachments/50a9b974-f4bd-4cb2-a32d-c0868687c546) attaching screenshot of preview issue
Author
Member

@frogstomp It might not be possible at the moment, because the vse render preview call doesn't provide camera argument, but rather the perspective information the camera has. Since the depsgraph update is needed to actually switch the camera, I'm not sure how we can solve this without breaking a ton of stuff

@frogstomp It might not be possible at the moment, because the vse render preview call doesn't provide camera argument, but rather the perspective information the camera has. Since the depsgraph update is needed to actually switch the camera, I'm not sure how we can solve this without breaking a ton of stuff

@ChengduLittleA if that is the case I can live with that. since the code only affects grease pencil/lineart do we need other module owners to confirm patch?
ideally, if this cannot be solved VSE would display warning somewhere, but that would also require VSE to detect if scene has lineart, which is probably out of scope.

@ChengduLittleA if that is the case I can live with that. since the code only affects grease pencil/lineart do we need other module owners to confirm patch? ideally, if this cannot be solved VSE would display warning somewhere, but that would also require VSE to detect if scene has lineart, which is probably out of scope.

As @Sergey pointed out in chat discussion, the preview update is correct when setting view mode to Rendered.
image

As @Sergey pointed out in chat discussion, the preview update is correct when setting view mode to Rendered. ![image](/attachments/d6d8803b-ab25-4b7c-9c26-51cd1cba0dd8)
122 KiB
Aleš Jelovčan requested review from Aleš Jelovčan 2023-07-20 13:06:08 +02:00

Attaching test file
@filedescriptor, @antoniov could you take a look and help us get this one into main and backport please?
Targeting 3.6.2 (would also help me a lot with a project in progress)

Attaching test file @filedescriptor, @antoniov could you take a look and help us get this one into main and backport please? Targeting 3.6.2 (would also help me a lot with a project in progress)
YimingWu requested review from Antonio Vazquez 2023-07-20 14:58:58 +02:00
YimingWu requested review from Falk David 2023-07-20 14:58:59 +02:00
Author
Member

Hi @frogstomp you don't actually need to add yourself to the reviewer list. The ui is indeed a bit confusing...

Hi @frogstomp you don't actually need to add yourself to the reviewer list. The ui is indeed a bit confusing...

Tested also on blender-v3.6-release branch. Only difference is that it is not directly applicable to CMakeLists.txt, I added this line to it manually:
../render/intern

All good!

Tested also on blender-v3.6-release branch. Only difference is that it is not directly applicable to CMakeLists.txt, I added this line to it manually: ../render/intern All good!

Actually, by further tests I discovered one shortcoming:

  • if lineart is not set to "In front" and instead it uses offset towards camera, it will not offset towards the correct camera.
    I am guessing the path of code that checks for this also needs to be adapted.

@ChengduLittleA what do you say, doable?

Actually, by further tests I discovered one shortcoming: - if lineart is not set to "In front" and instead it uses offset towards camera, it will not offset towards the correct camera. I am guessing the path of code that checks for this also needs to be adapted. @ChengduLittleA what do you say, doable?
Author
Member

Hi @frogstomp indeed, I wasn't considering that, I'll make an update to this. Thanks for the extensive testing! :D

Hi @frogstomp indeed, I wasn't considering that, I'll make an update to this. Thanks for the extensive testing! :D
Aleš Jelovčan approved these changes 2023-07-22 15:48:56 +02:00
First-time contributor

Patch seems to work in my testing resolving the issue I opened once I set the VSE to rendered view and not Solid view!

Patch seems to work in my testing resolving the issue I opened once I set the VSE to rendered view and not Solid view!
Author
Member

@TinyNick It's currently a limitation since VSE solid mode doesn't use "a camera" and it doesn't go through normal rendering pipeline for that, line art can't get that information unfortunately.

@TinyNick It's currently a limitation since VSE solid mode doesn't use "a camera" and it doesn't go through normal rendering pipeline for that, line art can't get that information unfortunately.
Antonio Vazquez refused to review 2023-08-06 11:52:17 +02:00
Falk David requested changes 2023-08-07 18:29:15 +02:00
Falk David left a comment
Member

Some naming comments

Some naming comments
@ -4991,3 +4994,3 @@
Scene *scene = DEG_get_evaluated_scene(depsgraph);
int intersections_only = 0; /* Not used right now, but preserve for future. */
Object *use_camera;
Object *use_camera = nullptr;
Member

Maybe lineart_camera would be a better name here?

Maybe `lineart_camera` would be a better name here?
ChengduLittleA marked this conversation as resolved
@ -4997,3 +5000,4 @@
t_start = PIL_check_seconds_timer();
}
bool re_override = false;
Member

re_override -> use_render_camera_override

`re_override` -> `use_render_camera_override`
ChengduLittleA marked this conversation as resolved
@ -5010,3 +5012,1 @@
if (!scene->camera) {
return false;
Render *re = RE_GetSceneRender(scene);
Member

re -> render

`re` -> `render`
ChengduLittleA marked this conversation as resolved
Author
Member

I'll fix this in a bit :D

I'll fix this in a bit :D
YimingWu force-pushed fix-100596 from 64e3015d9d to 86ab6102fc 2023-09-18 15:29:08 +02:00 Compare
Author
Member

Hi @filedescriptor I guess this is good?

Hi @filedescriptor I guess this is good?
Falk David approved these changes 2023-09-19 11:20:36 +02:00
YimingWu merged commit 954ae19b2b into main 2023-09-19 15:27:54 +02:00
YimingWu deleted branch fix-100596 2023-09-19 15:27:56 +02:00
Clément Foucault reviewed 2023-09-20 17:38:10 +02:00
@ -53,2 +53,4 @@
#include "MEM_guardedalloc.h"
#include "RE_pipeline.h"
#include "render_types.h"

I have to use #include "intern/render_types.h" if I want to build with xcode.

I have to use `#include "intern/render_types.h"` if I want to build with xcode.
ChengduLittleA marked this conversation as 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
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#110287
No description provided.