[Bf-blender-cvs] [64362a1c13f] lanpr-under-gp: LineArt: Prompt on baking finish.
YimingWu
noreply at git.blender.org
Thu Aug 27 05:41:59 CEST 2020
Commit: 64362a1c13fcbc699751cdc450ab565bbdb49c5d
Author: YimingWu
Date: Thu Aug 27 11:39:16 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB64362a1c13fcbc699751cdc450ab565bbdb49c5d
LineArt: Prompt on baking finish.
===================================================================
M source/blender/editors/include/ED_lineart.h
M source/blender/editors/lineart/lineart_cpu.c
===================================================================
diff --git a/source/blender/editors/include/ED_lineart.h b/source/blender/editors/include/ED_lineart.h
index d511f0bf090..b2b47c4ebdd 100644
--- a/source/blender/editors/include/ED_lineart.h
+++ b/source/blender/editors/include/ED_lineart.h
@@ -21,8 +21,7 @@
* \ingroup editors
*/
-#ifndef __ED_LRT_H__
-#define __ED_LRT_H__
+#pragma once
#ifndef WITH_LINEART
# error Lineart code included in non-Lineart-enabled build
@@ -544,7 +543,7 @@ struct bGPDframe;
struct GpencilModifierData;
void ED_lineart_gpencil_generate_from_chain(struct Depsgraph *depsgraph,
- float *gp_obmat,
+ float **gp_obmat_inverse,
struct bGPDlayer *UNUSED(gpl),
struct bGPDframe *gpf,
int level_start,
@@ -594,5 +593,3 @@ void SCENE_OT_lineart_update_strokes(struct wmOperatorType *ot);
void SCENE_OT_lineart_bake_strokes(struct wmOperatorType *ot);
void ED_operatortypes_lineart(void);
-
-#endif /* __ED_LRT_H__ */
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index ebbafd7fc49..2291701b3f6 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -70,7 +70,7 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "BKE_text.h"
+#include "UI_resources.h"
#include "lineart_intern.h"
@@ -3620,6 +3620,7 @@ int ED_lineart_compute_feature_lines_internal(Depsgraph *depsgraph, const int sh
LRT_PROGRESS(100, "LRT: Finished.");
#undef LRT_PROGRESS
+#undef LRT_CANCEL_STAGE
return OPERATOR_FINISHED;
}
@@ -3713,7 +3714,7 @@ static void lineart_gpencil_notify_targets(Depsgraph *dg)
}
void ED_lineart_gpencil_generate_from_chain(Depsgraph *UNUSED(depsgraph),
- float *gp_obmat_inverse,
+ float **gp_obmat_inverse,
bGPDlayer *UNUSED(gpl),
bGPDframe *gpf,
int level_start,
@@ -3899,7 +3900,7 @@ static int lineart_gpencil_update_strokes_exec(bContext *C, wmOperator *UNUSED(o
return OPERATOR_FINISHED;
}
-static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *UNUSED(op))
+static int lineart_gpencil_bake_strokes_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Scene *scene = CTX_data_scene(C);
Depsgraph *dg = CTX_data_depsgraph_pointer(C);
@@ -4002,6 +4003,14 @@ static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *UNUSED(op)
ED_lineart_modifier_sync_flag_set(LRT_SYNC_IDLE, false);
ED_lineart_calculation_flag_set(LRT_RENDER_FINISHED);
+ BKE_report(op->reports, RPT_INFO, "Line Art baking is complete.");
+ WM_operator_confirm_message_ex(C,
+ op,
+ "Line Art baking is complete.",
+ ICON_MOD_WIREFRAME,
+ "Disable Line Art master switch",
+ WM_OP_EXEC_REGION_WIN);
+
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED | ND_SPACE_PROPERTIES, NULL);
ED_lineart_update_render_progress(100, NULL);
@@ -4009,6 +4018,16 @@ static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *UNUSED(op)
return OPERATOR_FINISHED;
}
+static int lineart_gpencil_bake_strokes_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+
+ /* If confirmed in the dialog, then just turn off the master switch upon finished baking. */
+ scene->lineart.flags &= (~LRT_AUTO_UPDATE);
+
+ return OPERATOR_FINISHED;
+}
+
/* Blocking 1 frame update */
void SCENE_OT_lineart_update_strokes(wmOperatorType *ot)
{
@@ -4026,6 +4045,7 @@ void SCENE_OT_lineart_bake_strokes(wmOperatorType *ot)
ot->description = "Bake Line Art into grease pencil strokes for all frames";
ot->idname = "SCENE_OT_lineart_bake_strokes";
+ ot->invoke = lineart_gpencil_bake_strokes_invoke;
ot->exec = lineart_gpencil_bake_strokes_exec;
}
More information about the Bf-blender-cvs
mailing list