Blender V4.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
9#include "MEM_guardedalloc.h"
10
11#include "DNA_object_types.h"
12
13#include "BLI_math_matrix.h"
14#include "BLI_math_vector.h"
15#include "BLI_string.h"
16
17#include "BLT_translation.hh"
18
19#include "BKE_context.hh"
20#include "BKE_editmesh.hh"
21#include "BKE_global.hh"
22#include "BKE_layer.hh"
23#include "BKE_unit.hh"
24
25#include "RNA_access.hh"
26#include "RNA_define.hh"
27
28#include "WM_api.hh"
29#include "WM_types.hh"
30
31#include "UI_interface.hh"
32
33#include "ED_mesh.hh"
34#include "ED_numinput.hh"
35#include "ED_screen.hh"
36#include "ED_space_api.hh"
37#include "ED_transform.hh"
38#include "ED_util.hh"
39#include "ED_view3d.hh"
40
41#include "mesh_intern.hh" /* own include */
42
43using blender::Vector;
44
50
51struct InsetData {
53 float old_depth;
56 float pixel_size; /* use when mouse input is interpreted as spatial distance */
58 bool shift;
62
65
66 /* modal only */
68 float mcenter[2];
70};
71
73{
74 InsetData *opdata = static_cast<InsetData *>(op->customdata);
75 ScrArea *area = CTX_wm_area(C);
76 Scene *sce = CTX_data_scene(C);
77
78 if (area) {
79 char msg[UI_MAX_DRAW_STR];
80 char flts_str[NUM_STR_REP_LEN * 2];
81 if (hasNumInput(&opdata->num_input)) {
82 outputNumInput(&opdata->num_input, flts_str, &sce->unit);
83 }
84 else {
87 RNA_float_get(op->ptr, "thickness"),
88 4,
90 &sce->unit,
91 true);
94 RNA_float_get(op->ptr, "depth"),
95 4,
97 &sce->unit,
98 true);
99 }
100 SNPRINTF(msg, IFACE_("Thickness: %s, Depth: %s"), flts_str, flts_str + NUM_STR_REP_LEN);
101 ED_area_status_text(area, msg);
102 }
103
104 WorkspaceStatus status(C);
105 status.item(IFACE_("Confirm"), ICON_EVENT_RETURN, ICON_MOUSE_LMB);
106 status.item(IFACE_("Cancel"), ICON_EVENT_ESC, ICON_MOUSE_RMB);
107 status.item_bool(IFACE_("Tweak"), opdata->modify_depth, ICON_EVENT_CTRL);
108 status.item_bool(IFACE_("Outset"), RNA_boolean_get(op->ptr, "use_outset"), ICON_EVENT_O);
109 status.item_bool(IFACE_("Boundary"), RNA_boolean_get(op->ptr, "use_boundary"), ICON_EVENT_B);
110 status.item_bool(IFACE_("Individual"), RNA_boolean_get(op->ptr, "use_individual"), ICON_EVENT_I);
111}
112
113static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
114{
115 InsetData *opdata;
116 Scene *scene = CTX_data_scene(C);
117 ViewLayer *view_layer = CTX_data_view_layer(C);
118
119 if (is_modal) {
120 RNA_float_set(op->ptr, "thickness", 0.0f);
121 RNA_float_set(op->ptr, "depth", 0.0f);
122 }
123
124 op->customdata = opdata = static_cast<InsetData *>(
125 MEM_mallocN(sizeof(InsetData), "inset_operator_data"));
126
127 uint objects_used_len = 0;
128
129 opdata->max_obj_scale = FLT_MIN;
130
131 {
133 scene, view_layer, CTX_wm_view3d(C));
134 opdata->ob_store = static_cast<InsetObjectStore *>(
135 MEM_malloc_arrayN(objects.size(), sizeof(*opdata->ob_store), __func__));
136 for (uint ob_index = 0; ob_index < objects.size(); ob_index++) {
137 Object *obedit = objects[ob_index];
138 float scale = mat4_to_scale(obedit->object_to_world().ptr());
139 opdata->max_obj_scale = max_ff(opdata->max_obj_scale, scale);
141 if (em->bm->totvertsel > 0) {
142 opdata->ob_store[objects_used_len].ob = obedit;
143 objects_used_len++;
144 }
145 }
146 opdata->ob_store_len = objects_used_len;
147 }
148
149 opdata->old_thickness = 0.0;
150 opdata->old_depth = 0.0;
151 opdata->modify_depth = false;
152 opdata->shift = false;
153 opdata->shift_amount = 0.0f;
154 opdata->is_modal = is_modal;
155
156 initNumInput(&opdata->num_input);
157 opdata->num_input.idx_max = 1; /* Two elements. */
158 opdata->num_input.unit_sys = scene->unit.system;
159 opdata->num_input.unit_type[0] = B_UNIT_LENGTH;
160 opdata->num_input.unit_type[1] = B_UNIT_LENGTH;
161
162 if (is_modal) {
163 ARegion *region = CTX_wm_region(C);
164
165 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
166 Object *obedit = opdata->ob_store[ob_index].ob;
168 opdata->ob_store[ob_index].mesh_backup = EDBM_redo_state_store(em);
169 }
170
173 G.moving = G_TRANSFORM_EDIT;
174 }
175
176 return true;
177}
178
180{
181 InsetData *opdata;
182 ScrArea *area = CTX_wm_area(C);
183
184 opdata = static_cast<InsetData *>(op->customdata);
185
186 if (opdata->is_modal) {
187 ARegion *region = CTX_wm_region(C);
188 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
189 EDBM_redo_state_free(&opdata->ob_store[ob_index].mesh_backup);
190 }
191 ED_region_draw_cb_exit(region->type, opdata->draw_handle_pixel);
192 G.moving = 0;
193 }
194
195 if (area) {
196 ED_area_status_text(area, nullptr);
197 }
198 ED_workspace_status_text(C, nullptr);
199
200 MEM_SAFE_FREE(opdata->ob_store);
202}
203
205{
206 InsetData *opdata;
207
208 opdata = static_cast<InsetData *>(op->customdata);
209 if (opdata->is_modal) {
210 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
211 Object *obedit = opdata->ob_store[ob_index].ob;
213 EDBM_redo_state_restore_and_free(&opdata->ob_store[ob_index].mesh_backup, em, true);
215 params.calc_looptris = false;
216 params.calc_normals = false;
217 params.is_destructive = true;
218 EDBM_update(static_cast<Mesh *>(obedit->data), &params);
219 }
220 }
221
222 edbm_inset_exit(C, op);
223
224 /* need to force redisplay or we may still view the modified result */
226}
227
229{
230 InsetData *opdata;
231 BMOperator bmop;
232 bool changed = false;
233
234 const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
235 const bool use_even_offset = RNA_boolean_get(op->ptr, "use_even_offset");
236 const bool use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
237 const bool use_edge_rail = RNA_boolean_get(op->ptr, "use_edge_rail");
238 const float thickness = RNA_float_get(op->ptr, "thickness");
239 const float depth = RNA_float_get(op->ptr, "depth");
240 const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
241 /* not passed onto the BMO */
242 const bool use_select_inset = RNA_boolean_get(op->ptr, "use_select_inset");
243 const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
244 const bool use_interpolate = RNA_boolean_get(op->ptr, "use_interpolate");
245
246 opdata = static_cast<InsetData *>(op->customdata);
247
248 for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
249 Object *obedit = opdata->ob_store[ob_index].ob;
251
252 if (opdata->is_modal) {
253 EDBM_redo_state_restore(&opdata->ob_store[ob_index].mesh_backup, em, false);
254 }
255
256 if (use_individual) {
257 EDBM_op_init(em,
258 &bmop,
259 op,
260 "inset_individual faces=%hf use_even_offset=%b use_relative_offset=%b "
261 "use_interpolate=%b thickness=%f depth=%f",
263 use_even_offset,
264 use_relative_offset,
265 use_interpolate,
266 thickness,
267 depth);
268 }
269 else {
271 em,
272 &bmop,
273 op,
274 "inset_region faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b "
275 "use_interpolate=%b thickness=%f depth=%f use_outset=%b use_edge_rail=%b",
277 use_boundary,
278 use_even_offset,
279 use_relative_offset,
280 use_interpolate,
281 thickness,
282 depth,
283 use_outset,
284 use_edge_rail);
285
286 if (use_outset) {
288 em->bm, &bmop, bmop.slots_in, "faces_exclude", BM_FACE, BM_ELEM_HIDDEN);
289 }
290 }
291 BMO_op_exec(em->bm, &bmop);
292
293 if (use_select_inset) {
294 /* deselect original faces/verts */
297 em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
298 }
299 else {
302 }
303
304 if (!EDBM_op_finish(em, &bmop, op, true)) {
305 continue;
306 }
307
309 params.calc_looptris = true;
310 params.calc_normals = false;
311 params.is_destructive = true;
312 EDBM_update(static_cast<Mesh *>(obedit->data), &params);
313 changed = true;
314 }
315 return changed;
316}
317
319{
320 if (!edbm_inset_init(C, op, false)) {
321 return OPERATOR_CANCELLED;
322 }
323
324 if (!edbm_inset_calc(op)) {
325 edbm_inset_exit(C, op);
326 return OPERATOR_CANCELLED;
327 }
328
329 edbm_inset_exit(C, op);
330 return OPERATOR_FINISHED;
331}
332
333static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
334{
336 InsetData *opdata;
337 float mlen[2];
338 float center_3d[3];
339
340 if (!edbm_inset_init(C, op, true)) {
341 return OPERATOR_CANCELLED;
342 }
343
344 opdata = static_cast<InsetData *>(op->customdata);
345
347
348 /* initialize mouse values */
349 if (!calculateTransformCenter(C, V3D_AROUND_CENTER_MEDIAN, center_3d, opdata->mcenter)) {
350 /* in this case the tool will likely do nothing,
351 * ideally this will never happen and should be checked for above */
352 opdata->mcenter[0] = opdata->mcenter[1] = 0;
353 }
354 mlen[0] = opdata->mcenter[0] - event->mval[0];
355 mlen[1] = opdata->mcenter[1] - event->mval[1];
356 opdata->initial_length = len_v2(mlen);
357 opdata->pixel_size = rv3d ? ED_view3d_pixel_size(rv3d, center_3d) : 1.0f;
358
359 edbm_inset_calc(op);
360
362
365}
366
367static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
368{
369 InsetData *opdata = static_cast<InsetData *>(op->customdata);
370 const bool has_numinput = hasNumInput(&opdata->num_input);
371
372 /* Modal numinput active, try to handle numeric inputs first... */
373 if (event->val == KM_PRESS && has_numinput && handleNumInput(C, &opdata->num_input, event)) {
374 float amounts[2] = {RNA_float_get(op->ptr, "thickness"), RNA_float_get(op->ptr, "depth")};
375 applyNumInput(&opdata->num_input, amounts);
376 amounts[0] = max_ff(amounts[0], 0.0f);
377 RNA_float_set(op->ptr, "thickness", amounts[0]);
378 RNA_float_set(op->ptr, "depth", amounts[1]);
379
380 if (edbm_inset_calc(op)) {
383 }
384 edbm_inset_cancel(C, op);
385 return OPERATOR_CANCELLED;
386 }
387 if ((event->type == opdata->launch_event) && (event->val == KM_RELEASE) &&
388 RNA_boolean_get(op->ptr, "release_confirm"))
389 {
390 edbm_inset_calc(op);
391 edbm_inset_exit(C, op);
392 return OPERATOR_FINISHED;
393 }
394
395 bool handled = false;
396 switch (event->type) {
397 case EVT_ESCKEY:
398 case RIGHTMOUSE:
399 edbm_inset_cancel(C, op);
400 return OPERATOR_CANCELLED;
401
402 case MOUSEMOVE:
403 if (!has_numinput) {
404 float mdiff[2];
405 float amount;
406
407 mdiff[0] = opdata->mcenter[0] - event->mval[0];
408 mdiff[1] = opdata->mcenter[1] - event->mval[1];
409
410 if (opdata->modify_depth) {
411 amount = opdata->old_depth +
412 ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
413 opdata->max_obj_scale;
414 }
415 else {
416 amount = opdata->old_thickness -
417 ((len_v2(mdiff) - opdata->initial_length) * opdata->pixel_size) /
418 opdata->max_obj_scale;
419 }
420
421 /* Fake shift-transform... */
422 if (opdata->shift) {
423 amount = (amount - opdata->shift_amount) * 0.1f + opdata->shift_amount;
424 }
425
426 if (opdata->modify_depth) {
427 RNA_float_set(op->ptr, "depth", amount);
428 }
429 else {
430 amount = max_ff(amount, 0.0f);
431 RNA_float_set(op->ptr, "thickness", amount);
432 }
433
434 if (edbm_inset_calc(op)) {
436 }
437 else {
438 edbm_inset_cancel(C, op);
439 return OPERATOR_CANCELLED;
440 }
441 handled = true;
442 }
443 break;
444
445 case LEFTMOUSE:
446 case EVT_PADENTER:
447 case EVT_RETKEY:
448 if ((event->val == KM_PRESS) ||
449 ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm")))
450 {
451 edbm_inset_calc(op);
452 edbm_inset_exit(C, op);
453 return OPERATOR_FINISHED;
454 }
455 break;
456 case EVT_LEFTSHIFTKEY:
458 if (event->val == KM_PRESS) {
459 if (opdata->modify_depth) {
460 opdata->shift_amount = RNA_float_get(op->ptr, "depth");
461 }
462 else {
463 opdata->shift_amount = RNA_float_get(op->ptr, "thickness");
464 }
465 opdata->shift = true;
466 handled = true;
467 }
468 else {
469 opdata->shift_amount = 0.0f;
470 opdata->shift = false;
471 handled = true;
472 }
473 break;
474
475 case EVT_LEFTCTRLKEY:
476 case EVT_RIGHTCTRLKEY: {
477 float mlen[2];
478
479 mlen[0] = opdata->mcenter[0] - event->mval[0];
480 mlen[1] = opdata->mcenter[1] - event->mval[1];
481
482 if (event->val == KM_PRESS) {
483 opdata->old_thickness = RNA_float_get(op->ptr, "thickness");
484 if (opdata->shift) {
485 opdata->shift_amount = opdata->old_thickness;
486 }
487 opdata->modify_depth = true;
488 }
489 else {
490 opdata->old_depth = RNA_float_get(op->ptr, "depth");
491 if (opdata->shift) {
492 opdata->shift_amount = opdata->old_depth;
493 }
494 opdata->modify_depth = false;
495 }
496 opdata->initial_length = len_v2(mlen);
497
499 handled = true;
500 break;
501 }
502
503 case EVT_OKEY:
504 if (event->val == KM_PRESS) {
505 const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
506 RNA_boolean_set(op->ptr, "use_outset", !use_outset);
507 if (edbm_inset_calc(op)) {
509 }
510 else {
511 edbm_inset_cancel(C, op);
512 return OPERATOR_CANCELLED;
513 }
514 handled = true;
515 }
516 break;
517 case EVT_BKEY:
518 if (event->val == KM_PRESS) {
519 const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
520 RNA_boolean_set(op->ptr, "use_boundary", !use_boundary);
521 if (edbm_inset_calc(op)) {
523 }
524 else {
525 edbm_inset_cancel(C, op);
526 return OPERATOR_CANCELLED;
527 }
528 handled = true;
529 }
530 break;
531 case EVT_IKEY:
532 if (event->val == KM_PRESS) {
533 const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
534 RNA_boolean_set(op->ptr, "use_individual", !use_individual);
535 if (edbm_inset_calc(op)) {
537 }
538 else {
539 edbm_inset_cancel(C, op);
540 return OPERATOR_CANCELLED;
541 }
542 handled = true;
543 }
544 break;
545 }
546
547 /* Modal numinput inactive, try to handle numeric inputs last... */
548 if (!handled && event->val == KM_PRESS && handleNumInput(C, &opdata->num_input, event)) {
549 float amounts[2] = {RNA_float_get(op->ptr, "thickness"), RNA_float_get(op->ptr, "depth")};
550 applyNumInput(&opdata->num_input, amounts);
551 amounts[0] = max_ff(amounts[0], 0.0f);
552 RNA_float_set(op->ptr, "thickness", amounts[0]);
553 RNA_float_set(op->ptr, "depth", amounts[1]);
554
555 if (edbm_inset_calc(op)) {
558 }
559 edbm_inset_cancel(C, op);
560 return OPERATOR_CANCELLED;
561 }
562
564}
565
567{
568 PropertyRNA *prop;
569
570 /* identifiers */
571 ot->name = "Inset Faces";
572 ot->idname = "MESH_OT_inset";
573 ot->description = "Inset new faces into selected faces";
574
575 /* api callbacks */
581
582 /* flags */
584
585 /* properties */
586 RNA_def_boolean(ot->srna, "use_boundary", true, "Boundary", "Inset face boundaries");
588 "use_even_offset",
589 true,
590 "Offset Even",
591 "Scale the offset to give more even thickness");
593 "use_relative_offset",
594 false,
595 "Offset Relative",
596 "Scale the offset by surrounding geometry");
598 ot->srna, "use_edge_rail", false, "Edge Rail", "Inset the region along existing edges");
599
601 ot->srna, "thickness", 0.0f, 0.0f, 1e12f, "Thickness", "", 0.0f, 10.0f);
602 /* use 1 rather than 10 for max else dragging the button moves too far */
603 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
604
606 ot->srna, "depth", 0.0f, -1e12f, 1e12f, "Depth", "", -10.0f, 10.0f);
607 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.01, 4);
608
609 RNA_def_boolean(ot->srna, "use_outset", false, "Outset", "Outset rather than inset");
611 ot->srna, "use_select_inset", false, "Select Outer", "Select the new inset faces");
612 RNA_def_boolean(ot->srna, "use_individual", false, "Individual", "Individual face inset");
614 ot->srna, "use_interpolate", true, "Interpolate", "Blend face data across the inset");
615
616 prop = RNA_def_boolean(ot->srna, "release_confirm", false, "Confirm on Release", "");
618}
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Definition editmesh.cc:63
@ G_TRANSFORM_EDIT
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
@ B_UNIT_LENGTH
Definition BKE_unit.hh:107
size_t BKE_unit_value_as_string(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings *settings, bool pad)
Definition unit.cc:1876
MINLINE float max_ff(float a, float b)
float mat4_to_scale(const float mat[4][4])
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
unsigned int uint
#define IFACE_(msgid)
Object is a sort of wrapper for general info.
@ V3D_AROUND_CENTER_MEDIAN
@ OPERATOR_RUNNING_MODAL
void EDBM_flag_disable_all(BMEditMesh *em, char hflag)
void void EDBM_redo_state_restore_and_free(BMBackup *backup, BMEditMesh *em, bool recalc_looptris) ATTR_NONNULL(1
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
void void void EDBM_redo_state_free(BMBackup *backup) ATTR_NONNULL(1)
BMBackup EDBM_redo_state_store(BMEditMesh *em)
void EDBM_redo_state_restore(BMBackup *backup, BMEditMesh *em, bool recalc_looptris) ATTR_NONNULL(1
void initNumInput(NumInput *n)
Definition numinput.cc:70
#define NUM_STR_REP_LEN
void outputNumInput(NumInput *n, char *str, const UnitSettings *unit_settings)
Definition numinput.cc:88
bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
Definition numinput.cc:312
bool applyNumInput(NumInput *n, float *vec)
Definition numinput.cc:190
bool hasNumInput(const NumInput *n)
Definition numinput.cc:171
void ED_area_status_text(ScrArea *area, const char *str)
Definition area.cc:803
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:966
bool ED_operator_editmesh(bContext *C)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:634
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)
#define REGION_DRAW_POST_PIXEL
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2])
void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info)
Definition ed_draw.cc:626
float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3])
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ PROP_HIDDEN
Definition RNA_types.hh:239
#define UI_MAX_DRAW_STR
@ OPTYPE_BLOCKING
Definition WM_types.hh:164
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_GRAB_CURSOR_XY
Definition WM_types.hh:168
@ OPTYPE_REGISTER
Definition WM_types.hh:160
@ KM_PRESS
Definition WM_types.hh:284
@ KM_RELEASE
Definition WM_types.hh:285
@ BM_ELEM_HIDDEN
@ BM_ELEM_SELECT
#define BM_FACE
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.
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)
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
Definition area.cc:924
void item(std::string text, int icon1, int icon2=0)
Definition area.cc:908
static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
static int edbm_inset_exec(bContext *C, wmOperator *op)
static void edbm_inset_cancel(bContext *C, wmOperator *op)
static void edbm_inset_exit(bContext *C, wmOperator *op)
void MESH_OT_inset(wmOperatorType *ot)
static void edbm_inset_update_header(wmOperator *op, bContext *C)
static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool edbm_inset_calc(wmOperator *op)
bool EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt,...)
bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool do_report)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
Definition mallocn.cc:45
#define G(x, y, z)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
int totvertsel
float initial_length
float shift_amount
float mcenter[2]
float old_thickness
NumInput num_input
float max_obj_scale
InsetObjectStore * ob_store
void * draw_handle_pixel
short idx_max
int unit_type[NUM_MAX_ELEMENTS]
struct UnitSettings unit
short val
Definition WM_types.hh:724
short type
Definition WM_types.hh:722
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1036
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
StructRNA * srna
Definition WM_types.hh:1080
void(* cancel)(bContext *C, wmOperator *op)
Definition WM_types.hh:1028
struct PointerRNA * ptr
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
@ RIGHTMOUSE
@ EVT_OKEY
@ EVT_RIGHTCTRLKEY
@ EVT_IKEY
@ EVT_LEFTCTRLKEY
@ EVT_PADENTER
@ MOUSEMOVE
@ LEFTMOUSE
@ EVT_ESCKEY
@ EVT_RIGHTSHIFTKEY
@ EVT_LEFTSHIFTKEY
@ EVT_BKEY
@ EVT_RETKEY
wmOperatorType * ot
Definition wm_files.cc:4125