Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "DNA_brush_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_material_types.h"
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "DEG_depsgraph.h"
#include "gpencil_intern.h"
Go to the source code of this file.
Classes | |
struct | GPMatArray |
Typedefs | |
typedef struct GPMatArray | GPMatArray |
Variables | |
static const EnumPropertyItem | gpencil_modesEnumPropertyItem_mode [] |
Brush based operators for editing Grease Pencil strokes.
Definition in file gpencil_vertex_ops.c.
typedef struct GPMatArray GPMatArray |
|
static |
Definition at line 733 of file gpencil_vertex_ops.c.
References MaterialGPencilStyle::fill_rgba, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_LINE, GP_MATERIAL_MODE_SQUARE, MaterialGPencilStyle::mode, and MaterialGPencilStyle::stroke_rgba.
Referenced by gpencil_material_to_vertex_exec().
|
static |
Definition at line 636 of file gpencil_vertex_ops.c.
References BKE_gpencil_material_settings(), BKE_palette_from_hash(), BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_int_new(), C, col, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), ED_gpencil_stroke_can_use(), ED_gpencil_stroke_material_editable(), MaterialGPencilStyle::fill_style, MaterialGPencilStyle::flag, GP_MATERIAL_FILL_SHOW, GP_MATERIAL_FILL_STYLE_SOLID, GP_MATERIAL_STROKE_PATTERN, GP_MATERIAL_STROKE_SHOW, GP_MATERIAL_STROKE_STYLE_TEXTURE, GP_STROKE_SELECT, Object::id, LISTBASE_FOREACH, ID::name, NULL, POINTER_FROM_INT, pow(), rgb_to_cpack(), MaterialGPencilStyle::stroke_style, threshold, and bGPDspoint::vert_color.
Referenced by gpencil_extract_palette_vertex_exec(), and gpencil_material_to_vertex_exec().
|
static |
Definition at line 1005 of file gpencil_vertex_ops.c.
References BKE_reportf(), C, gpencil_extract_palette_from_vertex(), OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_int_get(), RPT_ERROR, RPT_INFO, and threshold.
Referenced by GPENCIL_OT_extract_palette_vertex().
Definition at line 994 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), NULL, OB_GPENCIL, and Object::type.
Referenced by GPENCIL_OT_extract_palette_vertex().
|
static |
Definition at line 809 of file gpencil_vertex_ops.c.
References BKE_gpencil_material_add(), BKE_gpencil_material_settings(), BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_len_p(), BKE_object_material_slot_add(), C, copy_v3_v3(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), ED_gpencil_stroke_material_editable(), MaterialGPencilStyle::fill_rgba, MaterialGPencilStyle::fill_style, MaterialGPencilStyle::flag, get_material_type(), GP_MATERIAL_FILL_SHOW, GP_MATERIAL_FILL_STYLE_SOLID, GP_MATERIAL_STROKE_PATTERN, GP_MATERIAL_STROKE_SHOW, GP_MATERIAL_STROKE_STYLE_TEXTURE, GP_STROKE_SELECT, Material::gp_style, gpencil_extract_palette_from_vertex(), bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, GPMatArray::index, GPMatArray::key, LISTBASE_FOREACH, GPMatArray::ma, MEM_calloc_arrayN, MEM_SAFE_FREE, NA_EDITED, NC_GPENCIL, ND_DATA, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, blender::bke::attribute_accessor_functions::remove(), RNA_boolean_get(), MaterialGPencilStyle::stroke_rgba, MaterialGPencilStyle::stroke_style, Object::totcol, bGPDspoint::vert_color, WM_event_add_notifier(), WM_OP_INVOKE_REGION_WIN, and WM_operator_name_call().
Referenced by GPENCIL_OT_material_to_vertex_color().
Definition at line 798 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), NULL, OB_GPENCIL, and Object::type.
Referenced by GPENCIL_OT_material_to_vertex_color().
void GPENCIL_OT_extract_palette_vertex | ( | wmOperatorType * | ot | ) |
Definition at line 1020 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_extract_palette_vertex_exec(), gpencil_extract_palette_vertex_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), RNA_def_int(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_material_to_vertex_color | ( | wmOperatorType * | ot | ) |
Definition at line 968 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_material_to_vertex_exec(), gpencil_material_to_vertex_poll(), wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), RNA_def_int(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_stroke_reset_vertex_color | ( | wmOperatorType * | ot | ) |
Definition at line 1124 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_stroke_reset_vertex_color_exec(), gpencil_vertexpaint_mode_poll(), GPPAINT_MODE_BOTH, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_vertex_color_brightness_contrast | ( | wmOperatorType * | ot | ) |
Definition at line 209 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_modesEnumPropertyItem_mode, gpencil_vertexpaint_brightness_contrast_exec(), gpencil_vertexpaint_mode_poll(), GPPAINT_MODE_BOTH, wmOperatorType::idname, max, min, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_float(), RNA_def_property_ui_range(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_vertex_color_hsv | ( | wmOperatorType * | ot | ) |
Definition at line 331 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_modesEnumPropertyItem_mode, gpencil_vertexpaint_hsv_exec(), gpencil_vertexpaint_mode_poll(), GPPAINT_MODE_BOTH, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_vertex_color_invert | ( | wmOperatorType * | ot | ) |
Definition at line 424 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_modesEnumPropertyItem_mode, gpencil_vertexpaint_invert_exec(), gpencil_vertexpaint_mode_poll(), GPPAINT_MODE_BOTH, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_vertex_color_levels | ( | wmOperatorType * | ot | ) |
Definition at line 515 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_modesEnumPropertyItem_mode, gpencil_vertexpaint_levels_exec(), gpencil_vertexpaint_mode_poll(), GPPAINT_MODE_BOTH, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
void GPENCIL_OT_vertex_color_set | ( | wmOperatorType * | ot | ) |
Definition at line 614 of file gpencil_vertex_ops.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_modesEnumPropertyItem_mode, gpencil_vertexpaint_mode_poll(), gpencil_vertexpaint_set_exec(), GPPAINT_MODE_BOTH, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
|
static |
Definition at line 1044 of file gpencil_vertex_ops.c.
References GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, bGPDstroke::points, bGPDstroke::totpoints, bGPDspoint::vert_color, bGPDstroke::vert_color_fill, and zero_v4().
Referenced by gpencil_stroke_reset_vertex_color_exec().
|
static |
Definition at line 1059 of file gpencil_vertex_ops.c.
References bool, C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDcurve::flag, GP_CURVE_SELECT, GP_FRAME_SELECT, GP_STROKE_SELECT, GPENCIL_CURVE_EDIT_SESSIONS_ON, GPENCIL_MULTIEDIT_SESSIONS_ON, gpencil_reset_vertex(), bGPdata::id, Object::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), and WM_event_add_notifier().
Referenced by GPENCIL_OT_stroke_reset_vertex_color().
|
static |
Definition at line 117 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDspoint::flag, GP_FRAME_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, max_ff(), NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, offset, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), bGPDspoint::vert_color, and WM_event_add_notifier().
Referenced by GPENCIL_OT_vertex_color_brightness_contrast().
|
static |
Definition at line 234 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDspoint::flag, GP_FRAME_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, hsv_to_rgb_v(), hue, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, OPERATOR_FINISHED, wmOperator::ptr, rgb_to_hsv_v(), RNA_enum_get(), RNA_float_get(), bGPDspoint::vert_color, and WM_event_add_notifier().
Referenced by GPENCIL_OT_vertex_color_hsv().
|
static |
Definition at line 353 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDspoint::flag, GP_FRAME_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), bGPDspoint::vert_color, and WM_event_add_notifier().
Referenced by GPENCIL_OT_vertex_color_invert().
|
static |
Definition at line 443 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDspoint::flag, GP_FRAME_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, GPENCIL_MULTIEDIT_SESSIONS_ON, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, offset, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), bGPDspoint::vert_color, and WM_event_add_notifier().
Referenced by GPENCIL_OT_vertex_color_levels().
Definition at line 99 of file gpencil_vertex_ops.c.
References C, CTX_data_active_object(), Object::data, ListBase::first, GPENCIL_VERTEX_MODE, if(), bGPdata::layers, NULL, OB_GPENCIL, and Object::type.
Referenced by GPENCIL_OT_stroke_reset_vertex_color(), GPENCIL_OT_vertex_color_brightness_contrast(), GPENCIL_OT_vertex_color_hsv(), GPENCIL_OT_vertex_color_invert(), GPENCIL_OT_vertex_color_levels(), and GPENCIL_OT_vertex_color_set().
|
static |
Definition at line 540 of file gpencil_vertex_ops.c.
References C, color, copy_v3_v3(), copy_v4_v4(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_tool_settings(), Object::data, DEG_id_tag_update(), ED_gpencil_stroke_can_use(), bGPDspoint::flag, GP_FRAME_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, ToolSettings::gp_vertexpaint, GPENCIL_MULTIEDIT_SESSIONS_ON, GPPAINT_MODE_FILL, GPPAINT_MODE_STROKE, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, is_any_stroke_selected(), LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, ND_DATA, bGPDframe::next, NULL, OPERATOR_FINISHED, GpVertexPaint::paint, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), srgb_to_linearrgb_v4(), bGPDspoint::vert_color, and WM_event_add_notifier().
Referenced by GPENCIL_OT_vertex_color_set().
|
static |
Definition at line 46 of file gpencil_vertex_ops.c.
References C, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_tool_settings(), ED_gpencil_stroke_can_use(), bGPDcurve::flag, GP_CURVE_SELECT, GP_FRAME_SELECT, GP_STROKE_SELECT, GPENCIL_ANY_VERTEX_MASK, ToolSettings::gpencil_selectmode_vertex, LISTBASE_FOREACH, bGPDframe::next, and NULL.
Referenced by gpencil_stroke_reset_vertex_color_exec(), gpencil_vertexpaint_brightness_contrast_exec(), gpencil_vertexpaint_hsv_exec(), gpencil_vertexpaint_invert_exec(), gpencil_vertexpaint_levels_exec(), and gpencil_vertexpaint_set_exec().
|
static |
Definition at line 38 of file gpencil_vertex_ops.c.
Referenced by GPENCIL_OT_vertex_color_brightness_contrast(), GPENCIL_OT_vertex_color_hsv(), GPENCIL_OT_vertex_color_invert(), GPENCIL_OT_vertex_color_levels(), and GPENCIL_OT_vertex_color_set().