10#include <fmt/format.h>
199 if (
math::mod(point, num_shared_points) == 0) {
223 colors.
fill(color_gizmo_primary);
224 sizes.
fill(size_primary);
229 colors.
fill(color_gizmo_primary);
230 sizes.
fill(size_primary);
237 colors.
fill(color_gizmo_secondary);
238 sizes.
fill(size_secondary);
244 colors[i] = color_gizmo_b;
245 sizes[i] = size_tertiary;
249 colors.
last() = color_gizmo_primary;
250 sizes.
last() = size_tertiary;
253 colors.
last(1) = color_gizmo_secondary;
254 sizes.
last(1) = size_primary;
259 if (active_index != -1) {
260 sizes[active_index] *= 1.5;
261 colors[active_index] =
math::interpolate(colors[active_index], color_gizmo_a, 0.5f);
270 format3d,
"color", gpu::VertAttrType::SFLOAT_32_32_32_32);
285 const float size = sizes[point];
322 const int new_points_num = new_positions.
size();
325 new_positions.
fill(control_points.
last());
333 const float t =
math::mod(i /
float(subdivision + 1), 1.0f);
334 const int point = int(i / (subdivision + 1));
335 const int point_next = point + 1;
336 new_positions[i] =
math::interpolate(control_points[point], control_points[point_next], t);
338 new_positions.
last() = control_points.
last();
343 const int num_segments = ptd.
segments;
344 for (
const int segment_i :
IndexRange(num_segments)) {
345 const float2 A = control_points[num_shared_points * segment_i + 0];
346 const float2 B = control_points[num_shared_points * segment_i + 1];
347 const float2 C = control_points[num_shared_points * segment_i + 2];
348 for (
const int i :
IndexRange(subdivision + 1)) {
349 const float t = i /
float(subdivision + 1);
355 new_positions.
last() = control_points.
last();
360 const int num_segments = ptd.
segments;
362 for (
const int segment_i :
IndexRange(num_segments)) {
363 const float2 A = control_points[num_shared_points * segment_i + 0];
364 const float2 B = control_points[num_shared_points * segment_i + 1];
365 const float2 C = control_points[num_shared_points * segment_i + 2];
366 const float2 D = control_points[num_shared_points * segment_i + 3];
367 for (
const int i :
IndexRange(subdivision + 1)) {
368 const float t = i /
float(subdivision + 1);
374 new_positions[i + segment_i * (subdivision + 1)] =
math::interpolate(ABBC, BCCD, t);
377 new_positions.
last() = control_points.
last();
384 const float t = i /
float(new_points_num);
385 const float a = t * std::numbers::pi * 2.0f;
412 const float t =
math::mod(i /
float(subdivision + 1), 1.0f);
413 const int point = int(i / (subdivision + 1));
414 const int point_next =
math::mod(point + 1, 4);
449 const int join_points = ptd.
segments + 1;
450 return join_points + subdivision * ptd.
segments;
454 return 4 + subdivision * 4;
465 const bool on_back = ptd.
on_back;
470 const int target_curve_index = on_back ? 0 :
curves.curves_range().last();
473 const IndexRange curve_points =
curves.points_by_curve()[target_curve_index];
490 rotations =
curves.attributes_for_write().lookup_or_add_for_write_span<
float>(
492 new_rotations = rotations.
span.slice(curve_points);
502 for (
const int point : curve_points.
index_range()) {
503 float pressure = 1.0f;
506 const float t = point /
float(new_points_num - 1);
522 lengths[point] = 0.0f;
525 const float distance_2d =
math::distance(positions_2d[point - 1], positions_2d[point]);
526 lengths[point] = lengths[point - 1] + distance_2d;
534 std::optional<BrushColorJitterSettings> jitter_settings =
552 point_attributes_to_skip.
add_multiple({
"position",
"radius",
"opacity"});
554 point_attributes_to_skip.
add(
"vertex_color");
557 point_attributes_to_skip.
add(
"rotation");
581 const bool on_back = ptd.
on_back;
585 const int target_curve_index = on_back ? 0 : (
curves.curves_num() - 1);
594 curve_attributes_to_skip.
add(
"material_index");
599 cyclic.
span[target_curve_index] = is_cyclic;
601 curve_attributes_to_skip.
add(
"cyclic");
606 hide_stroke.
span[target_curve_index] =
true;
607 curve_attributes_to_skip.
add(
"hide_stroke");
615 fill_id.
span[target_curve_index] = 0;
617 curve_attributes_to_skip.
add(
"fill_id");
624 softness.span[target_curve_index] = ptd.
softness;
626 curve_attributes_to_skip.
add(
"softness");
636 curve_attributes_to_skip.
add(
"start_cap");
646 curve_attributes_to_skip.
add(
"end_cap");
654 fill_opacities.span[target_curve_index] = ptd.
fill_opacity;
655 fill_opacities.finish();
656 curve_attributes_to_skip.
add(
"fill_opacity");
662 curve_attributes_to_skip.
add(
"fill_color");
668 u_scale.span[target_curve_index] = 1.0f;
670 curve_attributes_to_skip.
add(
"u_scale");
674 curves.update_curve_types();
675 curve_attributes_to_skip.
add(
"curve_type");
681 on_back ?
curves.curves_range().take_front(1) :
682 curves.curves_range().take_back(1));
689 const int target_curve_index = ptd.
on_back ? 0 : (
curves.curves_num() - 1);
703 status.
item(
IFACE_(
"Align"), ICON_EVENT_SHIFT);
709 status.
item(
IFACE_(
"Center"), ICON_EVENT_ALT);
830 if (use_vertex_color) {
836 std::make_optional(color_base) :
892 if (do_automerge_endpoints && !cancelled) {
897 constexpr float merge_distance = 30.0f;
906 *
CTX_wm_region(
C), src_curves, layer_to_world, merge_distance, selection, {});
922 MEM_delete<PrimitiveToolOperation>(ptd);
929 using namespace math;
936 using namespace math;
943 using namespace math;
945 const float sin225 = 0.3826834323650897717284599840304f;
952 using namespace math;
956 const float2 dif = end - start;
972 float2 center = start + offset;
983 for (
const int i :
IndexRange(number_control_points + 1)) {
985 end_pos, start_pos, (i /
float(number_control_points)));
994 const float2 dif = end - start;
1030 (other_point_2d +
float2(event->
mval)) / 2.0f);
1038 const float2 dif = end - start;
1058 return center_of_mass;
1069 const float2 end_ = end - center_of_mass;
1070 const float2 start_ = start - center_of_mass;
1076 const float2 dif = start_pos2 - center_of_mass;
1080 const float2 pos2 =
rot * dif + center_of_mass;
1099 const float2 pos2 = (start_pos2 - center_of_mass) *
scale + center_of_mass;
1108 const int value =
RNA_int_get(&brush_ptr,
"size");
1145 const int new_value = std::max(
int(delta.x), 1);
1159 mouse_co.x - display_size);
1161 const float new_value = delta.x / display_size;
1169 float closest_distance_squared = std::numeric_limits<float>::max();
1170 int closest_point = -1;
1189 closest_point = point;
1194 if (closest_point != -1) {
1195 return closest_point;
1232 switch (event->
val) {
1511 switch (event->
type) {
1568 const int default_subdiv,
1578 {0,
nullptr, 0,
nullptr,
nullptr},
1589 "Number of subdivisions per segment",
1595 ot->
srna,
"type", grease_pencil_primitive_type,
int(default_type),
"Type",
"Type of shape");
1601 ot->
name =
"Grease Pencil Line Shape";
1602 ot->
idname =
"GREASE_PENCIL_OT_primitive_line";
1603 ot->
description =
"Create predefined Grease Pencil stroke lines";
1620 ot->
name =
"Grease Pencil Polyline Shape";
1621 ot->
idname =
"GREASE_PENCIL_OT_primitive_polyline";
1622 ot->
description =
"Create predefined Grease Pencil stroke polylines";
1639 ot->
name =
"Grease Pencil Arc Shape";
1640 ot->
idname =
"GREASE_PENCIL_OT_primitive_arc";
1641 ot->
description =
"Create predefined Grease Pencil stroke arcs";
1658 ot->
name =
"Grease Pencil Curve Shape";
1659 ot->
idname =
"GREASE_PENCIL_OT_primitive_curve";
1660 ot->
description =
"Create predefined Grease Pencil stroke curve shapes";
1677 ot->
name =
"Grease Pencil Box Shape";
1678 ot->
idname =
"GREASE_PENCIL_OT_primitive_box";
1679 ot->
description =
"Create predefined Grease Pencil stroke boxes";
1696 ot->
name =
"Grease Pencil Circle Shape";
1697 ot->
idname =
"GREASE_PENCIL_OT_primitive_circle";
1698 ot->
description =
"Create predefined Grease Pencil stroke circles";
1737 "INCREASE_SUBDIVISION",
1739 "Increase Subdivision",
1742 "DECREASE_SUBDIVISION",
1744 "Decrease Subdivision",
1748 {0,
nullptr, 0,
nullptr,
nullptr},
Low-level operations for curves.
Low-level operations for grease pencil.
General operations, lookup, etc. for materials.
#define REGION_DRAW_POST_VIEW
#define BLI_assert_unreachable()
constexpr int64_t first() const
constexpr IndexRange drop_back(int64_t n) const
constexpr int64_t last(const int64_t n=0) const
constexpr IndexRange()=default
static constexpr IndexRange from_single(const int64_t index)
constexpr IndexRange index_range() const
constexpr int64_t size() const
constexpr void fill(const T &value) const
constexpr IndexRange index_range() const
constexpr T & last(const int64_t n=0) const
static RandomNumberGenerator from_random_seed()
void add_multiple(Span< Key > keys)
constexpr const T & last(const int64_t n=0) const
void item(std::string text, int icon1, int icon2=0)
void opmodal(std::string text, const wmOperatorType *ot, int propvalue, bool inverted=false)
bool contains(StringRef name) const
IndexRange curves_range() const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
MutableSpan< float > opacities_for_write()
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void tag_topology_changed()
MutableSpan< ColorGeometry4f > fill_colors_for_write()
MutableSpan< ColorGeometry4f > vertex_colors_for_write()
void set_texture_matrices(Span< float4x2 > matrices, const IndexMask &selection)
float4x4 to_world_space(const Object &object) const
bool use_project_to_surface() const
void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d)
bool use_project_to_stroke() const
float4x4 to_world_space() const
DrawingPlacement()=default
float3 project(float2 co, bool &clipped) const
VecBase< float, D > normalize(VecOp< float, D >) RET
float length(VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
Quaternion interpolate(Quaternion a, Quaternion b, float t)
float distance_squared(VecT a, VecT b)
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
int get_next_available_fill_id(Span< int > fill_ids)
auto attribute_filter_from_skip_ref(const Span< StringRef > skip)
void fill_attribute_range_default(MutableAttributeAccessor dst_attributes, AttrDomain domain, const AttributeFilter &attribute_filter, IndexRange range)
static void grease_pencil_primitive_init_opacity(PrimitiveToolOperation &ptd)
static constexpr int control_point_center
static void grease_pencil_primitive_change_opacity(PrimitiveToolOperation &ptd, const wmEvent *event)
bool grease_pencil_draw_operator_begin(bContext *C, wmOperator *op, const bool use_duplicate_previous_key)
float opacity_from_input_sample(const float pressure, const Paint &paint, const Brush *brush, const BrushGpencilSettings *settings)
static int control_points_per_segment(const PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_cancel_opacity(PrimitiveToolOperation &ptd)
static void primitive_calculate_curve_positions_2d(PrimitiveToolOperation &ptd, MutableSpan< float2 > new_positions)
float randomize_rotation(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float pressure)
static constexpr float ui_tertiary_point_draw_size_px
void resize_single_curve(bke::CurvesGeometry &curves, const bool at_end, const int new_points_num)
static void grease_pencil_primitive_cancel(bContext *C, wmOperator *op)
static void grease_pencil_primitive_grab_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static void grease_pencil_primitive_operator_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static void grease_pencil_primitive_cancel_radius(PrimitiveToolOperation &ptd)
float randomize_opacity(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float opacity, const float pressure)
static void GREASE_PENCIL_OT_primitive_circle(wmOperatorType *ot)
static float2 snap_diagonals_box(float2 p)
static constexpr int control_point_first
static float2 snap_8_angles(float2 p)
ColorGeometry4f randomize_color(const BrushGpencilSettings &settings, const std::optional< BrushColorJitterSettings > &jitter, const float stroke_hue_factor, const float stroke_saturation_factor, const float stroke_value_factor, const float distance, const ColorGeometry4f color, const float pressure)
static wmOperatorStatus grease_pencil_primitive_event_modal_map(bContext *C, wmOperator *op, PrimitiveToolOperation &ptd, const wmEvent *event)
static void grease_pencil_primitive_change_radius(PrimitiveToolOperation &ptd, const wmEvent *event)
float randomize_radius(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float radius, const float pressure)
static void grease_pencil_primitive_drag_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static void grease_pencil_primitive_init_radius(PrimitiveToolOperation &ptd)
static void control_point_colors_and_sizes(const PrimitiveToolOperation &ptd, MutableSpan< ColorGeometry4f > colors, MutableSpan< float > sizes)
static void grease_pencil_primitive_extruding_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static int grease_pencil_primitive_curve_points_number(PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_update_view(bContext *C, PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_draw(const bContext *, ARegion *, void *arg)
static void draw_control_points(PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_update_curves(PrimitiveToolOperation &ptd)
static float2 primitive_center_of_mass(const PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_drag_all_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static constexpr float ui_secondary_point_draw_size_px
bke::CurvesGeometry curves_merge_endpoints_by_distance(const ARegion ®ion, const bke::CurvesGeometry &src_curves, const float4x4 &layer_to_world, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
static constexpr float ui_point_hit_size_px
static constexpr int control_point_last
static constexpr float ui_point_max_hit_size_px
static void primitive_calculate_curve_positions(PrimitiveToolOperation &ptd, Span< float2 > control_points, MutableSpan< float2 > new_positions)
static void grease_pencil_primitive_init_curves(PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_undo_curves(PrimitiveToolOperation &ptd)
static wmOperatorStatus grease_pencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void GREASE_PENCIL_OT_primitive_line(wmOperatorType *ot)
static void grease_pencil_primitive_scale_all_update(PrimitiveToolOperation &ptd, const wmEvent *event)
static ControlPointType get_control_point_type(const PrimitiveToolOperation &ptd, const int point)
static constexpr float ui_primary_point_draw_size_px
static void grease_pencil_primitive_common_props(wmOperatorType *ot, const int default_subdiv, const PrimitiveType default_type)
static void grease_pencil_primitive_rotate_all_update(PrimitiveToolOperation &ptd, const wmEvent *event)
float4x2 calculate_texture_space(const Scene *scene, const ARegion *region, const float2 &mouse, const DrawingPlacement &placement)
static void grease_pencil_primitive_exit(bContext *C, wmOperator *op, const bool cancelled)
void add_single_curve(bke::greasepencil::Drawing &drawing, const bool at_end)
static void grease_pencil_primitive_cursor_update(bContext *C, PrimitiveToolOperation &ptd, const wmEvent *event)
static void grease_pencil_primitive_load(PrimitiveToolOperation &ptd)
static void grease_pencil_primitive_status_indicators(bContext *C, wmOperator *op, PrimitiveToolOperation &ptd)
static void GREASE_PENCIL_OT_primitive_polyline(wmOperatorType *ot)
static void GREASE_PENCIL_OT_primitive_curve(wmOperatorType *ot)
static float2 primitive_local_to_screen(const PrimitiveToolOperation &ptd, const float3 &point)
static void grease_pencil_primitive_save(PrimitiveToolOperation &ptd)
static float2 snap_diagonals(float2 p)
static void GREASE_PENCIL_OT_primitive_box(wmOperatorType *ot)
static wmOperatorStatus grease_pencil_primitive_invoke(bContext *C, wmOperator *op, const wmEvent *event)
float radius_from_input_sample(const RegionView3D *rv3d, const ARegion *region, const Paint &paint, const Brush *brush, const float pressure, const float3 &location, const float4x4 &to_world, const BrushGpencilSettings *settings)
static wmOperatorStatus grease_pencil_primitive_mouse_event(PrimitiveToolOperation &ptd, const wmEvent *event)
static void GREASE_PENCIL_OT_primitive_arc(wmOperatorType *ot)
static int primitive_check_ui_hover(const PrimitiveToolOperation &ptd, const wmEvent *event)
T cos(const AngleRadianBase< T > &a)
T distance(const T &a, const T &b)
T length(const VecBase< T, Size > &a)
T interpolate(const T &a, const T &b, const FactorT &t)
T atan2(const T &y, const T &x)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
T sin(const AngleRadianBase< T > &a)
T mod(const T &a, const T &b)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void get_color_4fv(int colorid, float col[4])
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
ViewOpsData * ED_view3d_navigation_init(bContext *C, const wmKeyMapItem *kmi_merge)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void immAttr4f(uint attr_id, float x, float y, float z, float w)
wmKeyMap * WM_modalkeymap_find(wmKeyConfig *keyconf, const char *idname)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
MINLINE void copy_v3_v3(float r[3], const float a[3])
PointerRNA RNA_id_pointer_create(ID *id)
float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
GPUVertFormat * immVertexFormat()
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
MatBase< float, 2, 2 > float2x2
void WM_cursor_modal_set(wmWindow *win, int val)
@ OP_IS_MODAL_CURSOR_REGION
void immBegin(GPUPrimType, uint vertex_len)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
float2 ED_view3d_project_float_v2_m4(const ARegion *region, const float co[3], const float4x4 &mat)
void BKE_brush_init_gpencil_settings(Brush *brush)
int RNA_int_get(PointerRNA *ptr, const char *name)
wmWindow * CTX_wm_window(const bContext *C)
MatBase< float, 4, 4 > float4x4
void ED_region_tag_redraw(ARegion *region)
bool ED_view3d_navigation_do(bContext *C, ViewOpsData *vod, const wmEvent *event, const float depth_loc_override[3])
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void BKE_curvemapping_init(CurveMapping *cumap)
@ GP_TOOL_FLAG_PAINT_ONBACK
@ GP_TOOL_FLAG_AUTOMERGE_STROKE
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
void ED_primitivetool_modal_keymap(wmKeyConfig *keyconf)
VecBase< float, 2 > float2
bool ED_region_draw_cb_exit(ARegionType *art, void *handle)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR
MatBase< float, 4, 2 > float4x2
void WM_cursor_modal_restore(wmWindow *win)
void GPU_program_point_size(bool enable)
int BKE_object_material_index_get(Object *ob, const Material *ma)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void immAttr1f(uint attr_id, float x)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void immVertex3fv(uint attr_id, const float data[3])
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
Main * CTX_data_main(const bContext *C)
void ED_operatortypes_grease_pencil_primitives()
std::optional< BrushColorJitterSettings > BKE_brush_color_jitter_get_settings(const Paint *paint, const Brush *brush)
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
Brush * BKE_paint_brush(Paint *paint)
Material * BKE_grease_pencil_object_material_ensure_from_brush(Main *bmain, Object *ob, Brush *brush)
@ GPPAINT_FLAG_USE_VERTEXCOLOR
Scene * CTX_data_scene(const bContext *C)
float3 BKE_brush_color_get(const Paint *paint, const Brush *brush)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
void ED_view3d_navigation_free(bContext *C, ViewOpsData *vod)
VecBase< float, 3 > float3
@ GP_STROKE_CAP_TYPE_ROUND
ARegion * CTX_wm_region(const bContext *C)
void ED_workspace_status_text(bContext *C, const char *str)
float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
float RNA_float_get(PointerRNA *ptr, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
float BKE_brush_alpha_get(const Paint *paint, const Brush *brush)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ARegionRuntime * runtime
struct CurveMapping * curve_sensitivity
struct CurveMapping * curve_jitter
struct CurveMapping * curve_rand_strength
struct CurveMapping * curve_rand_uv
struct CurveMapping * curve_rand_pressure
struct CurveMapping * curve_strength
struct CurveMapping * curve_rand_value
struct CurveMapping * curve_rand_saturation
struct BrushGpencilSettings * gpencil_settings
struct CurveMapping * curve_rand_hue
eGP_Sculpt_SettingsFlag flag
struct CurveMapping * cur_primitive
struct ToolSettings * toolsettings
struct ARegionType * type
MutableVArraySpan< T > span
wmEventModifierFlag modifier
void(*) cancel(bContext *C, wmOperator *op)
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type