124 em, &bmop, op,
"extrude_discrete_faces faces=%hf use_select_history=%b", hflag,
true);
151 const bool use_normal_flip)
159 "extrude_edge_only edges=%he use_normal_flip=%b use_select_history=%b",
185 EDBM_op_init(em, &bmop, op,
"extrude_vert_indiv verts=%hv use_select_history=%b", hflag,
true);
228 const bool use_normal_flip,
229 const bool use_dissolve_ortho_edges,
230 const bool use_mirror,
231 const bool use_select_history)
291 copy_v3_v3(offset, (
const float[3]){0, 0, 1});
302 uint objects_len = 0;
306 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
307 float offset_local[3], tmat[3][3];
309 Object *obedit = objects[ob_index];
335 ot->
name =
"Extrude Repeat";
336 ot->
description =
"Extrude selected vertices, edges or faces repeatedly";
337 ot->
idname =
"MESH_OT_extrude_repeat";
349 ot->
srna,
"offset", 3,
NULL, -100000, 100000,
"Offset",
"Offset vector", -1000.0f, 1000.0f);
351 RNA_def_float(
ot->
srna,
"scale_offset", 1.0f, 0.0f, 1e12f,
"Scale Offset",
"", 0.0f, 100.0f);
364 const bool use_dissolve_ortho_edges =
RNA_boolean_get(op->
ptr,
"use_dissolve_ortho_edges");
366 enum { NONE = 0, ELEM_FLAG, VERT_ONLY, EDGE_ONLY } nr;
367 bool changed =
false;
412 use_dissolve_ortho_edges,
436 uint objects_len = 0;
440 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
441 Object *obedit = objects[ob_index];
464 ot->
name =
"Extrude Region";
465 ot->
idname =
"MESH_OT_extrude_region";
493 uint objects_len = 0;
497 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
498 Object *obedit = objects[ob_index];
520 ot->
name =
"Extrude Context";
521 ot->
idname =
"MESH_OT_extrude_context";
545 uint objects_len = 0;
549 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
550 Object *obedit = objects[ob_index];
568 ot->
name =
"Extrude Only Vertices";
569 ot->
idname =
"MESH_OT_extrude_verts_indiv";
593 uint objects_len = 0;
597 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
598 Object *obedit = objects[ob_index];
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];
664 ot->
name =
"Extrude Individual Faces";
665 ot->
idname =
"MESH_OT_extrude_faces_indiv";
706 uint objects_len = 0;
709 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
710 Object *obedit = objects[ob_index];
718 float local_center[3];
727 mul_v3_fl(local_center, 1.0f / (
float)local_verts_len);
729 mul_v3_fl(local_center, (
float)local_verts_len);
732 verts_len += local_verts_len;
735 if (verts_len != 0) {
740 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
741 Object *obedit = objects[ob_index];
744 if (verts_len != 0) {
749 else if (obedit != object_active) {
756 float local_center[3];
760 if (verts_len != 0) {
764 float vec[3], ofs[3];
765 float nor[3] = {0.0, 0.0, 0.0};
768 const float mval_f[2] = {(
float)event->
mval[0], (
float)
event->mval[1]};
774 float co1[2], co2[2];
786 nor[0] += (co1[1] - co2[1]);
787 nor[1] += -(co1[0] - co2[0]);
790 nor[0] += (co2[1] - co1[1]);
791 nor[1] += -(co2[0] - co1[0]);
799 float view_vec[3],
cross[3];
846 vc.
em, op,
"rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, local_center, mat);
856 vc.
em, op,
"rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, local_center, mat);
870 EDBM_op_init(vc.
em, &bmop, op,
"create_vert co=%v", local_center);
904 ot->
name =
"Duplicate or Extrude to Cursor";
905 ot->
idname =
"MESH_OT_dupli_extrude_cursor";
907 "Duplicate and extrude selected vertices, edges or faces towards the mouse cursor";
920 "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, ReportType 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], const 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_SNAP_MODE_FACE
#define SCE_SELECT_VERTEX
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_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive)
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag)
void EDBM_mesh_normals_update(struct BMEditMesh *em)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
bool ED_operator_editmesh(struct bContext *C)
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
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])
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
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.
#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, const char htype, const char hflag, const bool do_flush)
BMO_FLAG_BUFFER.
void BMO_slot_bool_set(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const bool i)
void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag)
void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name, const char htype, const char hflag, const bool do_flush)
BMO_FLAG_BUFFER.
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
void BMO_op_finish(BMesh *bm, BMOperator *op)
BMESH OPSTACK FINISH OP.
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
#define BMO_FLAG_DEFAULTS
void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname)
BMESH OPSTACK INIT OP.
bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt,...)
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)
void(* MEM_freeN)(void *vmemh)
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
__forceinline avxf cross(const avxf &a, const avxf &b)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)