118 static int xzproj = 0;
125 float vec[3], zvec[3] = {0.0f, 0.0f, 1.0f};
126 float umat[4][4], viewmat[4][4];
129 const float grid = 1.0f;
147 nu->resolu = cu->resolu;
148 nu->resolv = cu->resolv;
153 nu->resolu = cu->resolu;
159 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
162 bezt->vec[1][0] += -grid;
163 bezt->vec[0][0] += -1.5f * grid;
164 bezt->vec[0][1] += -0.5f * grid;
165 bezt->vec[2][0] += -0.5f * grid;
166 bezt->vec[2][1] += 0.5f * grid;
167 for (
a = 0;
a < 3;
a++) {
173 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
174 bezt->radius = bezt->weight = 1.0;
178 bezt->vec[1][0] = grid;
180 bezt->vec[2][0] = grid * 2;
182 for (
a = 0;
a < 3;
a++) {
196 for (
a = 0;
a < 4;
a++, bp++) {
199 bp->radius = bp->weight = 1.0;
203 bp->vec[0] += -1.5f * grid;
211 bp->vec[0] += 1.5f * grid;
214 for (
a = 0;
a < 4;
a++, bp++) {
229 nu->resolu = cu->resolu;
233 for (
a = 0;
a < 5;
a++, bp++) {
236 bp->radius = bp->weight = 1.0;
240 bp->vec[0] += -2.0f * grid;
247 bp->vec[0] += 2.0f * grid;
250 for (
a = 0;
a < 5;
a++, bp++) {
261 nu->resolu = cu->resolu;
270 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
271 bezt->vec[1][0] += -grid;
272 for (
a = 0;
a < 3;
a++) {
275 bezt->radius = bezt->weight = 1.0;
279 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
280 bezt->vec[1][1] += grid;
281 for (
a = 0;
a < 3;
a++) {
284 bezt->radius = bezt->weight = 1.0;
288 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
289 bezt->vec[1][0] += grid;
290 for (
a = 0;
a < 3;
a++) {
293 bezt->radius = bezt->weight = 1.0;
297 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
298 bezt->vec[1][1] += -grid;
299 for (
a = 0;
a < 3;
a++) {
302 bezt->radius = bezt->weight = 1.0;
314 for (
a = 0;
a < 8;
a++) {
321 bp->vec[0] += 0.25f *
nurbcircle[
a][0] * grid - 0.75f * grid;
331 bp->radius = bp->weight = 1.0;
352 for (
a = 0;
a < 4;
a++) {
353 for (b = 0; b < 4; b++) {
356 bp->vec[0] += fac * grid;
357 fac = (
float)b - 1.5f;
358 bp->vec[1] += fac * grid;
359 if ((
a == 1 ||
a == 2) && (b == 1 || b == 2)) {
375 nu->resolu = cu->resolu;
378 vec[0] = vec[1] = 0.0;
390 a = nu->pntsu * nu->pntsv;
400 const float tmp_cent[3] = {0.0f, 0.0f, 0.0f};
401 const float tmp_vec[3] = {0.0f, 0.0f, 1.0f};
406 nu->resolu = cu->resolu;
407 nu->resolv = cu->resolv;
413 for (
a = 0;
a < 5;
a++) {
443 a = nu->pntsu * nu->pntsv;
454 const float tmp_cent[3] = {0.0f, 0.0f, 0.0f};
455 const float tmp_vec[3] = {0.0f, 0.0f, 1.0f};
460 nu->resolu = cu->resolu;
461 nu->resolv = cu->resolv;
478 a = nu->pntsu * nu->pntsv;
519 float loc[3],
rot[3];
525 C, op,
'Z', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL)) {
568 if (newob && !enter_editmode) {
599 ot->
idname =
"CURVE_OT_primitive_bezier_curve_add";
620 ot->
name =
"Add Bezier Circle";
622 ot->
idname =
"CURVE_OT_primitive_bezier_circle_add";
643 ot->
name =
"Add Nurbs Curve";
645 ot->
idname =
"CURVE_OT_primitive_nurbs_curve_add";
666 ot->
name =
"Add Nurbs Circle";
668 ot->
idname =
"CURVE_OT_primitive_nurbs_circle_add";
691 ot->
idname =
"CURVE_OT_primitive_nurbs_path_add";
713 ot->
name =
"Add Surface Curve";
715 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_curve_add";
736 ot->
name =
"Add Surface Circle";
738 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_circle_add";
759 ot->
name =
"Add Surface Patch";
761 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_surface_add";
782 ot->
name =
"Add Surface Cylinder";
784 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_cylinder_add";
805 ot->
name =
"Add Surface Sphere";
807 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_sphere_add";
828 ot->
name =
"Add Surface Torus";
830 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_torus_add";
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void BKE_nurb_handles_calc(struct Nurb *nu)
void BKE_nurb_knot_calc_v(struct Nurb *nu)
void BKE_nurb_project_2d(struct Nurb *nu)
void BKE_nurb_knot_calc_u(struct Nurb *nu)
void BKE_nurbList_flag_set(ListBase *editnurb, uint8_t flag, bool set)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void mul_mat3_m4_fl(float R[4][4], float f)
void unit_m4(float m[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define BLT_I18NCONTEXT_ID_CURVE
#define CTX_DATA_(context, msgid)
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *obedit, const float loc[3], const float rot[3], float primmat[4][4])
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, 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_unit_props_radius(struct wmOperatorType *ot)
bool ED_operator_scene_editable(struct bContext *C)
struct RegionView3D * ED_view3d_context_rv3d(struct bContext *C)
_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 type
Read Guarded memory(de)allocation.
bool ed_editnurb_extrude_flag(struct EditNurb *editnurb, const uint8_t flag)
bool ed_editnurb_spin(float viewmat[4][4], struct View3D *v3d, struct Object *obedit, const float axis[3], const float cent[3])
void ed_editnurb_translate_flag(struct ListBase *editnurb, uint8_t flag, const float vec[3], bool is_2d)
ListBase * object_editcurve_get(Object *ob)
static int add_primitive_nurbs_surface_sphere_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
void SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot)
static int add_primitive_bezier_exec(bContext *C, wmOperator *op)
static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op)
static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot)
static int add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op)
static int add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op)
static int add_primitive_nurbs_surface_cylinder_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot)
void SURFACE_OT_primitive_nurbs_surface_torus_add(wmOperatorType *ot)
static int add_primitive_curve_path_exec(bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot)
static int add_primitive_nurbs_surface_curve_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot)
static const char * get_curve_defname(int type)
void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot)
static int curve_prim_add(bContext *C, wmOperator *op, int type)
static const char * get_surf_defname(int type)
void SURFACE_OT_primitive_nurbs_surface_cylinder_add(wmOperatorType *ot)
static int surf_prim_add(bContext *C, wmOperator *op, int type)
static int add_primitive_nurbs_surface_torus_exec(bContext *C, wmOperator *op)
static int add_primitive_nurbs_surface_surface_exec(bContext *C, wmOperator *op)
Nurb * ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], int type, int newob)
void SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot)
static const float nurbcircle[8][2]
static int add_primitive_nurbs_surface_circle_exec(bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot)
void *(* MEM_callocN)(size_t len, const char *str)
float RNA_float_get(PointerRNA *ptr, const char *name)
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)