52enum eBrushUVSculptTool {
53 UV_SCULPT_BRUSH_TYPE_GRAB = 0,
54 UV_SCULPT_BRUSH_TYPE_RELAX = 1,
55 UV_SCULPT_BRUSH_TYPE_PINCH = 2,
59 UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN = 0,
60 UV_SCULPT_BRUSH_TYPE_RELAX_HC = 1,
61 UV_SCULPT_BRUSH_TYPE_RELAX_COTAN = 2,
67#define MARK_BOUNDARY 1
69struct UvAdjacencyElement {
87struct UVInitialStrokeElement {
98struct UVInitialStroke {
100 UVInitialStrokeElement *initialSelection;
103 int totalInitialSelected;
115 UvAdjacencyElement *uv;
127 UVInitialStroke *initial_stroke;
133 UvElementMap *elementMap;
145 bool constrain_to_bounds;
148 float uv_base_offset[2];
155 if (!sculptdata->constrain_to_bounds) {
158 float u = sculptdata->uv_base_offset[0];
159 float v = sculptdata->uv_base_offset[1];
160 uv[0] =
clamp_f(uv[0], u, u + 1.0f);
168 sculptdata->uvsculpt->curve_distance_falloff,
172 CLAMP(strength, 0.0f, 1.0f);
190 const int cd_loop_uv_offset,
191 const float mouse_coord[2],
193 const float radius_sq,
194 const float aspectRatio)
198 const float radius =
sqrtf(radius_sq);
204 for (i = 0; i < sculptdata->totalUvEdges; i++) {
205 UvEdge *tmpedge = sculptdata->uvedges + i;
206 tmp_uvdata[tmpedge->uv1].
ncounter++;
207 tmp_uvdata[tmpedge->uv2].
ncounter++;
209 add_v2_v2(tmp_uvdata[tmpedge->uv2].
sum_co, sculptdata->uv[tmpedge->uv1].uv);
210 add_v2_v2(tmp_uvdata[tmpedge->uv1].
sum_co, sculptdata->uv[tmpedge->uv2].uv);
213 for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
218 tmp_uvdata[i].
b[0] =
diff[0] - sculptdata->uv[i].uv[0];
219 tmp_uvdata[i].
b[1] =
diff[1] - sculptdata->uv[i].uv[1];
222 for (i = 0; i < sculptdata->totalUvEdges; i++) {
223 UvEdge *tmpedge = sculptdata->uvedges + i;
228 for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
229 if (sculptdata->uv[i].is_locked) {
234 diff[1] /= aspectRatio;
236 if (dist <= radius_sq) {
241 sculptdata->uv[i].uv[0] = (1.0f - strength) * sculptdata->uv[i].uv[0] +
243 (tmp_uvdata[i].
p[0] -
244 0.5f * (tmp_uvdata[i].
b[0] +
246 sculptdata->uv[i].uv[1] = (1.0f - strength) * sculptdata->uv[i].uv[1] +
248 (tmp_uvdata[i].
p[1] -
249 0.5f * (tmp_uvdata[i].
b[1] +
264 MEM_SAFE_DELETE(tmp_uvdata);
275 const int cd_loop_uv_offset,
276 const float mouse_coord[2],
278 const float radius_sq,
279 const float aspectRatio)
283 const float radius =
sqrtf(radius_sq);
289 for (i = 0; i < sculptdata->totalUvEdges; i++) {
290 UvEdge *tmpedge = sculptdata->uvedges + i;
291 bool code1 = sculptdata->uv[sculptdata->uvedges[i].uv1].is_boundary;
292 bool code2 = sculptdata->uv[sculptdata->uvedges[i].uv2].is_boundary;
293 if (code1 || (code1 == code2)) {
294 tmp_uvdata[tmpedge->uv2].
ncounter++;
295 add_v2_v2(tmp_uvdata[tmpedge->uv2].
sum_co, sculptdata->uv[tmpedge->uv1].uv);
297 if (code2 || (code1 == code2)) {
298 tmp_uvdata[tmpedge->uv1].
ncounter++;
299 add_v2_v2(tmp_uvdata[tmpedge->uv1].
sum_co, sculptdata->uv[tmpedge->uv2].uv);
305 for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
306 copy_v2_v2(tmp_uvdata[i].p, tmp_uvdata[i].sum_co);
307 mul_v2_fl(tmp_uvdata[i].p, 1.0f / tmp_uvdata[i].ncounter);
310 for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
311 if (sculptdata->uv[i].is_locked) {
316 diff[1] /= aspectRatio;
318 if (dist <= radius_sq) {
323 sculptdata->uv[i].uv[0] = (1.0f - strength) * sculptdata->uv[i].uv[0] +
324 strength * tmp_uvdata[i].
p[0];
325 sculptdata->uv[i].uv[1] = (1.0f - strength) * sculptdata->uv[i].uv[1] +
326 strength * tmp_uvdata[i].
p[1];
341 MEM_SAFE_DELETE(tmp_uvdata);
348 const float luv_next[2],
349 const float luv_prev[2],
357 if (code1 || (code1 == code2)) {
358 int index_next = ele_next -
storage;
359 delta_buf[index_next][0] -= delta[0] * weight;
360 delta_buf[index_next][1] -= delta[1] * weight;
361 delta_buf[index_next][2] +=
fabsf(weight);
363 if (code2 || (code1 == code2)) {
364 int index_prev = ele_prev -
storage;
365 delta_buf[index_prev][0] += delta[0] * weight;
366 delta_buf[index_prev][1] += delta[1] * weight;
367 delta_buf[index_prev][2] +=
fabsf(weight);
371static float tri_weight_v3(
int method,
const float *v1,
const float *
v2,
const float *v3)
374 case UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN:
375 case UV_SCULPT_BRUSH_TYPE_RELAX_HC:
377 case UV_SCULPT_BRUSH_TYPE_RELAX_COTAN:
386 const int cd_loop_uv_offset,
387 const float mouse_coord[2],
389 const float radius_sq,
390 const float aspect_ratio,
393 if (method == UV_SCULPT_BRUSH_TYPE_RELAX_HC) {
395 sculptdata, cd_loop_uv_offset, mouse_coord, alpha, radius_sq, aspect_ratio);
398 if (method == UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN) {
400 sculptdata, cd_loop_uv_offset, mouse_coord, alpha, radius_sq, aspect_ratio);
406 const int total_uvs = sculptdata->elementMap->total_uvs;
410 for (
int j = 0; j < total_uvs; j++) {
415 const float *v_curr_co = ele_curr->
l->
v->
co;
416 const float *v_prev_co = ele_prev->
l->
v->
co;
417 const float *v_next_co = ele_next->
l->
v->
co;
423 const UvElement *head_curr = head_table[ele_curr - sculptdata->elementMap->storage];
424 const UvElement *head_next = head_table[ele_next - sculptdata->elementMap->storage];
425 const UvElement *head_prev = head_table[ele_prev - sculptdata->elementMap->storage];
428 const float weight_curr =
tri_weight_v3(method, v_curr_co, v_prev_co, v_next_co);
432 const float weight_prev =
tri_weight_v3(method, v_prev_co, v_curr_co, v_next_co);
435 if (method == UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN) {
441 const float weight_next =
tri_weight_v3(method, v_next_co, v_curr_co, v_prev_co);
445 for (
int i = 0; i < sculptdata->totalUniqueUvs; i++) {
446 UvAdjacencyElement *adj_el = &sculptdata->uv[i];
447 if (adj_el->is_locked) {
454 diff[1] /= aspect_ratio;
456 if (dist_sq > radius_sq) {
461 const float *delta_sum = delta_buf[adj_el->element -
storage];
466 adj_el->uv[0] = (*luv)[0] + strength *
safe_divide(delta_sum[0], delta_sum[2]);
467 adj_el->uv[1] = (*luv)[1] + strength *
safe_divide(delta_sum[1], delta_sum[2]);
483 MEM_SAFE_DELETE(delta_buf);
495 UvSculptData *sculptdata =
static_cast<UvSculptData *
>(op->
customdata);
496 eBrushUVSculptTool tool = eBrushUVSculptTool(sculptdata->tool);
497 int invert = sculptdata->invert ? -1 : 1;
498 float alpha = sculptdata->uvsculpt->strength;
511 const float radius = (sculptdata->uvsculpt->size / 2.0f) / (width * zoomx);
512 float aspectRatio = width /
float(height);
515 const float radius_sq = radius * radius;
520 case UV_SCULPT_BRUSH_TYPE_PINCH: {
523 for (i = 0; i < sculptdata->totalUniqueUvs; i++) {
524 if (sculptdata->uv[i].is_locked) {
530 diff[1] /= aspectRatio;
532 if (dist <= radius_sq) {
538 sculptdata->uv[i].uv[0] -= strength *
diff[0] * 0.001f;
539 sculptdata->uv[i].uv[1] -= strength *
diff[1] * 0.001f;
554 case UV_SCULPT_BRUSH_TYPE_RELAX: {
564 case UV_SCULPT_BRUSH_TYPE_GRAB: {
569 for (i = 0; i < sculptdata->initial_stroke->totalInitialSelected; i++) {
571 int uvindex = sculptdata->initial_stroke->initialSelection[i].uv;
572 float strength = sculptdata->initial_stroke->initialSelection[i].strength;
573 sculptdata->uv[uvindex].uv[0] =
574 sculptdata->initial_stroke->initialSelection[i].initial_uv[0] + strength *
diff[0];
575 sculptdata->uv[uvindex].uv[1] =
576 sculptdata->initial_stroke->initialSelection[i].initial_uv[1] + strength *
diff[1];
581 if (
element->separate &&
element != sculptdata->uv[uvindex].element) {
607 data->elementMap =
nullptr;
608 MEM_SAFE_DELETE(
data->uv);
609 MEM_SAFE_DELETE(
data->uvedges);
610 if (
data->initial_stroke) {
611 MEM_SAFE_DELETE(
data->initial_stroke->initialSelection);
612 MEM_SAFE_DELETE(
data->initial_stroke);
615 MEM_SAFE_DELETE(
data);
622 const bool do_islands)
625 if (!
element || (do_islands &&
element->island != island_index)) {
633 const UvEdge *edge =
static_cast<const UvEdge *
>(key);
639 const UvEdge *edge1 =
static_cast<const UvEdge *
>(a);
640 const UvEdge *edge2 =
static_cast<const UvEdge *
>(
b);
642 if ((edge1->uv1 == edge2->uv1) && (edge1->uv2 == edge2->uv2)) {
685 int island_index = 0;
687 data->tool = UV_SCULPT_BRUSH_TYPE_RELAX;
690 data->tool = UV_SCULPT_BRUSH_TYPE_GRAB;
693 data->tool = UV_SCULPT_BRUSH_TYPE_PINCH;
702 const bool use_winding =
false;
703 const bool use_seams =
true;
705 bm, scene,
false, use_winding, use_seams, do_island_optimization);
707 if (!
data->elementMap) {
716 if (do_island_optimization) {
722 island_index =
element->island;
727 int unique_uvs =
data->elementMap->total_unique_uvs;
728 if (do_island_optimization) {
729 unique_uvs =
data->elementMap->island_total_unique_uvs[island_index];
739 if (!
data->uv || !uniqueUv || !edgeHash || !edges) {
740 MEM_SAFE_DELETE(edges);
741 MEM_SAFE_DELETE(uniqueUv);
749 data->totalUniqueUvs = unique_uvs;
759 if (do_island_optimization && (
element->island != island_index)) {
771 data->uv[counter].uv = *luv;
772 if (
data->tool != UV_SCULPT_BRUSH_TYPE_GRAB) {
774 data->uv[counter].is_locked =
true;
779 uniqueUv[
element -
data->elementMap->storage] = counter;
789 data->elementMap,
l, island_index, do_island_optimization);
791 data->elementMap,
l->
next, island_index, do_island_optimization);
794 if (itmp1 == -1 || itmp2 == -1) {
798 int offset1 = uniqueUv[itmp1];
799 int offset2 = uniqueUv[itmp2];
803 if (offset1 < offset2) {
804 edges[counter].uv1 = offset1;
805 edges[counter].uv2 = offset2;
808 edges[counter].uv1 = offset2;
809 edges[counter].uv2 = offset1;
811 UvEdge *prev_edge =
static_cast<UvEdge *
>(
BLI_ghash_lookup(edgeHash, &edges[counter]));
813 prev_edge->is_interior =
true;
814 edges[counter].is_interior =
true;
823 MEM_SAFE_DELETE(uniqueUv);
827 if (!
data->uvedges) {
829 MEM_SAFE_DELETE(edges);
845 MEM_SAFE_DELETE(edges);
848 for (
int i = 0; i <
data->totalUvEdges; i++) {
849 if (!
data->uvedges[i].is_interior) {
850 data->uv[
data->uvedges[i].uv1].is_boundary =
true;
851 data->uv[
data->uvedges[i].uv2].is_boundary =
true;
853 data->uv[
data->uvedges[i].uv1].is_locked =
true;
854 data->uv[
data->uvedges[i].uv2].is_locked =
true;
866 if (
data->tool == UV_SCULPT_BRUSH_TYPE_GRAB) {
867 float alpha =
data->uvsculpt->strength;
868 float radius =
data->uvsculpt->size / 2.0f;
874 float aspectRatio = width /
float(height);
875 radius /= (width * zoomx);
876 const float radius_sq = radius * radius;
880 if (!
data->initial_stroke) {
884 data->totalUniqueUvs, __func__);
885 if (!
data->initial_stroke->initialSelection) {
892 for (
int i = 0; i <
data->totalUniqueUvs; i++) {
893 if (
data->uv[i].is_locked) {
899 diff[1] /= aspectRatio;
901 if (dist <= radius_sq) {
905 data->initial_stroke->initialSelection[counter].uv = i;
906 data->initial_stroke->initialSelection[counter].strength = strength;
907 copy_v2_v2(
data->initial_stroke->initialSelection[counter].initial_uv,
data->uv[i].uv);
912 data->initial_stroke->totalInitialSelected = counter;
919 return static_cast<UvSculptData *
>(op->
customdata);
949 switch (event->
type) {
980 ot->
srna,
"use_invert",
false,
"Invert",
"Invert action for the duration of the stroke");
986 ot->
name =
"Grab UVs";
988 ot->
idname =
"SCULPT_OT_uv_sculpt_grab";
1001 ot->
name =
"Relax UVs";
1003 ot->
idname =
"SCULPT_OT_uv_sculpt_relax";
1014 {UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN,
1018 "Use Laplacian method for relaxation"},
1019 {UV_SCULPT_BRUSH_TYPE_RELAX_HC,
"HC", 0,
"HC",
"Use HC method for relaxation"},
1020 {UV_SCULPT_BRUSH_TYPE_RELAX_COTAN,
1024 "Use Geometry (cotangent) relaxation, making UVs follow the underlying 3D geometry"},
1025 {0,
nullptr, 0,
nullptr,
nullptr},
1031 UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN,
1033 "Algorithm used for UV relaxation");
1038 ot->
name =
"Pinch UVs";
1040 ot->
idname =
"SCULPT_OT_uv_sculpt_pinch";
CustomData interface, see also DNA_customdata_types.h.
#define GHASH_ITER(gh_iter_, ghash_)
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define BLI_assert_unreachable()
#define BM_ELEM_CD_GET_BOOL(ele, offset)
#define BM_ELEM_CD_GET_FLOAT2_P(ele, offset)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt)
#define storage(slot, qualifiers)
float2x2 invert(float2x2 mat)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
bool uv_find_nearest_vert(Scene *scene, Object *obedit, const float co[2], float penalty_dist, UvNearestHit *hit)
UvElement * BM_uv_element_get(const UvElementMap *element_map, const BMLoop *l)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned int BLI_ghashutil_uinthash(unsigned int key)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
int RNA_enum_get(PointerRNA *ptr, const char *name)
static void relaxation_iteration_uv(UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspect_ratio, const int method)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
UvElement ** BM_uv_element_map_ensure_head_table(UvElementMap *element_map)
static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, const wmEvent *event, Object *obedit)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
ATTR_WARN_UNUSED_RESULT const BMLoop * l
MINLINE void mul_v2_fl(float r[2], float f)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
void SCULPT_OT_uv_sculpt_relax(wmOperatorType *ot)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
static int uv_element_offset_from_face_get(UvElementMap *map, BMLoop *l, int island_index, const bool do_islands)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void register_common_props(wmOperatorType *ot)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
wmWindow * CTX_wm_window(const bContext *C)
MINLINE float normalize_v2(float n[2])
ATTR_WARN_UNUSED_RESULT const BMVert * v
static wmOperatorStatus uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_region_tag_redraw(ARegion *region)
void BM_uv_element_map_free(UvElementMap *element_map)
void ED_uvedit_live_unwrap_re_solve()
void BLI_ghash_insert(GHash *gh, void *key, void *val)
static void uv_sculpt_stroke_exit(bContext *C, wmOperator *op)
void BKE_curvemapping_init(CurveMapping *cumap)
int BKE_image_find_nearest_tile_with_offset(const Image *image, const float co[2], float r_uv_offset[2]) ATTR_NONNULL(2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
MINLINE void add_v2_v2(float r[2], const float a[2])
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
wmWindowManager * CTX_wm_manager(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
static void set_element_flag(UvElement *element, const int flag)
void SCULPT_OT_uv_sculpt_pinch(wmOperatorType *ot)
static float tri_weight_v3(int method, const float *v1, const float *v2, const float *v3)
void SCULPT_OT_uv_sculpt_grab(wmOperatorType *ot)
float BKE_brush_curve_strength(eBrushCurvePreset preset, const CurveMapping *cumap, float distance, float brush_radius)
UvNearestHit uv_nearest_hit_init_max(const View2D *v2d)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
static void laplacian_relaxation_iteration_uv(UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspectRatio)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool ED_operator_uvedit_space_image(bContext *C)
void ED_uvedit_live_unwrap_end(bool cancel)
SpaceImage * CTX_wm_space_image(const bContext *C)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
static float calc_strength(const UvSculptData *sculptdata, float p, const float len)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
float cotangent_tri_weight_v3(const float v1[3], const float v2[3], const float v3[3])
static bool uv_edge_compare(const void *a, const void *b)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static wmOperatorStatus uv_sculpt_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
static UvSculptData * uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wmEvent *event)
UvElementMap * BM_uv_element_map_create(BMesh *bm, const Scene *scene, bool uv_selected, bool use_winding, bool use_seams, bool do_islands)
void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit, struct wmWindow *win_modal)
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
Scene * CTX_data_scene(const bContext *C)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
static void apply_sculpt_data_constraints(UvSculptData *sculptdata, float uv[2])
static void HC_relaxation_iteration_uv(UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspectRatio)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const wmEventType event_type, const double time_step)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
BMUVOffsets BM_uv_map_offsets_get(const BMesh *bm)
ATTR_WARN_UNUSED_RESULT const void * element
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static uint uv_edge_hash(const void *key)
MINLINE float safe_divide(float a, float b)
ARegion * CTX_wm_region(const bContext *C)
static void add_weighted_edge(float(*delta_buf)[3], const UvElement *storage, const UvElement *ele_next, const UvElement *ele_prev, const float luv_next[2], const float luv_prev[2], const float weight)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
MINLINE float clamp_f(float value, float min, float max)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
struct ToolSettings * toolsettings
struct CurveMapping * curve_distance_falloff
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
struct wmOperatorType * type