[Bf-blender-cvs] [157f4f37add] lanpr-under-gp: LineArt: Fixed viewport auto update.
YimingWu
noreply at git.blender.org
Fri Sep 25 14:39:33 CEST 2020
Commit: 157f4f37add9bd057894c883d034e0b196506ef4
Author: YimingWu
Date: Fri Sep 25 20:38:57 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB157f4f37add9bd057894c883d034e0b196506ef4
LineArt: Fixed viewport auto update.
===================================================================
M source/blender/editors/lineart/lineart_cpu.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 7af9e4e3985..0d351927355 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -4383,11 +4383,14 @@ void ED_lineart_post_frame_update_external(bContext *C,
printf("LRT: ---- Destroy on update (%d).\n", is_render);
}
- // ED_lineart_destroy_render_data_external();
+ /* Currently the data is destroyed upon turning off line art. Destroying here post many
+ * problems as this function might get called during rendering for the viewport. */
+ /* ED_lineart_destroy_render_data_external(); */
}
- /* At this stage GP should have all the data. We clear the flag */
- // ED_lineart_modifier_sync_flag_set(LRT_SYNC_IDLE, from_modifier);
+ /* At this stage GP should have all the data. We clear the flag. This is needed for real-time
+ * update on editing in the viewport. */
+ ED_lineart_modifier_sync_flag_set(LRT_SYNC_IDLE, from_modifier);
}
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 6802d5f45a0..4c7bbdbf694 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2608,6 +2608,19 @@ static void rna_lineart_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UN
}
}
+static void rna_lineart_auto_update_set(PointerRNA *ptr, bool value)
+{
+ Scene *data = (Scene *)ptr->data;
+
+ if (value) {
+ data->lineart.flags |= LRT_AUTO_UPDATE;
+ }
+ else {
+ data->lineart.flags &= (~LRT_AUTO_UPDATE);
+ ED_lineart_destroy_render_data_external();
+ }
+}
+
static char *rna_FFmpegSettings_path(PointerRNA *UNUSED(ptr))
{
return BLI_strdup("render.ffmpeg");
@@ -7335,6 +7348,8 @@ static void rna_def_scene_lineart(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(
prop, "Auto Update", "Automatically update Line Art cache when frame changes");
+
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_lineart_auto_update_set");
/* Also use this update callback to trigger the modifier to clear the frame */
RNA_def_property_update(prop, NC_SCENE, "rna_lineart_update");
More information about the Bf-blender-cvs
mailing list