108 em, &bmop, op,
"extrude_discrete_faces faces=%hf use_select_history=%b", hflag,
true);
134 const bool use_normal_flip)
142 "extrude_edge_only edges=%he use_normal_flip=%b use_select_history=%b",
168 EDBM_op_init(em, &bmop, op,
"extrude_vert_indiv verts=%hv use_select_history=%b", hflag,
true);
211 const bool use_normal_flip,
212 const bool use_dissolve_ortho_edges,
213 const bool use_mirror,
214 const bool use_select_history)
285 uint objects_len = 0;
289 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
290 float offset_local[3], tmat[3][3];
292 Object *obedit = objects[ob_index];
307 .calc_looptri = true,
308 .calc_normals = true,
309 .is_destructive = true,
321 ot->
name =
"Extrude Repeat";
322 ot->
description =
"Extrude selected vertices, edges or faces repeatedly";
323 ot->
idname =
"MESH_OT_extrude_repeat";
335 ot->
srna,
"offset", 3,
NULL, -100000, 100000,
"Offset",
"Offset vector", -1000.0f, 1000.0f);
337 RNA_def_float(
ot->
srna,
"scale_offset", 1.0f, 0.0f, 1e12f,
"Scale Offset",
"", 0.0f, 100.0f);
350 const bool use_dissolve_ortho_edges =
RNA_boolean_get(op->
ptr,
"use_dissolve_ortho_edges");
352 enum { NONE = 0, ELEM_FLAG, VERT_ONLY, EDGE_ONLY } nr;
353 bool changed =
false;
398 use_dissolve_ortho_edges,
422 uint objects_len = 0;
426 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
427 Object *obedit = objects[ob_index];
440 .calc_looptri = true,
441 .calc_normals = true,
442 .is_destructive = true,
452 ot->
name =
"Extrude Region";
453 ot->
idname =
"MESH_OT_extrude_region";
481 uint objects_len = 0;
485 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
486 Object *obedit = objects[ob_index];
498 .calc_looptri = true,
499 .calc_normals = true,
500 .is_destructive = true,
510 ot->
name =
"Extrude Context";
511 ot->
idname =
"MESH_OT_extrude_context";
535 uint objects_len = 0;
539 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
540 Object *obedit = objects[ob_index];
550 .calc_looptri = true,
551 .calc_normals = false,
552 .is_destructive = true,
563 ot->
name =
"Extrude Only Vertices";
564 ot->
idname =
"MESH_OT_extrude_verts_indiv";
588 uint objects_len = 0;
592 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
593 Object *obedit = objects[ob_index];
603 .calc_looptri = true,
604 .calc_normals = false,
605 .is_destructive = true,
616 ot->
name =
"Extrude Only Edges";
617 ot->
idname =
"MESH_OT_extrude_edges_indiv";
641 uint objects_len = 0;
645 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
646 Object *obedit = objects[ob_index];
656 .calc_looptri = true,
657 .calc_normals = false,
658 .is_destructive = true,
669 ot->
name =
"Extrude Individual Faces";
670 ot->
idname =
"MESH_OT_extrude_faces_indiv";
711 uint objects_len = 0;
714 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
715 Object *obedit = objects[ob_index];
723 float local_center[3];
732 mul_v3_fl(local_center, 1.0f / (
float)local_verts_len);
734 mul_v3_fl(local_center, (
float)local_verts_len);
737 verts_len += local_verts_len;
740 if (verts_len != 0) {
745 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
746 Object *obedit = objects[ob_index];
749 if (verts_len != 0) {
754 else if (obedit != object_active) {
761 float local_center[3];
765 if (verts_len != 0) {
769 float vec[3], ofs[3];
770 float nor[3] = {0.0, 0.0, 0.0};
773 const float mval_f[2] = {(
float)event->
mval[0], (
float)
event->mval[1]};
779 float co1[2], co2[2];
791 nor[0] += (co1[1] - co2[1]);
792 nor[1] += -(co1[0] - co2[0]);
795 nor[0] += (co2[1] - co1[1]);
796 nor[1] += -(co2[0] - co1[0]);
804 float view_vec[3],
cross[3];
851 vc.
em, op,
"rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, local_center, mat);
861 vc.
em, op,
"rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, local_center, mat);
875 EDBM_op_init(vc.
em, &bmop, op,
"create_vert co=%v", local_center);
895 .calc_looptri = true,
896 .calc_normals = true,
897 .is_destructive = true,
913 ot->
name =
"Extrude to Cursor or Add";
914 ot->
idname =
"MESH_OT_dupli_extrude_cursor";
916 "Duplicate and extrude selected vertices, edges or faces towards the mouse cursor";
929 "Rotate initial selection giving better shape");
typedef float(TangentPoint)[2]
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(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)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m3(float m[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
bool invert_m3(float R[3][3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void mul_v3_mat3_m4v3(float r[3], const float M[4][4], const float v[3])
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
struct Depsgraph Depsgraph
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
@ SCE_SNAP_MODE_FACE_RAYCAST
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
void EDBM_project_snap_verts(struct bContext *C, struct Depsgraph *depsgraph, struct ARegion *region, struct Object *obedit, struct BMEditMesh *em)
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
void EDBM_flag_disable_all(struct BMEditMesh *em, char hflag)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
bool ED_operator_editmesh(struct bContext *C)
void ED_view3d_win_to_3d_int(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
@ OPTYPE_DEPENDS_ON_CURSOR
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
#define BM_SELECT_HISTORY_BACKUP(bm)
#define BM_SELECT_HISTORY_RESTORE(bm)
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_hflag_disable(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 BMO_op_init(BMesh *bm, BMOperator *op, int flag, const char *opname)
BMESH OPSTACK INIT OP.
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
void BMO_op_finish(BMesh *bm, BMOperator *op)
BMESH OPSTACK FINISH OP.
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
#define BMO_FLAG_DEFAULTS
void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, bool i)
BLI_INLINE void BMO_slot_map_empty_insert(BMOperator *op, BMOpSlot *slot, const void *element)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot)
static int edbm_extrude_context_exec(bContext *C, wmOperator *op)
static int edbm_extrude_region_exec(bContext *C, wmOperator *op)
bool edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag, const bool use_normal_flip)
static bool edbm_extrude_discrete_faces(BMEditMesh *em, wmOperator *op, const char hflag)
static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void MESH_OT_extrude_context(wmOperatorType *ot)
static int edbm_extrude_faces_exec(bContext *C, wmOperator *op)
static bool edbm_extrude_verts_indiv(BMEditMesh *em, wmOperator *op, const char hflag)
static bool edbm_extrude_mesh(Object *obedit, BMEditMesh *em, wmOperator *op)
static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
static char edbm_extrude_htype_from_em_select(BMEditMesh *em)
static int edbm_extrude_edges_exec(bContext *C, wmOperator *op)
static int edbm_extrude_verts_exec(bContext *C, wmOperator *op)
static bool edbm_extrude_ex(Object *obedit, BMEditMesh *em, char htype, const char hflag, const bool use_normal_flip, const bool use_dissolve_ortho_edges, const bool use_mirror, const bool use_select_history)
void MESH_OT_extrude_region(wmOperatorType *ot)
void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
static void edbm_extrude_edge_exclude_mirror(Object *obedit, BMEditMesh *em, const char hflag, BMOperator *op, BMOpSlot *slot_edges_exclude)
void MESH_OT_extrude_repeat(wmOperatorType *ot)
void MESH_OT_extrude_verts_indiv(wmOperatorType *ot)
bool EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt,...)
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)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, int len, const 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)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
struct Object * mirror_ob
struct ModifierData * next
struct ToolSettings * toolsettings
struct ViewLayer * view_layer
struct RegionView3D * rv3d
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_flag_only_pass_through_on_press(int retval, const struct wmEvent *event)