69 if (
G.debug_value == 4000) {
70 printf(
"LRT: Generating from modifier.\n");
159 lmd->
cache = local_lc;
223 bool default_add =
true;
314 uiItemR(sub,
ptr,
"source_collection", 0,
NULL, ICON_OUTLINER_COLLECTION);
315 uiItemR(sub,
ptr,
"use_invert_collection", 0,
"", ICON_ARROW_LEFTRIGHT);
324 bool material_valid =
false;
334 row,
ptr,
"target_material", &obj_data_ptr,
"materials",
NULL, ICON_SHADING_TEXTURE);
360 uiItemR(sub,
ptr,
"shadow_region_filtering", 0,
IFACE_(
"Illumination Filtering"), ICON_NONE);
365 uiItemR(sub,
ptr,
"use_contour", 0,
"", ICON_NONE);
369 uiItemR(entry,
ptr,
"silhouette_filtering", 0,
"", ICON_NONE);
371 const int silhouette_filtering =
RNA_enum_get(
ptr,
"silhouette_filtering");
373 uiItemR(entry,
ptr,
"use_invert_silhouette", 0,
"", ICON_ARROW_LEFTRIGHT);
377 if (use_cache && !is_first) {
378 uiItemR(sub,
ptr,
"use_crease", 0,
IFACE_(
"Crease (Angle Cached)"), ICON_NONE);
381 uiItemR(sub,
ptr,
"use_crease", 0,
"", ICON_NONE);
399 uiItemR(sub,
ptr,
"use_light_contour", 0,
IFACE_(
"Light Contour"), ICON_NONE);
406 if (use_cache && !is_first) {
412 "use_overlap_edge_type_support",
414 IFACE_(
"Allow Overlapping Types"),
433 if (use_cache && !is_first) {
434 uiItemL(layout,
"Cached from the first line art modifier.", ICON_INFO);
443 uiItemR(remaining,
ptr,
"shadow_camera_size", 0,
NULL, ICON_NONE);
446 uiItemR(
col,
ptr,
"shadow_camera_near", 0,
"Near", ICON_NONE);
463 if (use_cache && !is_first) {
464 uiItemL(layout,
TIP_(
"Cached from the first line art modifier"), ICON_INFO);
469 uiItemR(row,
ptr,
"use_custom_camera", 0,
"", 0);
473 uiItemR(subrow,
ptr,
"source_camera", 0,
"", ICON_OBJECT_DATA);
477 uiItemR(
col,
ptr,
"use_edge_overlap", 0,
IFACE_(
"Overlapping Edges As Contour"), ICON_NONE);
482 uiItemR(
col,
ptr,
"use_back_face_culling", 0,
IFACE_(
"Force Backface Culling"), ICON_NONE);
499 if (!show_in_front) {
500 uiItemL(layout,
TIP_(
"Object is not in front"), ICON_INFO);
508 if (use_multiple_levels) {
523 if (use_multiple_levels) {
524 return (
MAX2(level_start, level_end) > 0);
526 return (level_start > 0);
541 uiItemR(layout,
ptr,
"use_material_mask", 0,
IFACE_(
"Material Mask"), ICON_NONE);
561 for (
int i = 0; i < 8; i++) {
568 uiItemR(layout,
ptr,
"use_material_mask_match", 0,
IFACE_(
"Exact Match"), ICON_NONE);
587 for (
int i = 0; i < 8; i++) {
594 uiItemR(layout,
ptr,
"use_intersection_match", 0,
IFACE_(
"Exact Match"), ICON_NONE);
607 if (!use_cache || is_first) {
609 uiItemR(layout,
ptr,
"use_face_mark", 0,
IFACE_(
"Face Mark Filtering"), ICON_NONE);
629 if (use_cache && !is_first) {
630 uiItemL(layout,
TIP_(
"Cached from the first line art modifier"), ICON_INFO);
639 uiItemR(layout,
ptr,
"use_face_mark_boundaries", 0,
NULL, ICON_NONE);
640 uiItemR(layout,
ptr,
"use_face_mark_keep_contour", 0,
NULL, ICON_NONE);
658 if (use_cache && !is_first) {
659 uiItemL(layout,
TIP_(
"Cached from the first line art modifier"), ICON_INFO);
673 "chaining_image_threshold",
675 is_geom ?
IFACE_(
"Geometry Threshold") :
NULL,
696 if (use_cache && !is_first) {
697 uiItemL(layout,
TIP_(
"Cached from the first line art modifier"), ICON_INFO);
705 uiItemR(row,
ptr,
"source_vertex_group", 0,
IFACE_(
"Filter Source"), ICON_GROUP_VERTEX);
710 const bool match_output =
RNA_boolean_get(
ptr,
"use_output_vertex_group_match_by_name");
713 col,
ptr,
"vertex_group", &ob_ptr,
"vertex_groups",
IFACE_(
"Target"), ICON_NONE);
738 uiItemO(
col,
NULL, ICON_NONE,
"OBJECT_OT_lineart_bake_strokes_all");
757 uiItemR(layout,
ptr,
"use_image_boundary_trimming", 0,
NULL, ICON_NONE);
760 uiItemL(layout,
TIP_(
"Object is shown in front"), ICON_ERROR);
768 col,
ptr,
"use_offset_towards_custom_camera", 0,
IFACE_(
"Towards Custom Camera"), ICON_NONE);
810 "LineartGpencilModifierData",
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode)
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END
void BKE_gpencil_frame_active_set(struct Depsgraph *depsgraph, struct bGPdata *gpd)
int BKE_gpencil_object_material_index_get(struct Object *ob, struct Material *ma)
struct bGPDlayer * BKE_gpencil_layer_get_by_name(struct bGPdata *gpd, char *name, int first_if_not_found)
void BKE_gpencil_modifier_copydata_generic(const struct GpencilModifierData *md_src, struct GpencilModifierData *md_dst)
@ eGpencilModifierTypeFlag_SupportsEditmode
@ eGpencilModifierTypeType_Gpencil
bool BKE_gpencil_is_first_lineart_in_stack(const struct Object *ob, const struct GpencilModifierData *md)
void(* IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
struct Depsgraph Depsgraph
void DEG_add_object_relation(struct DepsNodeHandle *node_handle, struct Object *object, eDepsObjectComponentType component, const char *description)
Object groups, one object can be in many groups at once.
#define DNA_struct_default_get(struct_name)
@ LRT_SILHOUETTE_FILTER_NONE
struct LineartGpencilModifierData LineartGpencilModifierData
@ eGpencilModifierType_Lineart
Object is a sort of wrapper for general info.
PointerRNA * gpencil_modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void gpencil_modifier_panel_end(uiLayout *layout, PointerRNA *ptr)
PanelType * gpencil_modifier_subpanel_register(ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelType *parent)
PanelType * gpencil_modifier_panel_register(ARegionType *region_type, GpencilModifierType type, PanelDrawFn draw)
static void face_mark_panel_draw(const bContext *UNUSED(C), Panel *panel)
static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams))
static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void intersection_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void face_mark_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
static bool isModifierDisabled(GpencilModifierData *md)
static void edge_types_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
static bool anything_showing_through(PointerRNA *ptr)
static void vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
static void bakeModifier(Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
static void bake_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void add_this_collection(Collection *c, const ModifierUpdateDepsgraphContext *ctx, const int mode)
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void options_light_reference_draw(const bContext *UNUSED(C), Panel *panel)
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
static void panelRegister(ARegionType *region_type)
static void initData(GpencilModifierData *md)
static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob)
GpencilModifierTypeInfo modifierType_Gpencil_Lineart
static void material_mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void generate_strokes_actual(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
static void options_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void updateDepsgraph(GpencilModifierData *md, const ModifierUpdateDepsgraphContext *ctx, const int mode)
static void composition_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
void uiLayoutSetActive(uiLayout *layout, bool active)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemL(uiLayout *layout, const char *name, int icon)
void uiLayoutSetRedAlert(uiLayout *layout, bool redalert)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
@ UI_ITEM_R_FORCE_BLANK_DECORATE
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon)
const Depsgraph * depsgraph
void MOD_lineart_chain_clear_picked_flag(LineartCache *lc)
void MOD_lineart_clear_cache(struct LineartCache **lc)
void MOD_lineart_destroy_render_data(LineartGpencilModifierData *lmd)
bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph, LineartGpencilModifierData *lmd, LineartCache **cached_result, bool enable_stroke_depth_offset)
void MOD_lineart_gpencil_generate(LineartCache *cache, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, int8_t source_type, void *source_reference, int level_start, int level_end, int mat_nr, int16_t edge_types, uchar mask_switches, uchar material_mask_bits, uchar intersection_mask, int16_t thickness, float opacity, uchar shadow_selection, uchar silhouette_mode, const char *source_vgname, const char *vgname, int modifier_flags, int modifier_calculation_flags)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_pointer_is_null(const PointerRNA *ptr)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
struct Collection * source_collection
struct Object * light_contour_object
unsigned char mask_switches
short edge_types_override
char shadow_selection_override
struct LineartCache * cache
struct Object * source_camera
char source_vertex_group[64]
unsigned char shadow_selection
unsigned char intersection_mask
struct Material * target_material
unsigned char material_mask_bits
unsigned char silhouette_selection
struct Object * source_object
struct DepsNodeHandle * node
struct Collection * master_collection
struct LineartCache * lineart_cache
void WM_main_add_notifier(unsigned int type, void *reference)