Fix #129389: Lineart modifier updates when camera changes

The bug occurred when the user changed the camera of the scene.
The lineart modifier was not updating when changing the camera, but only
when changing other elements in the scene or moving the camera.

This is resolved by adding a depsgraph update for scene parameters, such
as when changing the camera.

Testing:
Add two cameras, add a Grease Pencil Collection Line Art, go into camera
perspective view and then switch to the other camera.
The Grease Pencil Line Art now updates automatically.

Co-authored-by: YimingWu <chengdulittlea@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/129935
This commit is contained in:
ernst-ellert
2024-11-20 04:47:05 +01:00
committed by YimingWu
parent 2dd0946e97
commit 73a3ebea56

View File

@@ -210,6 +210,7 @@ static void update_depsgraph(ModifierData *md, const ModifierUpdateDepsgraphCont
ctx->node, ctx->scene->camera, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
DEG_add_object_relation(
ctx->node, ctx->scene->camera, DEG_OB_COMP_PARAMETERS, "Line Art Modifier");
DEG_add_scene_relation(ctx->node, ctx->scene, DEG_SCENE_COMP_PARAMETERS, "Line Art Modifier");
}
if (lmd->light_contour_object) {
DEG_add_object_relation(