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
2 changed files with 22 additions and 10 deletions

View File

@ -13,6 +13,7 @@ set(INC
../editors/include
../makesrna
../render
../render/intern
../windowmanager
../../../intern/eigen

View File

@ -52,6 +52,9 @@
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "RE_pipeline.h"
#include "render_types.h"
ChengduLittleA marked this conversation as resolved

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.
#include "lineart_intern.h"
struct LineartIsecSingle {
@ -4991,34 +4994,42 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
LineartData *ld;
Scene *scene = DEG_get_evaluated_scene(depsgraph);
int intersections_only = 0; /* Not used right now, but preserve for future. */
ChengduLittleA marked this conversation as resolved Outdated

Maybe lineart_camera would be a better name here?

Maybe `lineart_camera` would be a better name here?
Object *use_camera;
Object *lineart_camera = nullptr;
double t_start;
if (G.debug_value == 4000) {
t_start = PIL_check_seconds_timer();
}
ChengduLittleA marked this conversation as resolved Outdated

re_override -> use_render_camera_override

`re_override` -> `use_render_camera_override`
bool use_render_camera_override = false;
if (lmd->calculation_flags & LRT_USE_CUSTOM_CAMERA) {
if (!lmd->source_camera ||
(use_camera = DEG_get_evaluated_object(depsgraph, lmd->source_camera))->type != OB_CAMERA)
(lineart_camera = DEG_get_evaluated_object(depsgraph, lmd->source_camera))->type !=
OB_CAMERA)
{
return false;
}
}
ChengduLittleA marked this conversation as resolved Outdated

re -> render

`re` -> `render`
else {
BKE_scene_camera_switch_update(scene);
if (!scene->camera) {
return false;
Render *render = RE_GetSceneRender(scene);
if (render && render->camera_override) {
lineart_camera = DEG_get_evaluated_object(depsgraph, render->camera_override);
use_render_camera_override = true;
}
if (!lineart_camera) {
BKE_scene_camera_switch_update(scene);
if (!scene->camera) {
return false;
}
lineart_camera = scene->camera;
}
use_camera = scene->camera;
}
LineartCache *lc = lineart_init_cache();
*cached_result = lc;
ld = lineart_create_render_buffer(scene, lmd, use_camera, scene->camera, lc);
ld = lineart_create_render_buffer(
scene, lmd, lineart_camera, use_render_camera_override ? lineart_camera : scene->camera, lc);
/* Triangle thread testing data size varies depending on the thread count.
* See definition of LineartTriangleThread for details. */
@ -5042,7 +5053,7 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
lineart_main_load_geometries(depsgraph,
scene,
use_camera,
lineart_camera,
ld,
lmd->calculation_flags & LRT_ALLOW_DUPLI_OBJECTS,
false,