Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_gpencil_types.h"
#include "BKE_action.h"
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_gpencil.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_object_deform.h"
#include "BKE_report.h"
#include "DNA_meshdata_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "UI_view2d.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"
Go to the source code of this file.
Classes | |
struct | tGP_Grid |
struct | tGP_Selected |
struct | tGP_BrushWeightpaintData |
Macros | |
#define | GP_SELECT_BUFFER_CHUNK 256 |
Typedefs | |
typedef struct tGP_Grid | tGP_Grid |
typedef struct tGP_Selected | tGP_Selected |
typedef struct tGP_BrushWeightpaintData | tGP_BrushWeightpaintData |
Brush based operators for editing Grease Pencil strokes.
Definition in file gpencil_weight_paint.c.
#define GP_SELECT_BUFFER_CHUNK 256 |
Definition at line 52 of file gpencil_weight_paint.c.
typedef struct tGP_BrushWeightpaintData tGP_BrushWeightpaintData |
typedef struct tGP_Selected tGP_Selected |
|
static |
Definition at line 205 of file gpencil_weight_paint.c.
References tGP_BrushWeightpaintData::dvec, float(), tGP_BrushWeightpaintData::mval, tGP_BrushWeightpaintData::mval_prev, and normalize_v2().
Referenced by gpencil_weightpaint_brush_apply().
|
static |
Definition at line 219 of file gpencil_weight_paint.c.
References BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_modifiers_is_deformed_by_armature(), BKE_object_defgroup_add(), BKE_object_defgroup_add_name(), BKE_object_defgroup_find_name(), BKE_pose_channel_find_name(), BLI_findlink(), tGP_BrushWeightpaintData::bmain, tGP_BrushWeightpaintData::brush, brush_influence_calc(), CLAMP, Object::data, DEG_relations_tag_update(), DG_LOCK_WEIGHT, bGPDstroke::dvert, bDeformGroup::flag, tGP_BrushWeightpaintData::gpd, interpf(), bPoseChannel::name, Bone::name, NULL, tGP_BrushWeightpaintData::object, Object::pose, bGPdata::vertex_group_names, tGP_BrushWeightpaintData::vrgroup, Brush::weight, and MDeformWeight::weight.
Referenced by gpencil_weightpaint_brush_do_frame().
|
static |
Definition at line 175 of file gpencil_weight_paint.c.
References Brush::alpha, BKE_brush_curve_strength(), tGP_BrushWeightpaintData::brush, blender::math::distance(), e, BrushGpencilSettings::flag, float(), GP_BRUSH_USE_PRESSURE, Brush::gpencil_settings, len_v2v2_int(), max_ff(), tGP_BrushWeightpaintData::mf_falloff, tGP_BrushWeightpaintData::mval, tGP_BrushWeightpaintData::pressure, and round_v2i_v2fl().
Referenced by brush_draw_apply().
void GPENCIL_OT_weight_paint | ( | wmOperatorType * | ot | ) |
Definition at line 886 of file gpencil_weight_paint.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, gpencil_weightpaint_brush_exec(), gpencil_weightpaint_brush_exit(), gpencil_weightpaint_brush_invoke(), gpencil_weightpaint_brush_modal(), gpencil_weightpaint_brush_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_collection_runtime(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
|
static |
Definition at line 365 of file gpencil_weight_paint.c.
References tGP_Selected::color, copy_v2_v2_int(), copy_v4_v4(), gpencil_select_buffer_ensure(), tGP_Selected::gps, tGP_BrushWeightpaintData::pbuffer, tGP_BrushWeightpaintData::pbuffer_size, tGP_BrushWeightpaintData::pbuffer_used, tGP_Selected::pc, bGPDstroke::points, tGP_Selected::pt_index, and bGPDspoint::vert_color.
Referenced by gpencil_weightpaint_select_stroke().
|
static |
Definition at line 134 of file gpencil_weight_paint.c.
References clear(), GP_SELECT_BUFFER_CHUNK, MEM_callocN, MEM_recallocN, and NULL.
Referenced by gpencil_save_selected_point(), and gpencil_weightpaint_brush_do_frame().
|
static |
Definition at line 636 of file gpencil_weight_paint.c.
References tGP_BrushWeightpaintData::brush, brush_calc_dvec_2d(), tGP_BrushWeightpaintData::brush_rect, C, wmOperator::customdata, DEG_id_tag_update(), tGP_BrushWeightpaintData::first, Brush::flag, GP_BRUSH_USE_PRESSURE, tGP_BrushWeightpaintData::gpd, gpencil_weightpaint_brush_apply_to_layers(), bGPdata::id, ID_RECALC_GEOMETRY, tGP_BrushWeightpaintData::mval, tGP_BrushWeightpaintData::mval_prev, NA_EDITED, NC_GPENCIL, ND_DATA, NULL, tGP_BrushWeightpaintData::pressure, tGP_BrushWeightpaintData::pressure_prev, RNA_float_get(), RNA_float_get_array(), Brush::size, WM_event_add_notifier(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by gpencil_weightpaint_brush_apply_event(), and gpencil_weightpaint_brush_exec().
|
static |
Definition at line 687 of file gpencil_weight_paint.c.
References C, CLAMP, wmOperator::customdata, tGP_BrushWeightpaintData::first, gpencil_weightpaint_brush_apply(), KM_CTRL, wmEvent::modifier, wmOperator::ptr, RNA_boolean_set(), RNA_collection_add(), RNA_float_set(), and RNA_float_set_array().
Referenced by gpencil_weightpaint_brush_invoke(), and gpencil_weightpaint_brush_modal().
|
static |
Definition at line 569 of file gpencil_weight_paint.c.
References BKE_gpencil_frame_range_selected(), BKE_gpencil_layer_is_editable(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_multiframe_falloff_calc(), C, copy_m4_m4(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_tool_settings(), GP_Sculpt_Settings::cur_falloff, Object::data, DEG_get_evaluated_id(), depsgraph, GP_FRAME_SELECT, ToolSettings::gp_sculpt, gpencil_weightpaint_brush_do_frame(), Object::id, tGP_BrushWeightpaintData::is_multiframe, bGPdata::layers, LISTBASE_FOREACH, tGP_BrushWeightpaintData::mf_falloff, mul_m4_m4m4(), NULL, tGP_BrushWeightpaintData::object, and tGP_BrushWeightpaintData::use_multiframe_falloff.
Referenced by gpencil_weightpaint_brush_apply().
|
static |
Definition at line 508 of file gpencil_weight_paint.c.
References tGP_BrushWeightpaintData::brush, brush_draw_apply(), C, CTX_data_active_object(), ED_gpencil_stroke_can_use(), ED_gpencil_stroke_material_editable(), Brush::flag, GP_BRUSH_USE_PRESSURE, gpencil_select_buffer_ensure(), Brush::gpencil_weight_tool, gpencil_weightpaint_select_stroke(), GPWEIGHT_TOOL_DRAW, LISTBASE_FOREACH, NULL, tGP_BrushWeightpaintData::pbuffer, tGP_BrushWeightpaintData::pbuffer_size, tGP_BrushWeightpaintData::pbuffer_used, tGP_BrushWeightpaintData::pressure, Brush::size, and bGPDframe::strokes.
Referenced by gpencil_weightpaint_brush_apply_to_layers().
|
static |
Definition at line 715 of file gpencil_weight_paint.c.
References C, gpencil_weightpaint_brush_apply(), gpencil_weightpaint_brush_exit(), gpencil_weightpaint_brush_init(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_BEGIN, and RNA_END.
Referenced by GPENCIL_OT_weight_paint().
|
static |
Definition at line 344 of file gpencil_weight_paint.c.
References C, wmOperator::customdata, ED_workspace_status_text(), MEM_SAFE_FREE, NULL, and tGP_BrushWeightpaintData::pbuffer.
Referenced by GPENCIL_OT_weight_paint(), gpencil_weightpaint_brush_exec(), and gpencil_weightpaint_brush_modal().
Definition at line 274 of file gpencil_weight_paint.c.
References C, ED_workspace_status_text(), and TIP_.
Referenced by gpencil_weightpaint_brush_init().
|
static |
Definition at line 284 of file gpencil_weight_paint.c.
References BKE_curvemapping_init(), BLI_findlink(), tGP_BrushWeightpaintData::bmain, bool, tGP_BrushWeightpaintData::brush, Paint::brush, C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region(), GP_Sculpt_Settings::cur_falloff, Brush::curve, wmOperator::customdata, ED_gpencil_data_get_active(), tGP_BrushWeightpaintData::first, GP_Sculpt_Settings::flag, ToolSettings::gp_sculpt, GP_SCULPT_SETT_FLAG_FRAME_FALLOFF, ToolSettings::gp_weightpaint, tGP_BrushWeightpaintData::gpd, GPENCIL_MULTIEDIT_SESSIONS_ON, gpencil_point_conversion_init(), gpencil_weightpaint_brush_header_set(), tGP_BrushWeightpaintData::gsc, tGP_BrushWeightpaintData::is_multiframe, tGP_BrushWeightpaintData::is_painting, MEM_callocN, NULL, tGP_BrushWeightpaintData::object, GpWeightPaint::paint, tGP_BrushWeightpaintData::pbuffer, tGP_BrushWeightpaintData::pbuffer_size, tGP_BrushWeightpaintData::pbuffer_used, tGP_BrushWeightpaintData::region, scene, tGP_BrushWeightpaintData::scene, tGP_BrushWeightpaintData::use_multiframe_falloff, bGPdata::vertex_group_active_index, bGPdata::vertex_group_names, and tGP_BrushWeightpaintData::vrgroup.
Referenced by gpencil_weightpaint_brush_exec(), and gpencil_weightpaint_brush_invoke().
|
static |
Definition at line 732 of file gpencil_weight_paint.c.
References BKE_report(), C, CTX_wm_manager(), CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw(), ED_screen_animation_playing(), gpencil_weightpaint_brush_apply_event(), gpencil_weightpaint_brush_init(), tGP_BrushWeightpaintData::is_painting, NULL, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RPT_ERROR, and WM_event_add_modal_handler().
Referenced by GPENCIL_OT_weight_paint().
|
static |
Definition at line 771 of file gpencil_weight_paint.c.
References BLI_assert, C, CTX_wm_region(), wmOperator::customdata, DEG_id_tag_update(), ED_region_tag_redraw(), EVT_DOWNARROWKEY, EVT_ESCKEY, EVT_LEFTARROWKEY, EVT_PAD0, EVT_PAD1, EVT_PAD2, EVT_PAD3, EVT_PAD4, EVT_PAD5, EVT_PAD6, EVT_PAD7, EVT_PAD8, EVT_PAD9, EVT_RIGHTARROWKEY, EVT_UPARROWKEY, tGP_BrushWeightpaintData::first, tGP_BrushWeightpaintData::gpd, gpencil_weightpaint_brush_apply_event(), gpencil_weightpaint_brush_exit(), bGPdata::id, ID_RECALC_GEOMETRY, INBETWEEN_MOUSEMOVE, tGP_BrushWeightpaintData::is_painting, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, NC_SCENE, ND_TOOLSETTINGS, NULL, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RIGHTMOUSE, RNA_boolean_get(), wmEvent::type, and WM_event_add_notifier().
Referenced by GPENCIL_OT_weight_paint().
Definition at line 358 of file gpencil_weight_paint.c.
References C, and CTX_DATA_COUNT.
Referenced by GPENCIL_OT_weight_paint().
|
static |
Definition at line 387 of file gpencil_weight_paint.c.
References BLI_rcti_isect_pt(), tGP_BrushWeightpaintData::brush, tGP_BrushWeightpaintData::brush_rect, ED_gpencil_stroke_check_collision(), ELEM, Brush::flag, GP_BRUSH_USE_PRESSURE, gpencil_point_to_parent_space(), gpencil_point_to_xy(), gpencil_save_selected_point(), gpencil_stroke_inside_circle(), bGPDstroke_Runtime::gps_orig, tGP_BrushWeightpaintData::gsc, bGPDspoint_Runtime::idx_orig, if(), len_v2v2_int(), tGP_BrushWeightpaintData::mval, NULL, bGPDstroke::points, tGP_BrushWeightpaintData::pressure, bGPDspoint_Runtime::pt_orig, round_v2i_v2fl(), bGPDspoint::runtime, bGPDstroke::runtime, Brush::size, bGPDstroke::totpoints, and V2D_IS_CLIPPED.
Referenced by gpencil_weightpaint_brush_do_frame().