Blender V5.3
editmesh_inset.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "MEM_guardedalloc.h"
10
11#include "DNA_mesh_types.h"
12#include "DNA_object_types.h"
13
14#include "BLI_math_matrix_c.hh"
15#include "BLI_math_vector_c.hh"
16#include "BLI_string_utf8.hh"
17#include "BLI_string_utils.hh"
18
19#include "BLT_translation.hh"
20
21#include "BKE_context.hh"
22#include "BKE_editmesh.hh"
23#include "BKE_global.hh"
24#include "BKE_layer.hh"
25#include "BKE_screen.hh"
26#include "BKE_unit.hh"
27
28#include "RNA_access.hh"
29#include "RNA_define.hh"
30
31#include "WM_api.hh"
32#include "WM_types.hh"
33
34#include "UI_interface.hh"
35
36#include "ED_mesh.hh"
37#include "ED_numinput.hh"
38#include "ED_screen.hh"
39#include "ED_space_api.hh"
40#include "ED_transform.hh"
41#include "ED_util.hh"
42#include "ED_view3d.hh"
43
44#include "mesh_intern.hh" /* own include */
45
46namespace blender {
47
53
54struct InsetData {
56 float old_depth;
59 float pixel_size; /* use when mouse input is interpreted as spatial distance */
61 bool shift;
65
68
69 /* modal only */
71 float mcenter[2];
73};
74
76{
77 InsetData *opdata = static_cast<InsetData *>(op->customdata);
78 ScrArea *area = CTX_wm_area(C);
79 Scene *sce = CTX_data_scene(C);
80
81 if (area) {
82 char msg[UI_MAX_DRAW_STR];
83 char flts_str[NUM_STR_REP_LEN * 2];
84 if (hasNumInput(&opdata->num_input)) {
85 outputNumInput(&opdata->num_input, flts_str, sce->unit);
86 }
87 else {
88 const int precision = opdata->shift ? 6 : 4;
91 RNA_float_get(op->ptr, "thickness"),
92 precision * -1,
94 sce->unit,
95 true,
96 true);
99 RNA_float_get(op->ptr, "depth"),
100 precision * -1,
102 sce->unit,
103 true,
104 true);
105 }
106 SNPRINTF_UTF8(msg,
107 IFACE_("Thickness: %s, Depth: %s"),
108 flts_str,
109 BLI_string_pad_number_sign(flts_str + NUM_STR_REP_LEN).c_str());
110 ED_area_status_text(area, msg);
111 }
112
113 WorkspaceStatus status(C);
114 status.item(IFACE_("Confirm"), ICON_EVENT_RETURN, ICON_MOUSE_LMB);
115 status.item(IFACE_("Cancel"), ICON_EVENT_ESC, ICON_MOUSE_RMB);
116 status.item_bool(IFACE_("Depth"), opdata->modify_depth, ICON_EVENT_CTRL);
117 status.item_bool(IFACE_("Outset"), RNA_boolean_get(op->ptr, "use_outset"), ICON_EVENT_O);
118 status.item_bool(IFACE_("Boundary"), RNA_boolean_get(op->ptr, "use_boundary"), ICON_EVENT_B);
119 status.item_bool(IFACE_("Individual"), RNA_boolean_get(op->ptr, "use_individual"), ICON_EVENT_I);
120}
121
122static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
123{
124 InsetData *opdata;
125 const Main *bmain = CTX_data_main(C);
126 Scene *scene = CTX_data_scene(C);
127 ViewLayer *view_layer = CTX_data_view_layer(C);
128
129 if (is_modal) {
130 RNA_float_set(op->ptr, "thickness", 0.0f);
131 RNA_float_set(op->ptr, "depth", 0.0f);
132 }
133
134 op->customdata = opdata = MEM_new_uninitialized<InsetData>("inset_operator_data");
135
136 uint objects_used_len = 0;
137
138 opdata->max_obj_scale = FLT_MIN;
139
140 {
142 *bmain, scene, view_layer, CTX_wm_view3d(C));
143 opdata->ob_store = MEM_new_array_uninitialized<InsetObjectStore>(objects.size(), __func__);
144 for (uint ob_index = 0; ob_index < objects.size(); ob_index++) {
145 Object *obedit = objects[ob_index];
146 float scale = mat4_to_scale(obedit->object_to_world().ptr());
147 opdata->max_obj_scale = max_ff(opdata->max_obj_scale, scale);
148 const BMesh *bm = BKE_editmesh_bmesh_get(obedit);
149 if (bm->totvertsel > 0) {
150 opdata->ob_store[objects_used_len].ob = obedit;
151 objects_used_len++;
152 }
153 }
154 opdata->ob_store_len = objects_used_len;
155 }
156
157 opdata->old_thickness = 0.0;
158 opdata->old_depth = 0.0;
159 opdata->modify_depth = false;
160 opdata->shift = false;
161 opdata->shift_amount = 0.0f;
162 opdata->is_modal = is_modal;
163
164 initNumInput(&opdata->num_input);
165 opdata->num_input.idx_max = 1; /* Two elements. */
166 opdata->num_input.unit_sys = scene->unit.system;
167 opdata->num_input.unit_type[0] = B_UNIT_LENGTH;
168 opdata->num_input.unit_type[1] = B_UNIT_LENGTH;
169
170 if (is_modal) {
171 ARegion *region = CTX_wm_region(C);
172
173 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
174 Object *obedit = opdata->ob_store[ob_index].ob;
176 opdata->ob_store[ob_index].mesh_backup = EDBM_redo_state_store(bm);
177 }
178
181 opdata->mcenter,
183 G.moving = G_TRANSFORM_EDIT;
184 }
185
186 return true;
187}
188
190{
191 InsetData *opdata;
192 ScrArea *area = CTX_wm_area(C);
193
194 opdata = static_cast<InsetData *>(op->customdata);
195
196 if (opdata->is_modal) {
197 ARegion *region = CTX_wm_region(C);
198 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
199 EDBM_redo_state_free(&opdata->ob_store[ob_index].mesh_backup);
200 }
202 G.moving = 0;
203 }
204
205 if (area) {
206 ED_area_status_text(area, nullptr);
207 }
208 ED_workspace_status_text(C, nullptr);
209
210 MEM_SAFE_DELETE(opdata->ob_store);
211 MEM_delete(opdata);
212 op->customdata = nullptr;
213}
214
216{
217 InsetData *opdata = static_cast<InsetData *>(op->customdata);
218 if (opdata->is_modal) {
219 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
220 Object *obedit = opdata->ob_store[ob_index].ob;
223 EDBM_redo_state_restore_and_free(&opdata->ob_store[ob_index].mesh_backup, em, bm, true);
224 EDBMUpdate_Params params{};
225 params.calc_looptris = false;
226 params.calc_normals = false;
227 params.is_destructive = true;
228 EDBM_update(id_cast<Mesh *>(obedit->data), &params);
229 }
230 }
231
232 edbm_inset_exit(C, op);
233
234 /* need to force redisplay or we may still view the modified result */
236}
237
239{
240 InsetData *opdata;
241 BMOperator bmop;
242 bool changed = false;
243
244 const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
245 const bool use_even_offset = RNA_boolean_get(op->ptr, "use_even_offset");
246 const bool use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
247 const bool use_edge_rail = RNA_boolean_get(op->ptr, "use_edge_rail");
248 const float thickness = RNA_float_get(op->ptr, "thickness");
249 const float depth = RNA_float_get(op->ptr, "depth");
250 const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
251 /* not passed onto the BMO */
252 const bool use_select_inset = RNA_boolean_get(op->ptr, "use_select_inset");
253 const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
254 const bool use_interpolate = RNA_boolean_get(op->ptr, "use_interpolate");
255
256 opdata = static_cast<InsetData *>(op->customdata);
257
258 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
259 Object *obedit = opdata->ob_store[ob_index].ob;
262
263 if (opdata->is_modal) {
264 EDBM_redo_state_restore(&opdata->ob_store[ob_index].mesh_backup, em, bm, false);
265 }
266
267 if (use_individual) {
269 &bmop,
270 op,
271 "inset_individual faces=%hf use_even_offset=%b use_relative_offset=%b "
272 "use_interpolate=%b thickness=%f depth=%f",
274 use_even_offset,
275 use_relative_offset,
276 use_interpolate,
277 thickness,
278 depth);
279 }
280 else {
282 bm,
283 &bmop,
284 op,
285 "inset_region faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b "
286 "use_interpolate=%b thickness=%f depth=%f use_outset=%b use_edge_rail=%b",
288 use_boundary,
289 use_even_offset,
290 use_relative_offset,
291 use_interpolate,
292 thickness,
293 depth,
294 use_outset,
295 use_edge_rail);
296
297 if (use_outset) {
299 bm, &bmop, bmop.slots_in, "faces_exclude", BM_FACE, BM_ELEM_HIDDEN);
300 }
301 }
302 BMO_op_exec(bm, &bmop);
303
304 if (use_select_inset) {
305 /* deselect original faces/verts */
308 }
309 else {
312 }
313
314 if (!EDBM_op_finish(bm, &bmop, op, true)) {
315 continue;
316 }
317
318 EDBMUpdate_Params params{};
319 params.calc_looptris = true;
320 params.calc_normals = false;
321 params.is_destructive = true;
322 EDBM_update(id_cast<Mesh *>(obedit->data), &params);
323 changed = true;
324 }
325 return changed;
326}
327
329{
330 if (!edbm_inset_init(C, op, false)) {
331 return OPERATOR_CANCELLED;
332 }
333
334 if (!edbm_inset_calc(op)) {
335 edbm_inset_exit(C, op);
336 return OPERATOR_CANCELLED;
337 }
338
339 edbm_inset_exit(C, op);
340 return OPERATOR_FINISHED;
341}
342
344{
346 InsetData *opdata;
347 float mlen[2];
348 float center_3d[3];
349
350 if (!edbm_inset_init(C, op, true)) {
351 return OPERATOR_CANCELLED;
352 }
353
354 opdata = static_cast<InsetData *>(op->customdata);
355
357
358 /* initialize mouse values */
360 C, V3D_AROUND_CENTER_MEDIAN, center_3d, opdata->mcenter))
361 {
362 /* in this case the tool will likely do nothing,
363 * ideally this will never happen and should be checked for above */
364 opdata->mcenter[0] = opdata->mcenter[1] = 0;
365 }
366 mlen[0] = opdata->mcenter[0] - event->mval[0];
367 mlen[1] = opdata->mcenter[1] - event->mval[1];
368 opdata->initial_length = len_v2(mlen);
369 opdata->pixel_size = rv3d ? ED_view3d_pixel_size(rv3d, center_3d) : 1.0f;
370
371 edbm_inset_calc(op);
372
374
377}
378
380{
381 InsetData *opdata = static_cast<InsetData *>(op->customdata);
382 const bool has_numinput = hasNumInput(&opdata->num_input);
383
384 /* Modal numinput active, try to handle numeric inputs first... */
385 if (event->val == KM_PRESS && has_numinput && handleNumInput(C, &opdata->num_input, event)) {
386 float amounts[2] = {RNA_float_get(op->ptr, "thickness"), RNA_float_get(op->ptr, "depth")};
387 applyNumInput(&opdata->num_input, amounts);
388 amounts[0] = max_ff(amounts[0], 0.0f);
389 RNA_float_set(op->ptr, "thickness", amounts[0]);
390 RNA_float_set(op->ptr, "depth", amounts[1]);
391
392 if (edbm_inset_calc(op)) {
395 }
396 edbm_inset_cancel(C, op);
397 return OPERATOR_CANCELLED;
398 }
399 if ((event->type == opdata->launch_event) && (event->val == KM_RELEASE) &&
400 RNA_boolean_get(op->ptr, "release_confirm"))
401 {
402 edbm_inset_calc(op);
403 edbm_inset_exit(C, op);
404 return OPERATOR_FINISHED;
405 }
406
407 bool handled = false;
408 switch (event->type) {
409 case EVT_ESCKEY:
410 case RIGHTMOUSE:
411 edbm_inset_cancel(C, op);
412 return OPERATOR_CANCELLED;
413
414 case MOUSEMOVE:
415 if (!has_numinput) {
416 float mdiff[2];
417 float amount;
418
419 mdiff[0] = opdata->mcenter[0] - event->mval[0];
420 mdiff[1] = opdata->mcenter[1] - event->mval[1];
421
422 if (opdata->modify_depth) {
423 amount = opdata->old_depth +
424 ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
425 opdata->max_obj_scale;
426 }
427 else {
428 amount = opdata->old_thickness -
429 ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
430 opdata->max_obj_scale;
431 }
432
433 /* Fake shift-transform... */
434 if (opdata->shift) {
435 amount = (amount - opdata->shift_amount) * 0.1f + opdata->shift_amount;
436 }
437
438 if (opdata->modify_depth) {
439 RNA_float_set(op->ptr, "depth", amount);
440 }
441 else {
442 amount = max_ff(amount, 0.0f);
443 RNA_float_set(op->ptr, "thickness", amount);
444 }
445
446 if (edbm_inset_calc(op)) {
448 }
449 else {
450 edbm_inset_cancel(C, op);
451 return OPERATOR_CANCELLED;
452 }
453 handled = true;
454 }
455 break;
456
457 case LEFTMOUSE:
458 case EVT_PADENTER:
459 case EVT_RETKEY:
460 if ((event->val == KM_PRESS) ||
461 ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm")))
462 {
463 edbm_inset_calc(op);
464 edbm_inset_exit(C, op);
465 return OPERATOR_FINISHED;
466 }
467 break;
468 case EVT_LEFTSHIFTKEY:
470 if (event->val == KM_PRESS) {
471 if (opdata->modify_depth) {
472 opdata->shift_amount = RNA_float_get(op->ptr, "depth");
473 }
474 else {
475 opdata->shift_amount = RNA_float_get(op->ptr, "thickness");
476 }
477 opdata->shift = true;
478 handled = true;
479 }
480 else {
481 opdata->shift_amount = 0.0f;
482 opdata->shift = false;
483 handled = true;
484 }
485 break;
486
487 case EVT_LEFTCTRLKEY:
488 case EVT_RIGHTCTRLKEY: {
489 float mlen[2];
490
491 mlen[0] = opdata->mcenter[0] - event->mval[0];
492 mlen[1] = opdata->mcenter[1] - event->mval[1];
493
494 if (event->val == KM_PRESS) {
495 opdata->old_thickness = RNA_float_get(op->ptr, "thickness");
496 if (opdata->shift) {
497 opdata->shift_amount = opdata->old_thickness;
498 }
499 opdata->modify_depth = true;
500 }
501 else {
502 opdata->old_depth = RNA_float_get(op->ptr, "depth");
503 if (opdata->shift) {
504 opdata->shift_amount = opdata->old_depth;
505 }
506 opdata->modify_depth = false;
507 }
508 opdata->initial_length = len_v2(mlen);
509
511 handled = true;
512 break;
513 }
514
515 case EVT_OKEY:
516 if (event->val == KM_PRESS) {
517 const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
518 RNA_boolean_set(op->ptr, "use_outset", !use_outset);
519 if (edbm_inset_calc(op)) {
521 }
522 else {
523 edbm_inset_cancel(C, op);
524 return OPERATOR_CANCELLED;
525 }
526 handled = true;
527 }
528 break;
529 case EVT_BKEY:
530 if (event->val == KM_PRESS) {
531 const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
532 RNA_boolean_set(op->ptr, "use_boundary", !use_boundary);
533 if (edbm_inset_calc(op)) {
535 }
536 else {
537 edbm_inset_cancel(C, op);
538 return OPERATOR_CANCELLED;
539 }
540 handled = true;
541 }
542 break;
543 case EVT_IKEY:
544 if (event->val == KM_PRESS) {
545 const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
546 RNA_boolean_set(op->ptr, "use_individual", !use_individual);
547 if (edbm_inset_calc(op)) {
549 }
550 else {
551 edbm_inset_cancel(C, op);
552 return OPERATOR_CANCELLED;
553 }
554 handled = true;
555 }
556 break;
557 default: {
558 break;
559 }
560 }
561
562 /* Modal numinput inactive, try to handle numeric inputs last... */
563 if (!handled && event->val == KM_PRESS && handleNumInput(C, &opdata->num_input, event)) {
564 float amounts[2] = {RNA_float_get(op->ptr, "thickness"), RNA_float_get(op->ptr, "depth")};
565 applyNumInput(&opdata->num_input, amounts);
566 amounts[0] = max_ff(amounts[0], 0.0f);
567 RNA_float_set(op->ptr, "thickness", amounts[0]);
568 RNA_float_set(op->ptr, "depth", amounts[1]);
569
570 if (edbm_inset_calc(op)) {
573 }
574 edbm_inset_cancel(C, op);
575 return OPERATOR_CANCELLED;
576 }
577
579}
580
582{
583 PropertyRNA *prop;
584
585 /* identifiers */
586 ot->name = "Inset Faces";
587 ot->idname = "MESH_OT_inset";
588 ot->description = "Inset new faces into selected faces";
589
590 /* API callbacks. */
593 ot->exec = edbm_inset_exec;
596
597 /* flags */
599
600 /* properties */
601 RNA_def_boolean(ot->srna, "use_boundary", true, "Boundary", "Inset face boundaries");
603 "use_even_offset",
604 true,
605 "Offset Even",
606 "Scale the offset to give more even thickness");
608 "use_relative_offset",
609 false,
610 "Offset Relative",
611 "Scale the offset by surrounding geometry");
613 ot->srna, "use_edge_rail", false, "Edge Rail", "Inset the region along existing edges");
614
616 ot->srna, "thickness", 0.0f, 0.0f, 1e12f, "Thickness", "", 0.0f, 10.0f);
617 /* use 1 rather than 10 for max else dragging the button moves too far */
618 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
619
621 ot->srna, "depth", 0.0f, -1e12f, 1e12f, "Depth", "", -10.0f, 10.0f);
622 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.01, 4);
623
624 RNA_def_boolean(ot->srna, "use_outset", false, "Outset", "Outset rather than inset");
626 ot->srna, "use_select_inset", false, "Select Outer", "Select the new inset faces");
627 RNA_def_boolean(ot->srna, "use_individual", false, "Individual", "Individual face inset");
629 ot->srna, "use_interpolate", true, "Interpolate", "Blend face data across the inset");
630
631 prop = RNA_def_boolean(ot->srna, "release_confirm", false, "Confirm on Release", "");
633}
634
635} // namespace blender
#define SNPRINTF_UTF8(dst, format,...)
#define IFACE_(msgid)
Object is a sort of wrapper for general info.
#define NUM_STR_REP_LEN
#define REGION_DRAW_POST_PIXEL
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_MAX_DRAW_STR
int64_t size() const
void item(std::string text, int icon1, int icon2=0)
Definition area.cc:1076
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
Definition area.cc:1097
#define FLT_MIN
float3x3 scale(float3x3 mat, float2 scale)
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2])
BMesh Iterators.
void EDBM_flag_disable_all(BMesh *bm, char hflag)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
ScrArea * CTX_wm_area(const bContext *C)
void void void EDBM_redo_state_free(BMBackup *backup) ATTR_NONNULL(1)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
Definition editmesh.cc:79
static void edbm_inset_cancel(bContext *C, wmOperator *op)
unsigned int uint
Definition BKE_text.h:55
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
Definition numinput.cc:344
void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag, bool do_flush)
BMO_FLAG_BUFFER.
bool EDBM_op_init(BMesh *bm, BMOperator *bmop, wmOperator *op, const char *fmt,...)
static wmOperatorStatus edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
float mat4_to_scale(const float mat[4][4])
BMBackup EDBM_redo_state_store(BMesh *bm)
float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3])
static void edbm_inset_update_header(wmOperator *op, bContext *C)
static void edbm_inset_exit(bContext *C, wmOperator *op)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
@ V3D_AROUND_CENTER_MEDIAN
static bool edbm_inset_calc(wmOperator *op)
bool hasNumInput(const NumInput *n)
Definition numinput.cc:188
std::string BLI_string_pad_number_sign(blender::StringRef str)
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
ViewLayer * CTX_data_view_layer(const bContext *C)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Global G
Definition blender.cc:57
bool ED_operator_editmesh(bContext *C)
bool EDBM_op_finish(BMesh *bm, BMOperator *bmop, wmOperator *op, const bool do_report)
void * ED_region_draw_cb_activate(ARegionType *art, void(*draw)(const bContext *, ARegion *, void *), void *customdata, int type)
bool ED_region_draw_cb_exit(ARegionType *art, void *handle)
void initNumInput(NumInput *n)
Definition numinput.cc:85
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:975
RegionView3D * CTX_wm_region_view3d(const bContext *C)
size_t BKE_unit_value_as_string(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad, bool do_unit_suffix)
Definition unit.cc:1929
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool applyNumInput(NumInput *n, float *vec)
Definition numinput.cc:207
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Definition editmesh.cc:59
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
static wmOperatorStatus edbm_inset_exec(bContext *C, wmOperator *op)
void MESH_OT_inset(wmOperatorType *ot)
void EDBM_redo_state_restore(BMBackup *backup, BMEditMesh *em, BMesh *bm, bool recalc_looptris) ATTR_NONNULL(1
Main * CTX_data_main(const bContext *C)
MINLINE float max_ff(float a, float b)
void outputNumInput(NumInput *n, char *str, const UnitSettings &unit_settings)
Definition numinput.cc:104
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_HIDDEN
Definition RNA_types.hh:408
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
Definition editmesh.cc:65
@ G_TRANSFORM_EDIT
@ KM_RELEASE
Definition WM_types.hh:325
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
@ OPTYPE_BLOCKING
Definition WM_types.hh:192
@ OPTYPE_GRAB_CURSOR_XY
Definition WM_types.hh:196
void void EDBM_redo_state_restore_and_free(BMBackup *backup, BMEditMesh *em, BMesh *bm, bool recalc_looptris) ATTR_NONNULL(1
void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
Definition ed_draw.cc:672
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
int WM_userdef_event_type_from_keymap_type(int kmitype)
@ B_UNIT_LENGTH
Definition BKE_unit.hh:166
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, char htype, char hflag)
static wmOperatorStatus edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ARegion * CTX_wm_region(const bContext *C)
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1153
float RNA_float_get(PointerRNA *ptr, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
bke::ARegionRuntime * runtime
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
InsetObjectStore * ob_store
int unit_type[NUM_MAX_ELEMENTS]
struct UnitSettings unit
struct ARegionType * type
wmEventType type
Definition WM_types.hh:817
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
void(*) cancel(bContext *C, wmOperator *op)
Definition WM_types.hh:1149
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1157