139 verts.
begin(), verts.
end(), [&](
const int i) { return hide_vert[i]; });
143 pbvh.tag_visibility_changed(changed_nodes);
146 attributes.
remove(
".hide_vert");
148 pbvh.update_visibility(
object);
155 SubdivCCG &subdiv_ccg = *
object.runtime->sculpt_session->subdiv_ccg;
165 return std::any_of(grids.
begin(), grids.
end(), [&](
const int i) {
166 return bits::any_bit_set(grid_hidden[i]);
174 pbvh.tag_visibility_changed(changed_nodes);
179 pbvh.update_visibility(
object);
209 hide_face[i] = std::any_of(
210 face_verts.
begin(), face_verts.
end(), [&](
const int v) { return hide_vert[v]; });
238 TLS &tls = all_tls.
local();
241 tls.new_hide.resize(node_faces.
size());
244 calc_face_hide(node_faces, faces, corner_verts, hide_vert, tls.new_hide.as_mutable_span());
251 node_changed[i] =
true;
262 pbvh.tag_visibility_changed(node_mask);
301 bool any_changed =
false;
310 calc_hide(verts, new_hide);
339 SubdivCCG &subdiv_ccg = *
object.runtime->sculpt_session->subdiv_ccg;
344 bool any_changed =
false;
350 new_hide[i].copy_from(grid_hidden[grids[i]].as_span());
354 calc_hide(grids[i], new_hide[i]);
360 return bits::spans_equal(grid_hidden[grids[i]], new_hide[i]);
370 grid_hidden[grids[i]].copy_from(new_hide[i].as_span());
373 node_changed[i] =
true;
383 pbvh.tag_visibility_changed(node_mask);
395 if (should_update(
v)) {
402 (*any_changed) =
true;
406 (*any_visible) =
true;
433 bool any_changed =
false;
434 bool any_visible =
false;
458 pbvh.tag_visibility_changed(node_mask);
459 pbvh.update_visibility(ob);
518 depsgraph, ob, node_mask, action, [](
const BMVert * ) {
return true; });
544 switch (
pbvh.type()) {
582 else if (!
mask.is_empty()) {
586 if (
mask[verts[i]] > 0.5f) {
599 SubdivCCG &subdiv_ccg = *
object.runtime->sculpt_session->subdiv_ccg;
615 if (grid_masks[i] > 0.5f) {
630 const auto mask_test_fn = [&](
const BMVert *
v) {
661 switch (
pbvh.type()) {
687 {0,
nullptr, 0,
nullptr,
nullptr},
695 "Whether to hide or show vertices");
700 ot->
name =
"Hide/Show Masked";
701 ot->
idname =
"PAINT_OT_hide_show_masked";
702 ot->
description =
"Hide/show all masked vertices above a threshold";
715 ot->
name =
"Hide/Show All";
716 ot->
idname =
"PAINT_OT_hide_show_all";
744 for (
const int face :
nodes[i].faces()) {
745 hide_poly.
span[face] = !hide_poly.
span[face];
752 pbvh.tag_visibility_changed(node_mask);
753 pbvh.update_visibility(
object);
762 SubdivCCG &subdiv_ccg = *
object.runtime->sculpt_session->subdiv_ccg;
769 for (
const int i :
nodes[i].grids()) {
776 pbvh.tag_visibility_changed(node_mask);
791 bool fully_hidden =
true;
802 pbvh.tag_visibility_changed(node_mask);
816 switch (
pbvh.type()) {
838 ot->
name =
"Invert Visibility";
839 ot->
idname =
"PAINT_OT_visibility_invert";
840 ot->
description =
"Invert the visibility of all vertices";
859 for (
const int corner : face) {
860 int vert = corner_verts[corner];
861 if (read_buffer[vert] != value) {
866 const int prev_vert = corner_verts[prev];
867 write_buffer[prev_vert] = value;
870 const int next_vert = corner_verts[next];
871 write_buffer[next_vert] = value;
894 const int iterations)
903 for (const int face_index : range) {
904 if (!hide_poly[face_index]) {
907 const IndexRange face = faces[face_index];
908 if (action == VisAction::Hide) {
909 affect_visibility_mesh<true>(face, corner_verts, read_buffer, write_buffer);
912 affect_visibility_mesh<false>(face, corner_verts, read_buffer, write_buffer);
932 for (
const int vert :
nodes[i].verts()) {
933 if (old_hide_vert[vert] != new_hide_vert[vert]) {
953 bool any_changed =
false;
955 for (
const int face_index : indices) {
956 if (orig_hide_poly[face_index] != new_hide_poly[face_index]) {
963 node_changed[i] =
true;
971 if (
pbvh.draw_data) {
973 pbvh.draw_data->tag_visibility_changed(changed_nodes);
981 const int iterations)
985 if (!attributes.
contains(
".hide_vert")) {
997 buffers.front.reinitialize(hide_vert.
span.size());
1004 const Span<bool> last_buffer = buffers.write_buffer(iterations - 1);
1037 const int iterations)
1051 buffers.
front = grid_hidden;
1052 buffers.
back = grid_hidden;
1062 for (
const int grid :
nodes[i].grids()) {
1066 if (read_buffer[grid][grid_elem_idx] != desired_state) {
1082 write_buffer[neighbor.
grid_index][neighbor_grid_elem_idx].set(desired_state);
1088 node_changed[i] =
true;
1099 grid_hidden = std::move(last_buffer);
1101 pbvh.tag_visibility_changed(node_mask);
1102 pbvh.update_visibility(
object);
1114 for (
const int i :
result.index_range()) {
1124 const int iterations)
1165 switch (
pbvh.type()) {
1191 "Grow the visibility by one face based on mesh topology"},
1195 "Shrink Visibility",
1196 "Shrink the visibility by one face based on mesh topology"},
1197 {0,
nullptr, 0,
nullptr,
nullptr},
1200 ot->
name =
"Visibility Filter";
1201 ot->
idname =
"PAINT_OT_visibility_filter";
1202 ot->
description =
"Edit the visibility of the current mesh";
1217 "Number of times that the filter is going to be applied",
1222 "auto_iteration_count",
1224 "Auto Iteration Count",
1225 "Use an automatic number of iterations based on the number of vertices of the sculpt");
1245 const Depsgraph &depsgraph = *gesture_data.
vc.
depsgraph;
1259 if (clipping_enabled) {
1286 SubdivCCG &subdiv_ccg = *
object->runtime->sculpt_session->subdiv_ccg;
1291 if (clipping_enabled) {
1302 for (
const int i : grid_positions.
index_range()) {
1320 if (clipping_enabled) {
1324 const auto selection_test_fn = [&](
const BMVert *
v) {
1393 if (!gesture_data) {
1404 if (!gesture_data) {
1415 if (!gesture_data) {
1426 if (!gesture_data) {
1437 {int(gesture::SelectionType::Outside),
1441 "Hide or show vertices outside the selection"},
1442 {int(gesture::SelectionType::Inside),
1446 "Hide or show vertices inside the selection"},
1447 {0,
nullptr, 0,
nullptr,
nullptr},
1453 int(gesture::SelectionType::Inside),
1455 "Which vertices to hide or show");
1460 ot->
name =
"Hide/Show";
1461 ot->
idname =
"PAINT_OT_hide_show";
1480 ot->
name =
"Hide/Show Lasso";
1481 ot->
idname =
"PAINT_OT_hide_show_lasso_gesture";
1500 ot->
name =
"Hide/Show Line";
1501 ot->
idname =
"PAINT_OT_hide_show_line_gesture";
1520 ot->
name =
"Hide/Show Polyline";
1521 ot->
idname =
"PAINT_OT_hide_show_polyline_gesture";
A BVH for high poly meshes.
Object is a sort of wrapper for general info.
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
Read Blender memory allocation and freeing.
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_toggle(ele, hflag)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
Span< T > as_span() const
MutableSpan< T > as_mutable_span()
void reinitialize(const int64_t new_size)
static IndexMask from_predicate(const IndexMask &universe, LinearAllocator<> &memory, Fn &&predicate, exec_mode::Mode mode=exec_mode::parallel)
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &memory)
constexpr Iterator end() const
constexpr IndexRange()=default
constexpr Iterator begin() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr int64_t size() const
constexpr const T * end() const
constexpr IndexRange index_range() const
constexpr const T * begin() const
constexpr bool is_empty() const
void resize(const int64_t new_size)
MutableSpan< T > as_mutable_span()
Span< T > as_span() const
int64_t group_size() const
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
bool contains(StringRef name) const
GAttributeReader lookup(const StringRef name) const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef name)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
constexpr bool is_empty() const
int64_t min_array_size() const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
IndexRange index_range() const
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
bool indexed_data_equal(const Span< T > all_values, const Span< int > indices, const Span< T > values)
void invert(BitSpanT &&data)
IndexRange grid_range(const int grid_area, const int grid)
int face_corner_prev(const IndexRange face, const int corner)
int face_corner_next(const IndexRange face, const int corner)
pbvh::Tree & pbvh_ensure(Depsgraph &depsgraph, Object &object)
pbvh::Tree * pbvh_get(Object &object)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
void node_update_visibility_grids(const BitGroupVector<> &grid_hidden, GridsNode &node)
Span< float3 > vert_normals_eval(const Depsgraph &depsgraph, const Object &object_orig)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
void node_update_visibility_mesh(Span< bool > hide_vert, MeshNode &node)
void mesh_face_hide_from_vert(OffsetIndices< int > faces, Span< int > corner_verts, Span< bool > hide_vert, MutableSpan< bool > hide_poly)
void mesh_hide_vert_flush(Mesh &mesh)
void mesh_hide_face_flush(Mesh &mesh)
void mesh_edge_hide_from_vert(Span< int2 > edges, Span< bool > hide_vert, MutableSpan< bool > hide_edge)
std::unique_ptr< GestureData > init_from_box(bContext *C, wmOperator *op)
void operator_properties(wmOperatorType *ot, ShapeType shapeType)
std::unique_ptr< GestureData > init_from_polyline(bContext *C, wmOperator *op)
std::unique_ptr< GestureData > init_from_line(bContext *C, const wmOperator *op)
void apply(bContext &C, GestureData &gesture_data, wmOperator &op)
std::unique_ptr< GestureData > init_from_lasso(bContext *C, wmOperator *op)
bool is_affected(const GestureData &gesture_data, const float3 &position, const float3 &normal)
static void invert_visibility_bmesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static constexpr float VERTEX_ITERATION_THRESHOLD
static Array< bool > duplicate_visibility_bmesh(const Object &object)
static void flush_face_changes(Mesh &mesh, const Span< bool > hide_vert)
void PAINT_OT_hide_show_polyline_gesture(wmOperatorType *ot)
static void grow_shrink_visibility_bmesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const VisAction action, const int iterations)
static void partialvis_all_update_grids(Depsgraph &depsgraph, Object &object, const VisAction action, const IndexMask &node_mask)
static void partialvis_all_update_bmesh(const Depsgraph &depsgraph, Object &ob, const VisAction action, const IndexMask &node_mask)
void PAINT_OT_hide_show_masked(wmOperatorType *ot)
static void invert_visibility_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
void PAINT_OT_hide_show_line_gesture(wmOperatorType *ot)
static void grid_hide_update(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const FunctionRef< void(const int, MutableBoundedBitSpan)> calc_hide)
void tag_update_visibility(const bContext &C)
static wmOperatorStatus hide_show_gesture_line_exec(bContext *C, wmOperator *op)
static void hide_show_end(bContext &C, gesture::GestureData &gesture_data)
static void affect_visibility_mesh(const IndexRange face, const Span< int > corner_verts, const Span< bool > read_buffer, MutableSpan< bool > write_buffer)
static void propagate_vertex_visibility(Mesh &mesh, DualBuffer &buffers, const VArraySpan< bool > &hide_poly, const VisAction action, const int iterations)
static void partialvis_gesture_update_bmesh(gesture::GestureData &gesture_data)
static void partialvis_gesture_update_grids(Depsgraph &depsgraph, gesture::GestureData &gesture_data)
static wmOperatorStatus hide_show_all_exec(bContext *C, wmOperator *op)
static void vert_hide_update(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const FunctionRef< void(Span< int >, MutableSpan< bool >)> calc_hide)
void PAINT_OT_visibility_invert(wmOperatorType *ot)
static wmOperatorStatus visibility_invert_exec(bContext *C, wmOperator *op)
static void calc_face_hide(const Span< int > node_faces, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< bool > hide_vert, MutableSpan< bool > hide_face)
static void hide_show_apply_for_symmetry_pass(bContext &C, gesture::GestureData &gesture_data)
void PAINT_OT_hide_show_lasso_gesture(wmOperatorType *ot)
void PAINT_OT_visibility_filter(wmOperatorType *ot)
static wmOperatorStatus hide_show_gesture_lasso_exec(bContext *C, wmOperator *op)
void grids_show_all(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void partialvis_masked_update_grids(Depsgraph &depsgraph, Object &object, const VisAction action, const IndexMask &node_mask)
static void partialvis_masked_update_bmesh(const Depsgraph &depsgraph, Object &ob, const VisAction action, const IndexMask &node_mask)
static void grow_shrink_visibility_grid(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const VisAction action, const int iterations)
static void partialvis_update_bmesh_nodes(const Depsgraph &depsgraph, Object &ob, const IndexMask &node_mask, const VisAction action, const FunctionRef< bool(BMVert *v)> vert_test_fn)
static wmOperatorStatus hide_show_masked_exec(bContext *C, wmOperator *op)
static void hide_show_init_properties(bContext &, gesture::GestureData &gesture_data, wmOperator &op)
static void partialvis_update_bmesh_faces(const Set< BMFace *, 0 > &faces)
static void update_node_visibility_from_face_changes(bke::pbvh::Tree &pbvh, const IndexMask &node_mask, const Span< bool > orig_hide_poly, const Span< bool > new_hide_poly, const Span< bool > hide_vert)
void mesh_show_all(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
void PAINT_OT_hide_show_all(wmOperatorType *ot)
static void invert_visibility_grids(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void partialvis_all_update_mesh(const Depsgraph &depsgraph, Object &object, const VisAction action, const IndexMask &node_mask)
void sync_all_from_faces(Object &object)
static void flush_edge_changes(Mesh &mesh, const Span< bool > hide_vert)
static void grow_shrink_visibility_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const VisAction action, const int iterations)
static void hide_show_operator_gesture_properties(wmOperatorType *ot)
static wmOperatorStatus visibility_filter_exec(bContext *C, wmOperator *op)
static wmOperatorStatus hide_show_gesture_polyline_exec(bContext *C, wmOperator *op)
static void update_undo_state(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const Span< bool > old_hide_vert, const Span< bool > new_hide_vert)
void PAINT_OT_hide_show(wmOperatorType *ot)
static wmOperatorStatus hide_show_gesture_box_exec(bContext *C, wmOperator *op)
static void partialvis_gesture_update_mesh(gesture::GestureData &gesture_data)
static void flush_face_changes_node(Mesh &mesh, bke::pbvh::Tree &pbvh, const IndexMask &node_mask, const Span< bool > hide_vert)
static void partialvis_update_bmesh_verts(const Set< BMVert *, 0 > &verts, const VisAction action, const FunctionRef< bool(BMVert *v)> should_update, bool *any_changed, bool *any_visible)
static void partialvis_masked_update_mesh(const Depsgraph &depsgraph, Object &object, const VisAction action, const IndexMask &node_mask)
static void hide_show_begin(bContext &C, wmOperator &op, gesture::GestureData &)
static bool action_to_hide(const VisAction action)
static void hide_show_operator_properties(wmOperatorType *ot)
void invalidate(SculptSession &ss)
void push_end(Object &ob)
void push_nodes(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const Type type)
void push_begin_ex(const Scene &, Object &ob, const char *name)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, const Type type)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
void vert_random_access_ensure(Object &object)
Vector< BMVert *, 64 > BMeshNeighborVerts
int vertex_count_get(const Object &object)
void scatter_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
bool sculpt_mode_poll_view3d(bContext *C)
Span< BMVert * > vert_neighbors_get_bmesh(BMVert &vert, BMeshNeighborVerts &r_neighbors)
void gather_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
constexpr ParallelGrainSize grain_size(int grain_size)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
int RNA_enum_get(PointerRNA *ptr, const char *name)
wmOperatorStatus WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void multires_mark_as_modified(Depsgraph *depsgraph, Object *object, MultiresModifiedFlags flags)
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
const Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces(bke::pbvh::BMeshNode *node)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void BKE_pbvh_node_fully_hidden_set(bke::pbvh::Node &node, int fully_hidden)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void BKE_sculpt_sync_face_visibility_to_grids(const Mesh &mesh, SubdivCCG &subdiv_ccg)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void WM_operator_properties_border(wmOperatorType *ot)
int RNA_int_get(PointerRNA *ptr, const char *name)
ATTR_WARN_UNUSED_RESULT const BMVert * v
wmOperatorStatus WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void ED_region_tag_redraw(ARegion *region)
BitGroupVector & BKE_subdiv_ccg_grid_hidden_ensure(SubdivCCG &subdiv_ccg)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
void BKE_subdiv_ccg_grid_hidden_free(SubdivCCG &subdiv_ccg)
void BKE_subdiv_ccg_neighbor_coords_get(const SubdivCCG &subdiv_ccg, const SubdivCCGCoord &coord, bool include_duplicates, SubdivCCGNeighbors &r_neighbors)
void BKE_pbvh_sync_visibility_from_verts(Object &object)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
@ MULTIRES_HIDDEN_MODIFIED
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, StringRef name)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
const Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_other_verts(bke::pbvh::BMeshNode *node)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int CCG_grid_xy_to_index(const int grid_size, const int x, const int y)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
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)
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool BKE_paint_is_bmesh_face_hidden(const BMFace *f)
Scene * CTX_data_scene(const bContext *C)
wmOperatorStatus WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event)
@ OPTYPE_DEPENDS_ON_CURSOR
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void WM_operator_properties_gesture_polyline(wmOperatorType *ot)
Object * CTX_data_active_object(const bContext *C)
const Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts(bke::pbvh::BMeshNode *node)
ARegion * CTX_wm_region(const bContext *C)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
bke::ObjectRuntime * runtime
SubdivCCGNeighborCoords coords
Array< float3 > positions
SculptSession * sculpt_session
MutableVArraySpan< T > span
SelectionType selection_type
void(*) end(bContext &, GestureData &)
void(*) apply_for_symmetry_pass(bContext &, GestureData &)
void(*) begin(bContext &, wmOperator &, GestureData &)
BitGroupVector & read_buffer(int count)
BitGroupVector & write_buffer(int count)
Span< bool > read_buffer(int count)
MutableSpan< bool > write_buffer(int count)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
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