88 const int precision = opdata->
shift ? 6 : 4;
107 IFACE_(
"Thickness: %s, Depth: %s"),
114 status.
item(
IFACE_(
"Confirm"), ICON_EVENT_RETURN, ICON_MOUSE_LMB);
115 status.
item(
IFACE_(
"Cancel"), ICON_EVENT_ESC, ICON_MOUSE_RMB);
136 uint objects_used_len = 0;
144 for (
uint ob_index = 0; ob_index < objects.
size(); ob_index++) {
145 Object *obedit = objects[ob_index];
150 opdata->
ob_store[objects_used_len].
ob = obedit;
160 opdata->
shift =
false;
242 bool changed =
false;
267 if (use_individual) {
271 "inset_individual faces=%hf use_even_offset=%b use_relative_offset=%b "
272 "use_interpolate=%b thickness=%f depth=%f",
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",
304 if (use_select_inset) {
366 mlen[0] = opdata->
mcenter[0] -
event->mval[0];
367 mlen[1] = opdata->
mcenter[1] -
event->mval[1];
388 amounts[0] =
max_ff(amounts[0], 0.0f);
407 bool handled =
false;
408 switch (event->
type) {
419 mdiff[0] = opdata->
mcenter[0] -
event->mval[0];
420 mdiff[1] = opdata->
mcenter[1] -
event->mval[1];
442 amount =
max_ff(amount, 0.0f);
477 opdata->
shift =
true;
482 opdata->
shift =
false;
491 mlen[0] = opdata->
mcenter[0] -
event->mval[0];
492 mlen[1] = opdata->
mcenter[1] -
event->mval[1];
566 amounts[0] =
max_ff(amounts[0], 0.0f);
586 ot->
name =
"Inset Faces";
587 ot->
idname =
"MESH_OT_inset";
588 ot->
description =
"Inset new faces into selected faces";
606 "Scale the offset to give more even thickness");
608 "use_relative_offset",
611 "Scale the offset by surrounding geometry");
613 ot->
srna,
"use_edge_rail",
false,
"Edge Rail",
"Inset the region along existing edges");
616 ot->
srna,
"thickness", 0.0f, 0.0f, 1e12f,
"Thickness",
"", 0.0f, 10.0f);
621 ot->
srna,
"depth", 0.0f, -1e12f, 1e12f,
"Depth",
"", -10.0f, 10.0f);
626 ot->
srna,
"use_select_inset",
false,
"Select Outer",
"Select the new inset faces");
629 ot->
srna,
"use_interpolate",
true,
"Interpolate",
"Blend face data across the inset");
#define SNPRINTF_UTF8(dst, format,...)
Object is a sort of wrapper for general info.
#define REGION_DRAW_POST_PIXEL
Read Blender memory allocation and freeing.
void item(std::string text, int icon1, int icon2=0)
void item_bool(std::string text, bool inverted, int icon1, int icon2=0)
float3x3 scale(float3x3 mat, float2 scale)
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)
static void edbm_inset_cancel(bContext *C, wmOperator *op)
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)
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)
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)
ViewLayer * CTX_data_view_layer(const bContext *C)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
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)
void ED_area_status_text(ScrArea *area, const char *str)
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)
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)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
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)
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)
Scene * CTX_data_scene(const bContext *C)
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)
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)
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)
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
struct ARegionType * type
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
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