47 #define MESH_ADD_VERTS_MAXI 10000000
91 const bool exit_editmode = ((creation_data->
was_editmode ==
true) && (enter_editmode ==
false));
112 float loc[3],
rot[3];
119 C, op,
'Z', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL);
139 "create_grid x_segments=%i y_segments=%i size=%f matrix=%m4 calc_uvs=%b",
157 ot->
description =
"Construct a filled planar mesh with 4 vertices";
158 ot->
idname =
"MESH_OT_primitive_plane_add";
177 float loc[3],
rot[3], scale[3];
184 C, op,
'Z', loc,
rot, scale, &enter_editmode, &local_view_bits,
NULL);
203 "create_cube matrix=%m4 size=%f calc_uvs=%b",
221 ot->
idname =
"MESH_OT_primitive_cube_add";
236 {0,
"NOTHING", 0,
"Nothing",
"Don't fill at all"},
237 {1,
"NGON", 0,
"N-Gon",
"Use n-gons"},
238 {2,
"TRIFAN", 0,
"Triangle Fan",
"Use triangle fans"},
247 float loc[3],
rot[3];
250 int cap_end, cap_tri;
254 cap_tri = (cap_end == 2);
258 C, op,
'Z', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL);
278 "create_circle segments=%i radius=%f cap_ends=%b cap_tris=%b matrix=%m4 calc_uvs=%b",
298 ot->
idname =
"MESH_OT_primitive_circle_add";
321 float loc[3],
rot[3], scale[3];
325 const bool cap_end = (end_fill_type != 0);
326 const bool cap_tri = (end_fill_type == 2);
331 C, op,
'Z', loc,
rot, scale, &enter_editmode, &local_view_bits,
NULL);
349 "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b "
350 "cap_tris=%b depth=%f matrix=%m4 calc_uvs=%b",
370 ot->
name =
"Add Cylinder";
372 ot->
idname =
"MESH_OT_primitive_cylinder_add";
397 float loc[3],
rot[3], scale[3];
401 const bool cap_end = (end_fill_type != 0);
402 const bool cap_tri = (end_fill_type == 2);
407 C, op,
'Z', loc,
rot, scale, &enter_editmode, &local_view_bits,
NULL);
425 "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b "
426 "cap_tris=%b depth=%f matrix=%m4 calc_uvs=%b",
448 ot->
idname =
"MESH_OT_primitive_cone_add";
476 float loc[3],
rot[3];
483 C, op,
'Z', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL);
502 "create_grid x_segments=%i y_segments=%i size=%f matrix=%m4 calc_uvs=%b",
521 ot->
idname =
"MESH_OT_primitive_grid_add";
548 float loc[3],
rot[3];
556 C, op,
'Y', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL);
578 "create_monkey matrix=%m4 calc_uvs=%b",
594 ot->
idname =
"MESH_OT_primitive_monkey_add";
614 float loc[3],
rot[3], scale[3];
621 C, op,
'Z', loc,
rot, scale, &enter_editmode, &local_view_bits,
NULL);
640 "create_uvsphere u_segments=%i v_segments=%i diameter=%f matrix=%m4 calc_uvs=%b",
657 ot->
name =
"Add UV Sphere";
659 ot->
idname =
"MESH_OT_primitive_uv_sphere_add";
682 float loc[3],
rot[3], scale[3];
689 C, op,
'Z', loc,
rot, scale, &enter_editmode, &local_view_bits,
NULL);
708 "create_icosphere subdivisions=%i diameter=%f matrix=%m4 calc_uvs=%b",
724 ot->
name =
"Add Ico Sphere";
726 ot->
idname =
"MESH_OT_primitive_ico_sphere_add";
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
void mul_mat3_m4_fl(float R[4][4], float f)
void rescale_m4(float mat[4][4], const float scale[3])
#define CTX_DATA_(context, msgid)
#define BLT_I18NCONTEXT_ID_MESH
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, const short selectmode)
void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name)
void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive)
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *obedit, const float loc[3], const float rot[3], float primmat[4][4])
void ED_object_add_unit_props_size(struct wmOperatorType *ot)
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
#define OBJECT_ADD_SIZE_MAXF
bool ED_object_editmode_enter_ex(struct Main *bmain, struct Scene *scene, struct Object *ob, int flag)
struct Object * ED_object_add_type(struct bContext *C, const int type, const char *name, const float loc[3], const float rot[3], const bool enter_editmode, const unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode)
bool ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, const char view_align_axis, float loc[3], float rot[3], float scale[3], bool *enter_editmode, unsigned short *local_view_bits, bool *is_view_aligned)
void ED_object_add_mesh_props(struct wmOperatorType *ot)
void ED_object_add_unit_props_radius(struct wmOperatorType *ot)
bool ED_operator_scene_editable(struct bContext *C)
void MESH_OT_primitive_plane_add(wmOperatorType *ot)
static int add_primitive_circle_exec(bContext *C, wmOperator *op)
static int add_primitive_plane_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
static int add_primitive_grid_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem fill_type_items[]
static int add_primitive_cone_exec(bContext *C, wmOperator *op)
static Object * make_prim_init(bContext *C, const char *idname, const float loc[3], const float rot[3], const float scale[3], ushort local_view_bits, MakePrimitiveData *r_creation_data)
#define MESH_ADD_VERTS_MAXI
static int add_primitive_cube_exec(bContext *C, wmOperator *op)
static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_cone_add(wmOperatorType *ot)
void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
static void make_prim_finish(bContext *C, Object *obedit, const MakePrimitiveData *creation_data, int enter_editmode)
void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
void MESH_OT_primitive_cube_add(wmOperatorType *ot)
static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
struct MakePrimitiveData MakePrimitiveData
void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_grid_add(wmOperatorType *ot)
static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_circle_add(wmOperatorType *ot)
bool EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const bool select_extend, const char *fmt,...)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_view3d_unit_defaults(struct bContext *C, struct wmOperator *op)