104 static int xzproj = 0;
111 float vec[3], zvec[3] = {0.0f, 0.0f, 1.0f};
112 float umat[4][4], viewmat[4][4];
115 const float grid = 1.0f;
133 nu->resolu = cu->resolu;
134 nu->resolv = cu->resolv;
139 nu->resolu = cu->resolu;
145 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
148 bezt->vec[1][0] += -grid;
149 bezt->vec[0][0] += -1.5f * grid;
150 bezt->vec[0][1] += -0.5f * grid;
151 bezt->vec[2][0] += -0.5f * grid;
152 bezt->vec[2][1] += 0.5f * grid;
153 for (
a = 0;
a < 3;
a++) {
159 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
160 bezt->radius = bezt->weight = 1.0;
164 bezt->vec[1][0] = grid;
166 bezt->vec[2][0] = grid * 2;
168 for (
a = 0;
a < 3;
a++) {
182 for (
a = 0;
a < 4;
a++, bp++) {
185 bp->radius = bp->weight = 1.0;
189 bp->vec[0] += -1.5f * grid;
197 bp->vec[0] += 1.5f * grid;
200 for (
a = 0;
a < 4;
a++, bp++) {
215 nu->resolu = cu->resolu;
219 for (
a = 0;
a < 5;
a++, bp++) {
222 bp->radius = bp->weight = 1.0;
226 bp->vec[0] += -2.0f * grid;
233 bp->vec[0] += 2.0f * grid;
236 for (
a = 0;
a < 5;
a++, bp++) {
247 nu->resolu = cu->resolu;
256 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
257 bezt->vec[1][0] += -grid;
258 for (
a = 0;
a < 3;
a++) {
261 bezt->radius = bezt->weight = 1.0;
265 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
266 bezt->vec[1][1] += grid;
267 for (
a = 0;
a < 3;
a++) {
270 bezt->radius = bezt->weight = 1.0;
274 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
275 bezt->vec[1][0] += grid;
276 for (
a = 0;
a < 3;
a++) {
279 bezt->radius = bezt->weight = 1.0;
283 bezt->f1 = bezt->f2 = bezt->f3 =
SELECT;
284 bezt->vec[1][1] += -grid;
285 for (
a = 0;
a < 3;
a++) {
288 bezt->radius = bezt->weight = 1.0;
300 for (
a = 0;
a < 8;
a++) {
307 bp->vec[0] += 0.25f *
nurbcircle[
a][0] * grid - 0.75f * grid;
317 bp->radius = bp->weight = 1.0;
338 for (
a = 0;
a < 4;
a++) {
339 for (
b = 0;
b < 4;
b++) {
342 bp->vec[0] += fac * grid;
344 bp->vec[1] += fac * grid;
361 nu->resolu = cu->resolu;
364 vec[0] = vec[1] = 0.0;
376 a = nu->pntsu * nu->pntsv;
386 const float tmp_cent[3] = {0.0f, 0.0f, 0.0f};
387 const float tmp_vec[3] = {0.0f, 0.0f, 1.0f};
392 nu->resolu = cu->resolu;
393 nu->resolv = cu->resolv;
399 for (
a = 0;
a < 5;
a++) {
429 a = nu->pntsu * nu->pntsv;
440 const float tmp_cent[3] = {0.0f, 0.0f, 0.0f};
441 const float tmp_vec[3] = {0.0f, 0.0f, 1.0f};
446 nu->resolu = cu->resolu;
447 nu->resolv = cu->resolv;
464 a = nu->pntsu * nu->pntsv;
504 float loc[3],
rot[3];
510 C, op,
'Z', loc,
rot,
NULL, &enter_editmode, &local_view_bits,
NULL)) {
553 if (newob && !enter_editmode) {
584 ot->
idname =
"CURVE_OT_primitive_bezier_curve_add";
605 ot->
name =
"Add Bezier Circle";
607 ot->
idname =
"CURVE_OT_primitive_bezier_circle_add";
628 ot->
name =
"Add Nurbs Curve";
630 ot->
idname =
"CURVE_OT_primitive_nurbs_curve_add";
651 ot->
name =
"Add Nurbs Circle";
653 ot->
idname =
"CURVE_OT_primitive_nurbs_circle_add";
676 ot->
idname =
"CURVE_OT_primitive_nurbs_path_add";
698 ot->
name =
"Add Surface Curve";
700 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_curve_add";
721 ot->
name =
"Add Surface Circle";
723 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_circle_add";
744 ot->
name =
"Add Surface Patch";
746 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_surface_add";
767 ot->
name =
"Add Surface Cylinder";
769 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_cylinder_add";
790 ot->
name =
"Add Surface Sphere";
792 ot->
idname =
"SURFACE_OT_primitive_nurbs_surface_sphere_add";
813 ot->
name =
"Add Surface Torus";
815 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)
#define BLI_assert_msg(a, msg)
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 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])
MINLINE void copy_v3_fl(float r[3], float f)
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#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)
struct Object * ED_object_add_type(struct bContext *C, int type, const char *name, const float loc[3], const float rot[3], bool enter_editmode, unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *obedit, const float loc[3], const float rot[3], const float scale[3], float primmat[4][4])
bool ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, char view_align_axis, float r_loc[3], float r_rot[3], float r_scale[3], bool *r_enter_editmode, unsigned short *r_local_view_bits, bool *r_is_view_aligned)
void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode)
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, 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)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
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)