72 "Confirm: Enter/LClick, Cancel: (Esc/RClick), Thickness: %s, "
73 "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s), Individual (I): "
128 uint objects_used_len = 0;
133 uint ob_store_len = 0;
137 for (
uint ob_index = 0; ob_index < ob_store_len; ob_index++) {
138 Object *obedit = objects[ob_index];
143 opdata->
ob_store[objects_used_len].
ob = obedit;
154 opdata->
shift =
false;
217 .calc_looptri = false,
218 .calc_normals = false,
219 .is_destructive = true,
234 bool changed =
false;
258 if (use_individual) {
262 "inset_individual faces=%hf use_even_offset=%b use_relative_offset=%b "
263 "use_interpolate=%b thickness=%f depth=%f",
276 "inset_region faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b "
277 "use_interpolate=%b thickness=%f depth=%f use_outset=%b use_edge_rail=%b",
295 if (use_select_inset) {
312 .calc_looptri = true,
313 .calc_normals = false,
314 .is_destructive = true,
357 mlen[0] = opdata->
mcenter[0] -
event->mval[0];
358 mlen[1] = opdata->
mcenter[1] -
event->mval[1];
379 amounts[0] =
max_ff(amounts[0], 0.0f);
397 bool handled =
false;
398 switch (event->
type) {
409 mdiff[0] = opdata->
mcenter[0] -
event->mval[0];
410 mdiff[1] = opdata->
mcenter[1] -
event->mval[1];
432 amount =
max_ff(amount, 0.0f);
466 opdata->
shift =
true;
471 opdata->
shift =
false;
480 mlen[0] = opdata->
mcenter[0] -
event->mval[0];
481 mlen[1] = opdata->
mcenter[1] -
event->mval[1];
552 amounts[0] =
max_ff(amounts[0], 0.0f);
592 "Scale the offset to give more even thickness");
594 "use_relative_offset",
597 "Scale the offset by surrounding geometry");
599 ot->
srna,
"use_edge_rail",
false,
"Edge Rail",
"Inset the region along existing edges");
602 ot->
srna,
"thickness", 0.0f, 0.0f, 1e12f,
"Thickness",
"", 0.0f, 10.0f);
607 ot->
srna,
"depth", 0.0f, -1e12f, 1e12f,
"Depth",
"", -10.0f, 10.0f);
612 ot->
srna,
"use_select_inset",
false,
"Select Outer",
"Select the new inset faces");
615 ot->
srna,
"use_interpolate",
true,
"Interpolate",
"Blend face data across the inset");
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
size_t BKE_unit_value_as_string(char *str, int len_max, double value, int prec, int type, const struct UnitSettings *settings, bool pad)
MINLINE float max_ff(float a, float b)
float mat4_to_scale(const float M[4][4])
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
Object is a sort of wrapper for general info.
@ V3D_AROUND_CENTER_MEDIAN
void void EDBM_redo_state_restore_and_free(struct BMBackup *backup, struct BMEditMesh *em, bool recalc_looptri) ATTR_NONNULL(1
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
void EDBM_redo_state_restore(struct BMBackup *backup, struct BMEditMesh *em, bool recalc_looptri) ATTR_NONNULL(1
struct BMBackup EDBM_redo_state_store(struct BMEditMesh *em)
void EDBM_flag_disable_all(struct BMEditMesh *em, char hflag)
void void void EDBM_redo_state_free(struct BMBackup *backup) ATTR_NONNULL(1)
void ED_area_status_text(ScrArea *area, const char *str)
void ED_region_tag_redraw(struct ARegion *region)
bool ED_operator_editmesh(struct bContext *C)
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_PIXEL
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
void ED_region_draw_mouse_line_cb(const struct bContext *C, struct ARegion *region, void *arg_info)
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3])
Read Guarded memory(de)allocation.
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.
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)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
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_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
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 ARegionType * type
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
InsetObjectStore * ob_store
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
const char * WM_bool_as_string(bool test)