66#include "curve_fit_nd.h"
111void printknots(
Object *obedit)
117 for (nu = editnurb->
first; nu; nu = nu->
next) {
121 for (a = 0; a < num; a++) {
127 for (a = 0; a < num; a++) {
143 void *cv,
int key_index,
int nu_index,
int pt_index,
int vertex_index)
165 int a, key_index = 0, nu_index = 0, pt_index = 0, vertex_index = 0;
177 origbezt = orignu->
bezt;
186 *origbezt_cpy = *origbezt;
187 keyIndex =
init_cvKeyIndex(origbezt_cpy, key_index, nu_index, pt_index, vertex_index);
207 *origbp_cpy = *origbp;
208 keyIndex =
init_cvKeyIndex(origbp_cpy, key_index, nu_index, pt_index, vertex_index);
219 orignu = orignu->
next;
255 return (
BPoint *)index->orig_cv;
266 return index->key_index;
327 if (editnurb->
keyindex ==
nullptr) {
332 for (i = 0; i <
count; i++) {
388 bezt2 = bezt1 + (a - 1);
404 if (bezt1 != bezt2) {
419 if (nu->
pntsv == 1) {
424 while (bp1 != bp2 && a > 0) {
455 while (bp1 != bp2 && a > 0) {
488 fp =
static_cast<float *
>(currkey->data);
498 *(fp + 9) = -*(fp + 9);
514 *(fp + 3) = -*(fp + 3);
567 memcpy(bezt, basebezt,
sizeof(
BezTriple));
568 memcpy(bezt->
vec, key,
sizeof(
float[9]));
575 memcpy(key, bezt->
vec,
sizeof(
float[9]));
590 float *startfp, *prevfp, *nextfp;
597 prevp = bezt + (a - 1);
653 if (cu->
key ==
nullptr) {
665 float(*ofs)[3] =
nullptr;
666 std::optional<blender::Array<bool>> dependent;
667 const float *oldkey, *ofp;
682 totvec += nu->
pntsu * 4;
689 ofs =
static_cast<float(*)[3]
>(
MEM_callocN(
sizeof(
float[3]) * totvec,
"currkey->data"));
700 for (j = 0; j < 3; j++) {
704 ofs[i][0] = bezt->
tilt - oldbezt->
tilt;
721 ofs[i + 1][0] = bp->
tilt - oldbp->
tilt;
733 const bool apply_offset = (ofs && (currkey != actkey) && (*dependent)[currkey_i]);
735 float *fp = newkey =
static_cast<float *
>(
737 ofp = oldkey =
static_cast<float *
>(currkey->data);
743 newnu =
static_cast<Nurb *
>(newnurbs->
first);
746 if (currkey == actkey) {
747 const bool restore = actkey != cu->
key->
refkey;
757 for (j = 0; j < 3; j++, i++) {
760 if (restore && oldbezt) {
767 if (restore && oldbezt) {
790 if (restore && oldbp) {
816 curofp = ofp + index;
818 for (j = 0; j < 3; j++, i++) {
838 for (j = 0; j < 3; j++, i++) {
856 curofp = ofp + index;
889 currkey->totelem = totvert;
893 currkey->data = newkey;
916 const char *rna_path,
920 const int len = strlen(orig_rna_path);
922 for (
FCurve *fcu : orig_curves) {
923 if (processed_fcurves.
contains(fcu)) {
926 if (!
STREQLEN(fcu->rna_path, orig_rna_path,
len)) {
930 processed_fcurves.
add(fcu);
932 const char *suffix = fcu->rna_path +
len;
933 char *new_rna_path =
BLI_sprintfN(
"%s%s", rna_path, suffix);
935 fcu->rna_path = new_rna_path;
956 char rna_path[64], orig_rna_path[64];
969 SNPRINTF(rna_path,
"splines[%d].bezier_points[%d]", nu_index, pt_index);
974 "splines[%d].bezier_points[%d]",
979 char handle_path[64], orig_handle_path[64];
980 SNPRINTF(orig_handle_path,
"%s.handle_left", orig_rna_path);
981 SNPRINTF(handle_path,
"%s.handle_right", rna_path);
984 SNPRINTF(orig_handle_path,
"%s.handle_right", orig_rna_path);
985 SNPRINTF(handle_path,
"%s.handle_left", rna_path);
1015 SNPRINTF(rna_path,
"splines[%d].points[%d]", nu_index, pt_index);
1020 orig_rna_path,
"splines[%d].points[%d]", keyIndex->
nu_index, keyIndex->
pt_index);
1046 for (
FCurve *fcu : orig_curves) {
1047 if (processed_fcurves.
contains(fcu)) {
1051 if (
STRPREFIX(fcu->rna_path,
"splines")) {
1052 const char *ch = strchr(fcu->rna_path,
'.');
1055 fcurves_to_remove.
append(fcu);
1073 SNPRINTF(rna_path,
"splines[%d]", nu_index);
1081 for (
FCurve *fcu : orig_curves) {
1082 if (processed_fcurves.
contains(fcu)) {
1085 if (
STRPREFIX(fcu->rna_path,
"splines")) {
1086 fcurves_to_remove.
append(fcu);
1090 return fcurves_to_remove;
1106 if (adt->
action !=
nullptr) {
1114 for (
FCurve *fcurve : fcurves_to_remove) {
1115 if (is_action_legacy) {
1133 for (
FCurve *driver : fcurves_to_remove) {
1155 EditNurb *editnurb = curve->editnurb;
1157 int *old_to_new_map;
1159 int old_totvert = 0;
1162 old_totvert += nu->
pntsu * 3;
1169 old_to_new_map =
static_cast<int *
>(
1170 MEM_mallocN(old_totvert *
sizeof(
int),
"curve old to new index map"));
1171 for (
int i = 0; i < old_totvert; i++) {
1172 old_to_new_map[i] = -1;
1175 int vertex_index = 0;
1183 if (keyIndex && keyIndex->
vertex_index + 2 < old_totvert) {
1185 old_to_new_map[keyIndex->
vertex_index] = vertex_index + 2;
1186 old_to_new_map[keyIndex->
vertex_index + 1] = vertex_index + 1;
1187 old_to_new_map[keyIndex->
vertex_index + 2] = vertex_index;
1191 old_to_new_map[keyIndex->
vertex_index + 1] = vertex_index + 1;
1192 old_to_new_map[keyIndex->
vertex_index + 2] = vertex_index + 2;
1214 *r_old_totvert = old_totvert;
1215 return old_to_new_map;
1221 EditNurb *editnurb = curve->editnurb;
1222 int *old_to_new_map =
nullptr;
1225 if (editnurb->
keyindex ==
nullptr) {
1235 if ((object->parent) && (object->parent->data == curve) &&
1238 if (old_to_new_map ==
nullptr) {
1242 if (object->par1 < old_totvert) {
1243 index = old_to_new_map[
object->par1];
1245 object->par1 = index;
1248 if (object->par2 < old_totvert) {
1249 index = old_to_new_map[
object->par2];
1251 object->par2 = index;
1254 if (object->par3 < old_totvert) {
1255 index = old_to_new_map[
object->par3];
1257 object->par3 = index;
1261 if (object->data == curve) {
1267 if (old_to_new_map ==
nullptr) {
1272 if (hmd->
indexar[i] < old_totvert) {
1273 index = old_to_new_map[hmd->
indexar[i]];
1288 if (old_to_new_map !=
nullptr) {
1297 if (obedit ==
nullptr) {
1303 ListBase newnurb = {
nullptr,
nullptr}, oldnurb = cu->
nurb;
1342 undo_editmode_clear();
1397 int error_vertex_keys;
1405 for (
Base *oldbase : bases) {
1408 Curve *oldcu, *newcu;
1410 ListBase newnurb = {
nullptr,
nullptr};
1412 oldob = oldbase->object;
1413 oldcu =
static_cast<Curve *
>(oldob->
data);
1416 status.error_vertex_keys++;
1421 status.unselected++;
1429 status.error_generic++;
1467 if (status.unselected == bases.
size()) {
1472 const int tot_errors = status.error_vertex_keys + status.error_generic;
1473 if (tot_errors > 0) {
1476 if (status.changed) {
1482 if (((status.error_vertex_keys ? 1 : 0) + (status.error_generic ? 1 : 0)) > 1) {
1487 if (status.error_vertex_keys) {
1507 ot->
description =
"Separate selected points from connected unselected points into a new object";
1529 bool changed =
false;
1530 int count_failed = 0;
1534 for (
Object *obedit : objects) {
1541 ListBase newnurb = {
nullptr,
nullptr};
1566 if (changed ==
false) {
1567 if (count_failed != 0) {
1580 ot->
description =
"Split off selected points from connected unselected points";
1604 for (
b = 0, bp = nu->
bp;
b < nu->
pntsv;
b++) {
1606 for (a = 0; a < nu->
pntsu; a++, bp++) {
1611 if (sel == nu->
pntsu) {
1614 else if (sel >= 1) {
1631 for (a = 0; a < nu->
pntsu; a++) {
1635 if (bp->f1 &
flag) {
1639 if (sel == nu->
pntsv) {
1642 else if (sel >= 1) {
1653 const float cent[3],
1654 const float rotmat[3][3])
1742 BPoint *bp, *bpn, *newbp;
1743 int a,
b, newu, newv;
1774 newv = nu->
pntsv - newv;
1775 if (newv != nu->
pntsv) {
1800 newu = nu->
pntsu - newu;
1801 if (newu != nu->
pntsu) {
1806 for (a = 0; a < nu->
pntsu; a++, bp++) {
1819 if (newu == 1 && nu->
pntsv > 1) {
1844 int a, type, nuindex = 0;
1863 if (cu->
actnu == nuindex) {
1889 if (cu->
actnu == nuindex) {
1905 clamp_nurb_order_u(nu);
1915 for (a = 0; a < nu->
pntsu; a++) {
1917 memmove(bezt, bezt + 1, (nu->
pntsu - a - 1) *
sizeof(
BezTriple));
1937 else if (nu->
pntsv == 1) {
1940 for (a = 0; a < nu->
pntsu; a++) {
1942 memmove(bp, bp + 1, (nu->
pntsu - a - 1) *
sizeof(
BPoint));
1964 clamp_nurb_order_u(nu);
1977 const bool selstatus,
1981 for (
int i = 0; i <
count; i++) {
2000 int copy_intervals[],
2001 int *interval_count,
2002 bool *out_is_first_sel)
2006 int selected_leg_count = 0;
2008 int selected_in_prev_leg = -1;
2011 bool is_first_sel =
false;
2012 bool is_last_sel =
false;
2014 for (
int j = 0; j < max_j; j++, bp_j += next_j) {
2015 const BPoint *bp_j_i = bp_j;
2016 int selected_in_curr_leg = 0;
2017 for (
int i = 0; i <
max_i; i++, bp_j_i += next_i) {
2019 selected_in_curr_leg++;
2022 if (selected_in_curr_leg ==
max_i) {
2023 selected_leg_count++;
2025 is_first_sel =
true;
2027 else if (j + 1 == max_j) {
2031 else if (not_full == -1) {
2032 not_full = selected_in_curr_leg;
2035 else if (not_full != selected_in_curr_leg) {
2039 if (selected_in_prev_leg != selected_in_curr_leg) {
2040 copy_intervals[ins] = selected_in_curr_leg ==
max_i || j == 0 ? j : j - 1;
2042 selected_in_prev_leg = selected_in_curr_leg;
2044 copy_intervals[ins] = j;
2046 if (selected_leg_count &&
2049 (selected_leg_count < max_j || max_j == 1))
2053 if (is_first_sel && (copy_intervals[0] < copy_intervals[1] || max_j == 1)) {
2054 memmove(copy_intervals + 1, copy_intervals, (ins + 1) *
sizeof(copy_intervals[0]));
2055 copy_intervals[0] = 0;
2057 is_first_sel =
false;
2060 if (is_last_sel && copy_intervals[ins - 1] < copy_intervals[ins]) {
2061 copy_intervals[ins + 1] = copy_intervals[ins];
2065 *interval_count = ins;
2066 *out_is_first_sel = ins > 1 ? is_first_sel :
false;
2067 return selected_leg_count;
2094 int *
const intvls_u =
static_cast<int *
>(
2096 int *
const intvls_v =
static_cast<int *
>(
2102 bool is_first_sel_u;
2107 if (selected_us == -1) {
2111 bool is_first_sel_v;
2113 const bool is_point = nu->
pntsu == 1;
2114 const bool is_curve = nu->
pntsv == 1;
2115 const bool extrude_every_u_point = selected_us == nu->
pntsu;
2116 if (is_point || (is_curve && !extrude_every_u_point)) {
2117 intvls_v[0] = intvls_v[1] = 0;
2119 is_first_sel_v =
false;
2133 const int new_pntsu = nu->
pntsu + intvl_cnt_u - 1;
2134 const int new_pntsv = nu->
pntsv + intvl_cnt_v - 1;
2136 new_pntsu * new_pntsv,
sizeof(
BPoint),
"extrudeNurb2");
2137 BPoint *new_bp_v = new_bp;
2139 bool selected_v = is_first_sel_v;
2140 for (
int j = 1; j <= intvl_cnt_v; j++, selected_v = !selected_v) {
2142 for (
int v_j = intvls_v[j - 1]; v_j <= intvls_v[j];
2143 v_j++, new_bp_v += new_pntsu, old_bp_v += nu->
pntsu)
2145 BPoint *new_bp_u_v = new_bp_v;
2146 bool selected_u = is_first_sel_u;
2147 for (
int i = 1; i <= intvl_cnt_u; i++, selected_u = !selected_u) {
2148 const int copy_from = intvls_u[i - 1];
2149 const int copy_to = intvls_u[i];
2150 const int copy_count = copy_to - copy_from + 1;
2151 const bool sel_status = selected_u || selected_v ?
true :
false;
2152 ED_curve_bpcpy(editnurb, new_bp_u_v, old_bp_v + copy_from, copy_count);
2154 new_bp_u_v += copy_count;
2161 nu->
pntsu = new_pntsu;
2162 if (nu->
pntsv == 1 && new_pntsv > 1) {
2165 nu->
pntsv = new_pntsv;
2189 if ((start <= cu->actvert) && (end > cu->
actvert)) {
2203 BPoint *bp, *bp1, *bp2, *bp3;
2205 int a,
b, c, starta, enda, diffa, cyclicu, cyclicv, newu, newv;
2210 cyclicu = cyclicv = 0;
2212 for (a = 0, bezt = nu->
bezt; a < nu->
pntsu; a++, bezt++) {
2220 if (a >= nu->
pntsu - 1) {
2226 if (enda >= starta) {
2227 newu = diffa = enda - starta + 1;
2233 if (enda == nu->
pntsu - 1) {
2236 if (i == cu->
actnu) {
2238 editnurb, newnurb, cu, starta, starta + diffa, cu->
actvert - starta);
2243 if (newu != diffa) {
2245 if (i == cu->
actnu) {
2247 editnurb, newnurb, cu, 0, cyclicu, newu - cyclicu + cu->
actvert);
2252 if (newu != nu->
pntsu) {
2253 newnu->
flagu &= ~CU_NURB_CYCLIC;
2256 for (
b = 0, bezt1 = newnu->
bezt;
b < newnu->
pntsu;
b++, bezt1++) {
2266 if (i == cu->
actnu) {
2272 newnu->
flagu &= ~CU_NURB_CYCLIC;
2274 for (
b = 0, bezt1 = newnu->
bezt;
b < newnu->
pntsu;
b++, bezt1++) {
2281 else if (nu->
pntsv == 1) {
2282 for (a = 0, bp = nu->
bp; a < nu->
pntsu; a++, bp++) {
2290 if (a >= nu->
pntsu - 1) {
2296 if (enda >= starta) {
2297 newu = diffa = enda - starta + 1;
2303 if (enda == nu->
pntsu - 1) {
2306 if (i == cu->
actnu) {
2308 editnurb, newnurb, cu, starta, starta + diffa, cu->
actvert - starta);
2312 memcpy(newnu->
bp, &nu->
bp[starta], diffa *
sizeof(
BPoint));
2313 if (newu != diffa) {
2314 memcpy(&newnu->
bp[diffa], nu->
bp, cyclicu *
sizeof(
BPoint));
2315 if (i == cu->
actnu) {
2317 editnurb, newnurb, cu, 0, cyclicu, newu - cyclicu + cu->
actvert);
2322 if (newu != nu->
pntsu) {
2323 newnu->
flagu &= ~CU_NURB_CYCLIC;
2326 for (
b = 0, bp1 = newnu->
bp;
b < newnu->
pntsu;
b++, bp1++) {
2336 if (i == cu->
actnu) {
2341 memcpy(newnu->
bp, nu->
bp, cyclicu *
sizeof(
BPoint));
2342 newnu->
flagu &= ~CU_NURB_CYCLIC;
2344 for (
b = 0, bp1 = newnu->
bp;
b < newnu->
pntsu;
b++, bp1++) {
2357 for (a = 0; a < nu->
pntsv; a++) {
2358 for (
b = 0;
b < nu->
pntsu;
b++, bp++) {
2366 for (a = 0; a < nu->
pntsu; a++) {
2368 if (
ELEM(newv, 0, usel[a])) {
2380 if ((newu == 0 || newv == 0) ||
2384 printf(
"Can't duplicate Nurb\n");
2388 for (a = 0, bp1 = nu->
bp; a < nu->
pntsu * nu->
pntsv; a++, bp1++) {
2393 for (
b = a % nu->
pntsu, bp2 = bp1;
b < nu->
pntsu;
b++, bp2++) {
2396 for (c = a / nu->
pntsu, bp3 = bp2; c < nu->
pntsv; c++, bp3 += nu->
pntsu) {
2397 if (bp3->f1 &
flag) {
2415 if ((newu + newv) > 2) {
2425 if (cyclicu != 0 || cyclicv != 0) {
2430 if (a + newu == nu->
pntsu && cyclicu != 0) {
2433 for (
b = 0;
b < newv;
b++) {
2434 memcpy(&newnu->
bp[
b * newnu->
pntsu],
2437 memcpy(&newnu->
bp[
b * newnu->
pntsu + newu],
2439 cyclicu *
sizeof(
BPoint));
2442 if (cu->
actnu == i) {
2447 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2448 starta =
b * nu->
pntsu + a;
2473 cyclicu = cyclicv = 0;
2475 else if ((a / nu->
pntsu) + newv == nu->
pntsv && cyclicv != 0) {
2478 memcpy(newnu->
bp, &nu->
bp[a], newu * newv *
sizeof(
BPoint));
2479 memcpy(&newnu->
bp[newu * newv], nu->
bp, newu * cyclicv *
sizeof(
BPoint));
2482 if (cu->
actnu == i) {
2484 editnurb, newnurb, cu, cu->
actvert, a, (newu * newv) + cu->
actvert);
2486 cyclicu = cyclicv = 0;
2490 for (
b = 0;
b < newv;
b++) {
2491 memcpy(&newnu->
bp[
b * newu], &nu->
bp[
b * nu->
pntsu + a], newu *
sizeof(
BPoint));
2496 if (cu->
actnu == i) {
2501 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2502 starta =
b * nu->
pntsu + a;
2509 (starta % nu->
pntsu))))
2518 if (newu != nu->
pntsu) {
2519 newnu->
flagu &= ~CU_NURB_CYCLIC;
2521 if (newv != nu->
pntsv) {
2522 newnu->
flagv &= ~CU_NURB_CYCLIC;
2527 if (cyclicu != 0 || cyclicv != 0) {
2529 newu = cyclicu == 0 ? nu->
pntsu : cyclicu;
2530 newv = cyclicv == 0 ? nu->
pntsv : cyclicv;
2533 for (
b = 0;
b < newv;
b++) {
2538 if (cu->
actnu == i) {
2543 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2559 if (newu != nu->
pntsu) {
2560 newnu->
flagu &= ~CU_NURB_CYCLIC;
2562 if (newv != nu->
pntsv) {
2563 newnu->
flagv &= ~CU_NURB_CYCLIC;
2568 bp1->
f1 &= ~SURF_SEEN;
2593 for (a = 0, bp = nu->
bp; a < nu->
pntsu * nu->
pntsv; a++, bp++) {
2594 bp->
f1 &= ~SURF_SEEN;
2620 for (
Object *obedit : objects) {
2653 ot->
name =
"Switch Direction";
2655 ot->
idname =
"CURVE_OT_switch_direction";
2678 for (
Object *obedit : objects) {
2687 for (bezt = nu->
bezt, a = 0; a < nu->
pntsu; a++, bezt++) {
2694 for (bp = nu->
bp, a = 0; a < nu->
pntsu * nu->
pntsv; a++, bp++) {
2712 ot->
name =
"Set Goal Weight";
2713 ot->
description =
"Set softbody goal weight for selected points";
2714 ot->
idname =
"CURVE_OT_spline_weight_set";
2743 for (
Object *obedit : objects) {
2759 for (bezt = nu->
bezt, a = 0; a < nu->
pntsu; a++, bezt++) {
2766 for (bp = nu->
bp, a = 0; a < nu->
pntsu * nu->
pntsv; a++, bp++) {
2784 ot->
name =
"Set Curve Radius";
2785 ot->
description =
"Set per-point radius which is used for bevel tapering";
2786 ot->
idname =
"CURVE_OT_radius_set";
2814 for (
int i = 0; i < 3; i++) {
2816 float val_old = bezt->
vec[1][i];
2819 float val_new = (bezt_orig_prev->
vec[1][i] * 0.5f) + (bezt_orig_next->
vec[1][i] * 0.5f);
2820 float offset = (val_old * (1.0f - factor)) + (val_new * factor) - val_old;
2823 bezt->
vec[1][i] += offset;
2824 bezt->
vec[0][i] += offset;
2825 bezt->
vec[2][i] += offset;
2833 const BPoint *bp_orig_prev,
2834 const BPoint *bp_orig_next,
2839 for (
int i = 0; i < 3; i++) {
2840 float val_old, val_new, offset;
2842 val_old = bp->
vec[i];
2843 val_new = (bp_orig_prev->
vec[i] * 0.5f) + (bp_orig_next->
vec[i] * 0.5f);
2844 offset = (val_old * (1.0f - factor)) + (val_new * factor) - val_old;
2846 bp->
vec[i] += offset;
2852 const float factor = 1.0f / 6.0f;
2860 for (
Object *obedit : objects) {
2877 bool changed =
false;
2886 a_end = nu->
pntsu - 1;
2890 for (; a < a_end; a++) {
2892 bezt = &nu->
bezt[a];
2894 const BezTriple *bezt_orig_prev, *bezt_orig_next;
2896 bezt_orig_prev = &bezt_orig[
mod_i(a - 1, nu->
pntsu)];
2897 bezt_orig_next = &bezt_orig[
mod_i(a + 1, nu->
pntsu)];
2920 a_end = nu->
pntsu - 1;
2923 for (; a < a_end; a++) {
2926 const BPoint *bp_orig_prev, *bp_orig_next;
2928 bp_orig_prev = &bp_orig[
mod_i(a - 1, nu->
pntsu)];
2929 bp_orig_next = &bp_orig[
mod_i(a + 1, nu->
pntsu)];
2978 int start_sel, end_sel;
2979 float start_rad, end_rad, fac,
range;
2983#define BEZT_VALUE(bezt) (*((float *)((char *)(bezt) + bezt_offsetof)))
2985 for (last_sel = 0; last_sel < nu->
pntsu; last_sel++) {
2991 for (bezt = &nu->
bezt[last_sel], a = last_sel; a < nu->
pntsu; a++, bezt++) {
2998 end_sel = start_sel;
2999 for (bezt = &nu->
bezt[start_sel + 1], a = start_sel + 1; a < nu->
pntsu; a++, bezt++) {
3006 if (start_sel == -1) {
3007 last_sel = nu->
pntsu;
3013 start_rad = end_rad =
FLT_MAX;
3015 if (start_sel == end_sel) {
3017 if (start_sel > 0) {
3020 if (end_sel != -1 && end_sel < nu->pntsu) {
3027 else if (start_rad !=
FLT_MAX) {
3030 else if (end_rad !=
FLT_MAX) {
3036 if (start_sel == 0) {
3043 if (end_sel == nu->
pntsu - 1) {
3052 range =
float(end_sel - start_sel) + 2.0f;
3053 for (bezt = &nu->
bezt[start_sel], a = start_sel; a <= end_sel; a++, bezt++) {
3055 BEZT_VALUE(bezt) = start_rad * (1.0f - fac) + end_rad * fac;
3063#define BP_VALUE(bp) (*((float *)((char *)(bp) + bp_offset)))
3066 for (last_sel = 0; last_sel < nu->
pntsu; last_sel++) {
3072 for (bp = &nu->
bp[last_sel], a = last_sel; a < nu->
pntsu; a++, bp++) {
3079 end_sel = start_sel;
3080 for (bp = &nu->
bp[start_sel + 1], a = start_sel + 1; a < nu->
pntsu; a++, bp++) {
3087 if (start_sel == -1) {
3088 last_sel = nu->
pntsu;
3094 start_rad = end_rad =
FLT_MAX;
3096 if (start_sel == end_sel) {
3098 if (start_sel > 0) {
3099 start_rad =
BP_VALUE(&nu->
bp[start_sel - 1]);
3101 if (end_sel != -1 && end_sel < nu->pntsu) {
3106 BP_VALUE(&nu->
bp[start_sel]) = (start_rad + end_rad) / 2;
3108 else if (start_rad !=
FLT_MAX) {
3111 else if (end_rad !=
FLT_MAX) {
3117 if (start_sel == 0) {
3122 start_rad =
BP_VALUE(&nu->
bp[start_sel - 1]);
3124 if (end_sel == nu->
pntsu - 1) {
3133 range =
float(end_sel - start_sel) + 2.0f;
3134 for (bp = &nu->
bp[start_sel], a = start_sel; a <= end_sel; a++, bp++) {
3136 BP_VALUE(bp) = start_rad * (1.0f - fac) + end_rad * fac;
3159 for (
Object *obedit : objects) {
3174 ot->
name =
"Smooth Curve Weight";
3176 ot->
idname =
"CURVE_OT_smooth_weight";
3202 for (
Object *obedit : objects) {
3224 ot->
name =
"Smooth Curve Radius";
3226 ot->
idname =
"CURVE_OT_smooth_radius";
3251 for (
Object *obedit : objects) {
3273 ot->
name =
"Smooth Curve Tilt";
3275 ot->
idname =
"CURVE_OT_smooth_tilt";
3301 for (
Object *obedit : objects) {
3332 if (sel == nu->
pntsu) {
3370 ot->
name =
"Hide Selected";
3383 ot->
srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected");
3397 bool changed_multi =
false;
3401 for (
Object *obedit : objects) {
3406 bool changed =
false;
3440 changed_multi =
true;
3449 ot->
name =
"Reveal Hidden";
3479 BPoint *bp, *prevbp, *bpnew, *bpn;
3481 int a,
b, sel, amount, *usel, *vsel;
3501 if (nextbezt ==
nullptr) {
3507 amount += number_cuts;
3524 if (nextbezt ==
nullptr) {
3531 float prevvec[3][3];
3533 memcpy(prevvec, bezt->
vec,
sizeof(
float[9]));
3535 for (
int i = 0; i < number_cuts; i++) {
3536 factor = 1.0f / (number_cuts + 1 - i);
3538 memcpy(beztn, nextbezt,
sizeof(
BezTriple));
3565 memcpy(prevvec, beztn->
vec,
sizeof(
float[9]));
3575 nu->
pntsu += amount;
3580 else if (nu->
pntsv == 1) {
3592 if (nextbp ==
nullptr) {
3597 amount += number_cuts;
3612 memcpy(bpn, bp,
sizeof(
BPoint));
3617 if (nextbp ==
nullptr) {
3623 for (
int i = 0; i < number_cuts; i++) {
3624 factor =
float(i + 1) / (number_cuts + 1);
3626 memcpy(bpn, nextbp,
sizeof(
BPoint));
3637 nu->
pntsu += amount;
3687 usel =
static_cast<int *
>(
MEM_callocN(
sizeof(
int) * nu->
pntsu,
"subivideNurb3"));
3688 vsel =
static_cast<int *
>(
MEM_callocN(
sizeof(
int) * nu->
pntsv,
"subivideNurb3"));
3693 for (a = 0; a < nu->
pntsv; a++) {
3708 int countu = nu->
pntsu + (nu->
pntsu - 1) * number_cuts;
3711 int tot = ((number_cuts + 1) * nu->
pntsu - number_cuts) *
3712 ((number_cuts + 1) * nu->
pntsv - number_cuts);
3717 for (a = 0; a < nu->
pntsv; a++) {
3725 for (
int i = 0; i < number_cuts; i++) {
3726 factor =
float(i + 1) / (number_cuts + 1);
3733 bpn += number_cuts * countu;
3736 bpn = bpnew + ((number_cuts + 1) * nu->
pntsu - number_cuts);
3737 bp = bpnew + (number_cuts + 1) * ((number_cuts + 1) * nu->
pntsu - number_cuts);
3739 for (a = 1; a < nu->
pntsv; a++) {
3741 for (
b = 0;
b < (number_cuts + 1) * nu->
pntsu - number_cuts;
b++) {
3743 for (
int i = 0; i < number_cuts; i++) {
3744 factor =
float(i + 1) / (number_cuts + 1);
3753 bp += number_cuts * countu;
3754 bpn += number_cuts * countu;
3755 prevbp += number_cuts * countu;
3759 nu->
pntsu = (number_cuts + 1) * nu->
pntsu - number_cuts;
3760 nu->
pntsv = (number_cuts + 1) * nu->
pntsv - number_cuts;
3767 for (a = 0; a < nu->
pntsv - 1; a++) {
3768 if (vsel[a] == nu->
pntsu && vsel[a + 1] == nu->
pntsu) {
3774 bpn = bpnew =
static_cast<BPoint *
>(
3777 for (a = 0; a < nu->
pntsv; a++) {
3784 if ((a < nu->pntsv - 1) && vsel[a] == nu->
pntsu && vsel[a + 1] == nu->
pntsu) {
3785 for (
int i = 0; i < number_cuts; i++) {
3786 factor =
float(i + 1) / (number_cuts + 1);
3787 prevbp = bp - nu->
pntsu;
3815 for (a = 0; a < nu->
pntsu - 1; a++) {
3816 if (usel[a] == nu->
pntsv && usel[a + 1] == nu->
pntsv) {
3824 bpn = bpnew =
static_cast<BPoint *
>(
3827 for (a = 0; a < nu->
pntsv; a++) {
3841 for (
int i = 0; i < number_cuts; i++) {
3842 factor =
float(i + 1) / (number_cuts + 1);
3876 for (
Object *obedit : objects) {
3912 prop =
RNA_def_int(
ot->
srna,
"number_cuts", 1, 1, 1000,
"Number of Cuts",
"", 1, 10);
3932 for (
Object *obedit : objects) {
3936 bool changed =
false;
3937 bool changed_size =
false;
3943 const int pntsu_prev = nu->
pntsu;
3944 const char *err_msg =
nullptr;
3947 if (pntsu_prev != nu->
pntsu) {
3948 changed_size =
true;
3980 {
CU_POLY,
"POLY", 0,
"Poly",
""},
3981 {
CU_BEZIER,
"BEZIER", 0,
"Bézier",
""},
3982 {
CU_NURBS,
"NURBS", 0,
"NURBS",
""},
3983 {0,
nullptr, 0,
nullptr,
nullptr},
3987 ot->
name =
"Set Spline Type";
3989 ot->
idname =
"CURVE_OT_spline_type_set";
4005 "Use handles when converting Bézier curves into polygons");
4026 for (
Object *obedit : objects) {
4046 {
HD_AUTO,
"AUTOMATIC", 0,
"Automatic",
""},
4047 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
4048 {5,
"ALIGNED", 0,
"Aligned",
""},
4049 {6,
"FREE_ALIGN", 0,
"Free",
""},
4050 {3,
"TOGGLE_FREE_ALIGN", 0,
"Toggle Free/Align",
""},
4051 {0,
nullptr, 0,
nullptr,
nullptr},
4055 ot->
name =
"Set Handle Type";
4056 ot->
description =
"Set type of handles for selected control points";
4057 ot->
idname =
"CURVE_OT_handle_type_set";
4090 for (
Object *obedit : objects) {
4115 ot->
name =
"Recalculate Handles";
4116 ot->
description =
"Recalculate the direction of selected handles";
4117 ot->
idname =
"CURVE_OT_normals_make_consistent";
4140 float *fp1, *fp2, *tempf;
4143 if (base ==
nullptr || tot == 0) {
4150 fp2 = fp1 + (a - 1);
4152 while (fp1 != fp2 && a > 0) {
4153 std::swap(*fp1, *fp2);
4162 fp2 = tempf =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * tot,
"switchdirect"));
4164 fp2[0] =
fabsf(fp1[1] - fp1[0]);
4176 fp1[0] = fp1[-1] + fp2[0];
4185 BPoint *bp1, *bp2, *temp;
4199 for (u = 0; u < nu->
pntsu; u++, bp1++) {
4200 bp2 = temp + (nu->
pntsu - u - 1) * (nu->
pntsv) +
v;
4232 ListBase nbase = {
nullptr,
nullptr};
4233 NurbSort *nus, *nustest, *headdo, *taildo;
4235 float dist, headdist, taildist;
4261 while (nbase.
first) {
4263 headdist = taildist = 1.0e30;
4264 headdo = taildo =
nullptr;
4270 if (dist < headdist) {
4276 if (dist < taildist) {
4280 nustest = nustest->
next;
4283 if (headdist < taildist) {
4303 BPoint *bp, *bp1, *bp2, *temp;
4338 if (nu1->
pntsv != 1) {
4371 if (nu1->
pntsu == 1) {
4374 if (nu2->
pntsv != 1) {
4390 bp1 = &nu1->
bp[nu1->
pntsu - 1];
4398 bp1 = &nu1->
bp[nu1->
pntsu - 1];
4432 for (u = 0; u < nu1->
pntsu; u++, bp++) {
4467 ListBase nsortbase = {
nullptr,
nullptr};
4471 if (nsortbase.
first == nsortbase.
last) {
4488 else if (nus2->
nu->
pntsv == 1) {
4534 int error_selected_few;
4535 int error_resolution;
4541 for (
Object *obedit : objects) {
4545 status.unselected++;
4550 Nurb *nu, *nu1 =
nullptr, *nu2 =
nullptr;
4556 nu =
static_cast<Nurb *
>(nubase->
first);
4564 if (nu_select_num) {
4570 if (nu_select_num > 1) {
4574 if (nu->
pntsv == 1) {
4588 switch (merge_result) {
4591 goto curve_merge_tag_object;
4593 status.error_resolution++;
4594 goto curve_merge_tag_object;
4596 status.error_selected_few++;
4599 status.error_resolution++;
4607 if (nu->
pntsu == 1) {
4608 nu->
flagu &= ~CU_NURB_CYCLIC;
4615 if (nu2 ==
nullptr) {
4618 else if (nu1 ==
nullptr) {
4632 if (nu1 ==
nullptr) {
4635 else if (nu2 ==
nullptr) {
4648 else if (nu->
pntsv == 1) {
4656 if (nu2 ==
nullptr) {
4659 else if (nu1 ==
nullptr) {
4669 if (nu1 ==
nullptr) {
4672 else if (nu2 ==
nullptr) {
4690 if ((nu1 && nu2) && (nu1 != nu2)) {
4691 if (nu1->
type == nu2->type) {
4700 nu1->
pntsu += nu2->pntsu;
4716 nu1->
pntsu += nu2->pntsu;
4734 else if ((nu1 && !nu2) || (!nu1 && nu2)) {
4736 std::swap(nu1, nu2);
4758 status.error_generic++;
4768 curve_merge_tag_object:
4773 if (status.unselected == objects.size()) {
4778 const int tot_errors = status.error_selected_few + status.error_resolution +
4779 status.error_generic;
4780 if (tot_errors > 0) {
4782 if (status.changed) {
4788 if (((status.error_selected_few ? 1 : 0) + (status.error_resolution ? 1 : 0) +
4789 (status.error_generic ? 1 : 0)) > 1)
4795 if (status.error_selected_few) {
4798 else if (status.error_resolution) {
4814 ot->
name =
"Make Segment";
4815 ot->
idname =
"CURVE_OT_make_segment";
4841 Base *basact =
nullptr;
4843 bool changed =
false;
4854 if ((found &&
params->select_passthrough) &&
4855 (((bezt ? (&bezt->
f1)[hand] : bp->
f1) &
SELECT) != 0))
4859 else if (found ||
params->deselect_all) {
4863 for (
Object *ob_iter : objects) {
4879 switch (
params->sel_op) {
4883 if (use_handle_select) {
4909 if (use_handle_select) {
4910 bezt->
f2 &= ~SELECT;
4919 else if (hand == 0) {
4920 bezt->
f1 &= ~SELECT;
4923 bezt->
f3 &= ~SELECT;
4938 if (use_handle_select) {
4939 bezt->
f2 &= ~SELECT;
4949 if (use_handle_select) {
4958 else if (hand == 0) {
4985 if (use_handle_select) {
5036 return changed || found;
5046 float viewmat[4][4],
View3D *v3d,
Object *obedit,
const float axis[3],
const float cent[3])
5050 float cmat[3][3], tmat[3][3], imat[3][3];
5051 float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
5052 float persmat[3][3], persinv[3][3];
5053 bool ok, changed =
false;
5060 copy_m3_m4(bmat, obedit->object_to_world().ptr());
5087 for (a = 0; a < 7; a++) {
5131 float cent[3], axis[3], viewmat[4][4];
5132 bool changed =
false;
5133 int count_failed = 0;
5147 for (
Object *obedit : objects) {
5155 mul_m4_v3(obedit->world_to_object().ptr(), cent);
5171 if (changed ==
false) {
5172 if (count_failed != 0) {
5184 float axis[3] = {0.0f, 0.0f, 1.0f};
5201 ot->
description =
"Extrude selected boundary row around pivot point and current view axis";
5218 "Center in global view space",
5222 ot->
srna,
"axis", 3,
nullptr, -1.0f, 1.0f,
"Axis",
"Axis in global view space", -1.0f, 1.0f);
5233 bool changed =
false;
5252 int pnt_len = nu->
pntsu;
5255 bool is_prev_selected =
false;
5256 bool duplic_first =
false;
5257 bool duplic_last =
false;
5265 bezt_prev = &nu->
bezt[0];
5269 bezt_prev = &nu->
bezt[pnt_len - 1];
5280 bezt_stack = nu->
bezt[0];
5282 bezt_prev = &bezt_stack;
5289 for (bezt = &nu->
bezt[0]; i--; bezt++) {
5291 if (bezt_prev && is_prev_selected != is_selected) {
5294 if (bezt == cu_actvert.bezt) {
5295 act_offset = new_points;
5298 is_prev_selected = is_selected;
5306 is_prev_selected =
false;
5312 else if (duplic_first) {
5313 bezt_prev = &bezt_stack;
5314 is_prev_selected =
false;
5317 bezt_prev =
nullptr;
5319 BezTriple *bezt_src, *bezt_dst, *bezt_src_iter, *bezt_dst_iter;
5320 const int new_len = pnt_len + new_points;
5322 bezt_src = nu->
bezt;
5324 bezt_src_iter = &bezt_src[0];
5325 bezt_dst_iter = &bezt_dst[0];
5327 for (bezt = &nu->
bezt[0]; i < pnt_len; i++, bezt++) {
5335 if (bezt_prev && is_prev_selected != is_selected) {
5336 int count = i - offset + 1;
5337 if (is_prev_selected) {
5347 bezt_dst_iter +=
count + 1;
5348 bezt_src_iter +=
count;
5352 is_prev_selected = is_selected;
5355 int remain = pnt_len - offset;
5361 ED_curve_beztcpy(editnurb, &bezt_dst[new_len - 1], &bezt_src[pnt_len - 1], 1);
5366 nu->
bezt = bezt_dst;
5367 nu->
pntsu += new_points;
5372 BPoint *bp, *bp_prev =
nullptr;
5377 bp_prev = &nu->
bp[0];
5383 bp_stack = nu->
bp[0];
5384 bp_stack.
f1 &= ~SELECT;
5385 bp_prev = &bp_stack;
5393 for (bp = &nu->
bp[0]; i--; bp++) {
5394 bool is_selected = (bp->
f1 &
SELECT) != 0;
5395 if (bp_prev && is_prev_selected != is_selected) {
5398 if (bp == cu_actvert.bp) {
5399 act_offset = new_points;
5402 is_prev_selected = is_selected;
5406 BPoint *bp_src, *bp_dst, *bp_src_iter, *bp_dst_iter;
5407 const int new_len = pnt_len + new_points;
5409 is_prev_selected =
false;
5415 else if (duplic_first) {
5416 bp_prev = &bp_stack;
5417 is_prev_selected =
false;
5424 bp_src_iter = &bp_src[0];
5425 bp_dst_iter = &bp_dst[0];
5427 for (bp = &nu->
bp[0]; i < pnt_len; i++, bp++) {
5428 bool is_selected = (bp->
f1 &
SELECT) != 0;
5429 if (bp_prev && is_prev_selected != is_selected) {
5430 int count = i - offset + 1;
5431 if (is_prev_selected) {
5439 bp_dst_iter[
count - 1].
f1 &= ~SELECT;
5441 bp_dst_iter +=
count + 1;
5442 bp_src_iter +=
count;
5446 is_prev_selected = is_selected;
5449 int remain = pnt_len - offset;
5455 ED_curve_bpcpy(editnurb, &bp_dst[new_len - 1], &bp_src[pnt_len - 1], 1);
5456 bp_dst[new_len - 1].
f1 &= ~SELECT;
5461 nu->
pntsu += new_points;
5485 bool changed =
false;
5495 for (i = 0, bezt = nu->
bezt; i < nu->
pntsu; i++, bezt++) {
5505 for (i = 0, bp = nu->
bp; i < nu->
pntsu; i++, bp++) {
5518 mul_v3_fl(center, 1.0f /
float(verts_len));
5528 for (i = 0, bezt = nu->
bezt; i < nu->
pntsu; i++, bezt++) {
5545 for (i = 0, bp = nu->
bp; i < nu->
pntsu; i++, bp++) {
5569 nurb_new =
static_cast<Nurb *
>(
5584 memcpy(nurb_new->
bp, nu->
bp,
sizeof(
BPoint));
5709 const float eps = 1e-6f;
5716 const float *plane_co = vc.
obedit->object_to_world().location();
5728 float location_test[3];
5753 ot->
name =
"Extrude to Cursor or Add";
5754 ot->
idname =
"CURVE_OT_vertex_add";
5755 ot->
description =
"Add a new control point (linked to only selected end-curve one, if any)";
5773 "Location to add new vertex at",
5793 for (
Object *obedit : objects) {
5796 bool changed =
false;
5850 bool changed =
false;
5901 if (direction == 0 && nu->
pntsu > 1) {
5907 if (direction == 1 && nu->
pntsv > 1) {
5929 bool changed_multi =
false;
5933 for (
Object *obedit : objects) {
5942 changed_multi =
true;
5978 {0,
"CYCLIC_U", 0,
"Cyclic U",
""},
5979 {1,
"CYCLIC_V", 0,
"Cyclic V",
""},
5980 {0,
nullptr, 0,
nullptr,
nullptr},
5984 ot->
name =
"Toggle Cyclic";
5986 ot->
idname =
"CURVE_OT_cyclic_toggle";
6002 "Direction to make surface cyclic in");
6017 bool changed =
false;
6018 int count_failed = 0;
6022 for (
Object *obedit : objects) {
6029 ListBase newnurb = {
nullptr,
nullptr};
6043 if (changed ==
false) {
6044 if (count_failed != 0) {
6055 ot->
name =
"Duplicate Curve";
6089 ListBase *nubase = &editnurb->
nurbs, newnurb = {
nullptr,
nullptr};
6093 int a,
b, starta, enda, cut, cyclicut;
6097 starta = enda = cut = -1;
6101 for (a = 0, bezt = nu->
bezt; a < nu->
pntsu; a++, bezt++) {
6107 if (a < nu->pntsu - 1) {
6118 if (starta <= 1 && a == nu->pntsu - 1) {
6120 if (starta == 1 && enda != a) {
6121 nu->
flagu &= ~CU_NURB_CYCLIC;
6126 cut = enda - starta + 1;
6129 else if (starta == 0) {
6132 cut = enda - starta + 1;
6142 starta = nu->
pntsu - 1;
6154 else if (enda == nu->
pntsu - 1) {
6157 cut = enda - starta + 1;
6159 bezt2 = &nu->
bezt[1];
6168 else if (cyclicut != 0) {
6182 cut = enda - starta + 1;
6186 if (nu1 !=
nullptr) {
6190 if (starta != 0 || enda != nu->
pntsu - 1) {
6191 nu1->
flagu &= ~CU_NURB_CYCLIC;
6202 bezt2 = &nu->
bezt[1];
6220 else if (nu->
pntsv >= 1) {
6224 for (a = 0, bp = nu->
bp; a < nu->
pntsu; a++, bp++) {
6230 if (a < nu->pntsu - 1) {
6234 else if (a < nu->pntsu - 1 && !((bp + 1)->f1 &
SELECT)) {
6241 if (starta <= 1 && a == nu->pntsu - 1) {
6243 if (starta == 1 && enda != a) {
6244 nu->
flagu &= ~CU_NURB_CYCLIC;
6249 cut = enda - starta + 1;
6252 else if (starta == 0) {
6255 cut = enda - starta + 1;
6266 starta = nu->
pntsu - 1;
6278 else if (enda == nu->
pntsu - 1) {
6281 cut = enda - starta + 1;
6293 else if (cyclicut != 0) {
6298 editnurb, &nu1->
bp[
b * nu1->
pntsu + cut], &nu->
bp[
b * nu->
pntsu], cyclicut);
6309 cut = enda - starta + 1;
6313 if (nu1 !=
nullptr) {
6320 if (starta != 0 || enda != nu->
pntsu - 1) {
6321 nu1->
flagu &= ~CU_NURB_CYCLIC;
6355 for (a = 0, bp = nu->
bp; a < nu->
pntsv; a++, bp += nu->
pntsu) {
6356 if (!(bp->f1 &
SELECT)) {
6361 if (a < nu->pntsv - 1) {
6365 else if (a < nu->pntsv - 1 && !((bp + nu->
pntsu)->f1 &
SELECT)) {
6372 if (starta <= 1 && a == nu->pntsv - 1) {
6374 if (starta == 1 && enda != a) {
6375 nu->
flagv &= ~CU_NURB_CYCLIC;
6380 cut = enda - starta + 1;
6383 else if (starta == 0) {
6386 cut = enda - starta + 1;
6394 starta = nu->
pntsv - 1;
6406 else if (enda == nu->
pntsv - 1) {
6409 cut = enda - starta + 1;
6418 else if (cyclicut != 0) {
6432 cut = enda - starta + 1;
6436 if (nu1 !=
nullptr) {
6440 if (starta != 0 || enda != nu->
pntsv - 1) {
6441 nu1->
flagv &= ~CU_NURB_CYCLIC;
6484 for (
b = 0, bezt1 = nu->
bezt;
b < nu->
pntsu;
b++, bezt1++) {
6502 if (nu->
pntsv > 1) {
6525 bool changed_multi =
false;
6527 for (
Object *obedit : objects) {
6529 bool changed =
false;
6547 changed_multi =
true;
6559 if (changed_multi) {
6568 {0,
nullptr, 0,
nullptr,
nullptr},
6597 ot->
description =
"Delete selected control points or segments";
6633 const uint span_len,
6634 const uint span_step[2])
6636 int i_span_edge_len = span_len + 1;
6639 const int points_len = ((cu->
resolu - 1) * i_span_edge_len) + 1;
6640 float *points =
static_cast<float *
>(
MEM_mallocN(points_len * dims *
sizeof(
float), __func__));
6641 float *points_stride = points;
6642 const int points_stride_len = (cu->
resolu - 1);
6644 for (
int segment = 0; segment < i_span_edge_len; segment++) {
6648 for (
int axis = 0; axis < dims; axis++) {
6650 bezt_a->
vec[2][axis],
6651 bezt_b->
vec[0][axis],
6652 bezt_b->
vec[1][axis],
6653 points_stride + axis,
6655 dims *
sizeof(
float));
6658 points_stride += dims * points_stride_len;
6661 BLI_assert(points_stride + dims == points + (points_len * dims));
6663 float tan_l[3], tan_r[3], error_sq_dummy;
6664 uint error_index_dummy;
6671 curve_fit_cubic_to_points_single_fl(points,
6681 &error_index_dummy);
6702 for (
Object *obedit : objects) {
6750 ot->
name =
"Dissolve Vertices";
6751 ot->
description =
"Delete selected control points, correcting surrounding handles";
6752 ot->
idname =
"CURVE_OT_dissolve_verts";
6773 for (i = nu->
pntsu, bezt = nu->
bezt; i--; bezt++) {
6774 if (bezt->
f2 & flag_test) {
6785 const float error_sq_max =
FLT_MAX;
6787 bool all_supported_multi =
true;
6793 for (
Object *obedit : objects) {
6795 bool all_supported =
true;
6796 bool changed =
false;
6804 const int error_target_len =
max_ii(2, nu->
pntsu * ratio);
6805 if (error_target_len != nu->
pntsu) {
6812 all_supported =
false;
6817 if (all_supported ==
false) {
6818 all_supported_multi =
false;
6832 if (all_supported_multi ==
false) {
6842 ot->
name =
"Decimate Curve";
6873 for (
Object *obedit : objects) {
6886 nu->
flag &= ~CU_SMOOTH;
6902 ot->
name =
"Shade Smooth";
6903 ot->
idname =
"CURVE_OT_shade_smooth";
6918 ot->
idname =
"CURVE_OT_shade_flat";
6944 float imat[4][4], cmat[4][4];
6949 if (ob_iter == ob_active) {
6971 if (ob_iter->type == ob_active->
type) {
6972 if (ob_iter != ob_active) {
6974 cu =
static_cast<Curve *
>(ob_iter->data);
6978 mul_m4_m4m4(cmat, imat, ob_iter->object_to_world().ptr());
6981 bool do_radius =
false;
6982 float compensate_radius = 0.0f;
6999 if ((bezt = newnu->
bezt)) {
7004 bezt->
radius *= compensate_radius;
7014 if ((bp = newnu->
bp)) {
7030 cu =
static_cast<Curve *
>(ob_active->
data);
7066 for (
Object *obedit : objects) {
7117 ot->
idname =
"CURVE_OT_tilt_clear";
7118 ot->
description =
"Clear the tilt of selected control points";
7163 float min[3], max[3], texspace_size[3], texspace_location[3];
7173 texspace_size[0] = (max[0] -
min[0]) / 2.0f;
7174 texspace_size[1] = (max[1] -
min[1]) / 2.0f;
7175 texspace_size[2] = (max[2] -
min[2]) / 2.0f;
7177 for (a = 0; a < 3; a++) {
7178 if (texspace_size[a] == 0.0f) {
7179 texspace_size[a] = 1.0f;
7181 else if (texspace_size[a] > 0.0f && texspace_size[a] < 0.00001f) {
7182 texspace_size[a] = 0.00001f;
7184 else if (texspace_size[a] < 0.0f && texspace_size[a] > -0.00001f) {
7185 texspace_size[a] = -0.00001f;
7189 copy_v3_v3(curve->texspace_location, texspace_location);
7190 copy_v3_v3(curve->texspace_size, texspace_size);
7192 curve->texspace_flag &= ~CU_TEXSPACE_FLAG_AUTO;
7203 ot->
name =
"Match Texture Space";
7204 ot->
idname =
"CURVE_OT_match_texture_space";
7205 ot->
description =
"Match texture space to object's bounding box";
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Blender kernel action and pose functionality.
void BKE_action_groups_reconstruct(bAction *act)
void action_groups_remove_channel(bAction *act, FCurve *fcu)
AnimData * BKE_animdata_from_id(const ID *id)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
@ NURB_HANDLE_TEST_KNOT_OR_EACH
@ NURB_HANDLE_TEST_KNOT_ONLY
bool BKE_nurb_type_convert(Nurb *nu, short type, bool use_handles, const char **r_err_msg)
void BKE_nurb_handle_calc_simple_auto(Nurb *nu, BezTriple *bezt)
void BKE_nurbList_handles_set(ListBase *editnurb, eNurbHandleTest_Mode handle_mode, char code)
void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt)
void BKE_nurb_handles_calc(Nurb *nu)
void BKE_curve_editNurb_free(Curve *cu)
void BKE_nurb_project_2d(Nurb *nu)
void BKE_curve_decimate_nurb(Nurb *nu, unsigned int resolu, float error_sq_max, unsigned int error_target_len)
void BKE_nurb_free(Nurb *nu)
void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu)
Nurb * BKE_curve_nurb_active_get(Curve *cu)
void BKE_curve_editNurb_keyIndex_free(GHash **keyindex)
void BKE_nurbList_handles_recalculate(ListBase *editnurb, bool calc_length, uint8_t flag)
void BKE_curve_nurb_vert_active_set(Curve *cu, const Nurb *nu, const void *vert)
void BKE_nurb_knot_calc_u(Nurb *nu)
void BKE_curve_dimension_update(Curve *cu)
void * BKE_curve_vert_active_get(Curve *cu)
bool BKE_nurb_order_clamp_u(Nurb *nu)
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
void BKE_nurbList_free(ListBase *lb)
void BKE_nurb_handle_calc(BezTriple *bezt, BezTriple *prev, BezTriple *next, bool is_fcurve, char smoothing)
void BKE_nurb_knot_calc_v(Nurb *nu)
void BKE_nurb_direction_switch(Nurb *nu)
void BKE_curve_nurb_vert_active_validate(Curve *cu)
bool BKE_curve_nurb_vert_active_get(Curve *cu, Nurb **r_nu, void **r_vert)
void BKE_nurb_bezierPoints_add(Nurb *nu, int number)
BPoint * BKE_nurb_bpoint_get_next(Nurb *nu, BPoint *bp)
void BKE_nurbList_flag_set(ListBase *editnurb, uint8_t flag, bool set)
BezTriple * BKE_nurb_bezt_get_next(Nurb *nu, BezTriple *bezt)
Nurb * BKE_nurb_duplicate(const Nurb *nu)
bool BKE_nurb_order_clamp_v(Nurb *nu)
void BKE_curve_editNurb_keyIndex_delCV(GHash *keyindex, const void *cv)
Nurb * BKE_nurb_copy(Nurb *src, int pntsu, int pntsv)
display list (or rather multi purpose list) stuff.
void BKE_displist_minmax(const struct ListBase *dispbase, float min[3], float max[3])
void BKE_fcurve_free(FCurve *fcu)
KeyBlock * BKE_keyblock_from_object(Object *ob)
int BKE_keyblock_curve_element_count(const ListBase *nurb)
KeyBlock * BKE_keyblock_find_by_index(Key *key, int index)
void BKE_keyblock_convert_to_curve(KeyBlock *kb, Curve *cu, ListBase *nurb)
std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys(const Key *key, int index)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
ID * BKE_id_copy(Main *bmain, const ID *id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Generic array manipulation API.
#define BLI_array_iter_span(arr, arr_len, use_wrap, use_delimit_bounds, test_fn, user_data, span_step, r_span_len)
#define BLI_assert_unreachable()
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_ptr_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
MINLINE int mod_i(int i, int n)
MINLINE float interpf(float target, float origin, float t)
bool isect_ray_plane_v3_factor(const float ray_origin[3], const float ray_direction[3], const float plane_co[3], const float plane_no[3], float *r_lambda)
float mat4_to_scale(const float mat[4][4])
void mul_m3_v3(const float M[3][3], float r[3])
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])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void unit_m4(float m[4][4])
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])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void invert_m4_m4_safe_ortho(float inverse[4][4], const float mat[4][4])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_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 mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define SNPRINTF(dst, format,...)
#define INIT_MINMAX(min, max)
#define STREQLEN(a, b, n)
#define UNUSED_VARS_NDEBUG(...)
#define IN_RANGE_INCL(a, b, c)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)
#define BEZT_SEL_ALL(bezt)
#define BEZT_DESEL_ALL(bezt)
struct BezTriple BezTriple
#define KEYELEM_FLOAT_LEN_BEZTRIPLE
#define KEYELEM_FLOAT_LEN_BPOINT
Object is a sort of wrapper for general info.
@ SCE_SNAP_TARGET_NOT_ACTIVE
@ SCE_SNAP_INDIVIDUAL_PROJECT
#define OBJECT_ADD_SIZE_MAXF
void ED_outliner_select_sync_from_object_tag(bContext *C)
bool ED_operator_editsurfcurve(bContext *C)
bool ED_operator_editcurve(bContext *C)
bool ED_operator_editsurf(bContext *C)
SnapObjectContext * ED_transform_snap_object_context_create(Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
eSnapMode ED_transform_snap_object_project_view3d(SnapObjectContext *sctx, Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const eSnapMode snap_to, const SnapObjectParams *params, const float init_co[3], const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float r_out[3])
RegionView3D * ED_view3d_context_rv3d(bContext *C)
void ED_view3d_win_to_3d_int(const View3D *v3d, const ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void view3d_operator_needs_opengl(const bContext *C)
Read Guarded memory(de)allocation.
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname)
@ OPTYPE_DEPENDS_ON_CURSOR
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool contains(const Key &key) const
constexpr bool is_empty() const
void append(const T &value)
bool is_action_legacy() const
local_group_size(16, 16) .push_constant(Type b
bool select_bpoint(BPoint *bp, bool selstatus, uint8_t flag, bool hidden)
bool select_beztriple(BezTriple *bezt, bool selstatus, uint8_t flag, eVisible_Types hidden)
void ED_curve_nurb_vert_selected_find(Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp)
bool ED_curve_pick_vert_ex(ViewContext *vc, bool select, int dist_px, Nurb **r_nurb, BezTriple **r_bezt, BPoint **r_bp, short *r_handle, Base **r_base)
const Depsgraph * depsgraph
static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
static void keyIndex_updateBP(EditNurb *editnurb, BPoint *bp, BPoint *newbp, int count)
static int hide_exec(bContext *C, wmOperator *op)
static bool isNurbselV(Nurb *nu, int *u, int flag)
static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split)
static void keyIndex_swap(EditNurb *editnurb, void *a, void *b)
static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit)
void selectend_nurb(Object *obedit, enum eEndPoint_Types selfirst, bool doswap, bool selstatus)
static int * init_index_map(Object *obedit, int *r_old_totvert)
int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
static int add_vertex_exec(bContext *C, wmOperator *op)
static int smooth_exec(bContext *C, wmOperator *op)
static bool is_u_selected(Nurb *nu, int u)
static int shade_smooth_exec(bContext *C, wmOperator *op)
bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag)
void CURVE_OT_dissolve_verts(wmOperatorType *ot)
static CVKeyIndex * popCVKeyIndex(EditNurb *editnurb, const void *cv)
static void weightflagNurb(ListBase *editnurb, short flag, float w)
void CURVE_OT_match_texture_space(wmOperatorType *ot)
void CURVE_OT_switch_direction(wmOperatorType *ot)
static const EnumPropertyItem * rna_curve_delete_type_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static bool test_bezt_is_sel_any(const void *bezt_v, void *user_data)
void CURVE_OT_spline_weight_set(wmOperatorType *ot)
static void calc_duplicate_actnurb(const ListBase *editnurb, const ListBase *newnurb, Curve *cu)
static bool calc_duplicate_actvert(const ListBase *editnurb, const ListBase *newnurb, Curve *cu, int start, int end, int vert)
static int set_spline_type_exec(bContext *C, wmOperator *op)
static void keyIndex_updateBezt(EditNurb *editnurb, BezTriple *bezt, BezTriple *newbezt, int count)
static void keyIndex_switchDirection(EditNurb *editnurb, Nurb *nu)
void CURVE_OT_extrude(wmOperatorType *ot)
void CURVE_OT_make_segment(wmOperatorType *ot)
void ED_curve_keyindex_update_nurb(EditNurb *editnurb, Nurb *nu, Nurb *newnu)
void CURVE_OT_hide(wmOperatorType *ot)
void CURVE_OT_normals_make_consistent(wmOperatorType *ot)
static void curve_smooth_value(ListBase *editnurb, const int bezt_offsetof, const int bp_offset)
static CVKeyIndex * init_cvKeyIndex(void *cv, int key_index, int nu_index, int pt_index, int vertex_index)
static NurbDim editnurb_find_max_points_num(const EditNurb *editnurb)
void CURVE_OT_shade_smooth(wmOperatorType *ot)
void ed_editnurb_translate_flag(ListBase *editnurb, uint8_t flag, const float vec[3], bool is_2d)
static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts)
static void calc_keyHandles(ListBase *nurb, float *key)
void ED_curve_beztcpy(EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
static int switch_direction_exec(bContext *C, wmOperator *)
static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
void CURVE_OT_delete(wmOperatorType *ot)
static void rotateflagNurb(ListBase *editnurb, short flag, const float cent[3], const float rotmat[3][3])
static int curve_smooth_tilt_exec(bContext *C, wmOperator *op)
void ED_curve_editnurb_make(Object *obedit)
static int curve_smooth_radius_exec(bContext *C, wmOperator *op)
static void bezt_to_key(BezTriple *bezt, float *key)
@ CURVE_MERGE_ERR_RESOLUTION_ALL
@ CURVE_MERGE_ERR_FEW_SELECTION
@ CURVE_MERGE_ERR_RESOLUTION_SOME
void CURVE_OT_spin(wmOperatorType *ot)
static bool nurb_bezt_flag_any(const Nurb *nu, const char flag_test)
static void make_selection_list_nurb(View3D *v3d, ListBase *editnurb, ListBase *nsortbase)
static int set_handle_type_exec(bContext *C, wmOperator *op)
static CVKeyIndex * getCVKeyIndex(EditNurb *editnurb, const void *cv)
static int clear_tilt_exec(bContext *C, wmOperator *op)
void CURVE_OT_spline_type_set(wmOperatorType *ot)
static bool match_texture_space_poll(bContext *C)
void CURVE_OT_shade_flat(wmOperatorType *ot)
static int curve_decimate_exec(bContext *C, wmOperator *op)
static int curve_dissolve_exec(bContext *C, wmOperator *)
static void ed_curve_delete_selected(Object *obedit, View3D *v3d)
static void keyData_switchDirectionNurb(Curve *cu, Nurb *nu)
void ED_curve_editnurb_free(Object *obedit)
static bool isNurbselU(Nurb *nu, int *v, int flag)
static int toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent *)
void CURVE_OT_vertex_add(wmOperatorType *ot)
static int reveal_exec(bContext *C, wmOperator *op)
static int merge_nurb(View3D *v3d, Object *obedit)
static void smooth_single_bp(BPoint *bp, const BPoint *bp_orig_prev, const BPoint *bp_orig_next, float factor)
void ed_dissolve_bez_segment(BezTriple *bezt_prev, BezTriple *bezt_next, const Nurb *nu, const Curve *cu, const uint span_len, const uint span_step[2])
static void adduplicateflagNurb(Object *obedit, View3D *v3d, ListBase *newnurb, const uint8_t flag, const bool split)
static int getKeyIndexOrig_keyIndex(EditNurb *editnurb, void *cv)
static int match_texture_space_exec(bContext *C, wmOperator *)
ListBase * object_editcurve_get(Object *ob)
static void switch_keys_direction(Curve *cu, Nurb *actnu)
static void key_to_bezt(float *key, BezTriple *basebezt, BezTriple *bezt)
static bool curve_is_animated(Curve *cu)
static void select_bpoints(BPoint *bp, const int stride, const int count, const bool selstatus, const uint8_t flag, const bool hidden)
static int curve_smooth_weight_exec(bContext *C, wmOperator *)
static int make_segment_exec(bContext *C, wmOperator *op)
static int spin_invoke(bContext *C, wmOperator *op, const wmEvent *)
KeyBlock * ED_curve_get_edit_shape_key(const Curve *cu)
static int curve_split_exec(bContext *C, wmOperator *op)
int ED_curve_updateAnimPaths(Main *bmain, Curve *cu)
static void switchdirection_knots(float *base, int tot)
static int duplicate_exec(bContext *C, wmOperator *op)
static bool curve_delete_vertices(Object *obedit, View3D *v3d)
bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
void CURVE_OT_separate(wmOperatorType *ot)
void CURVE_OT_smooth_tilt(wmOperatorType *ot)
static void keyIndex_delNurbList(EditNurb *editnurb, ListBase *nubase)
void CURVE_OT_reveal(wmOperatorType *ot)
static int spin_exec(bContext *C, wmOperator *op)
static int subdivide_exec(bContext *C, wmOperator *op)
static int toggle_cyclic_exec(bContext *C, wmOperator *op)
void CURVE_OT_cyclic_toggle(wmOperatorType *ot)
void CURVE_OT_duplicate(wmOperatorType *ot)
static void smooth_single_bezt(BezTriple *bezt, const BezTriple *bezt_orig_prev, const BezTriple *bezt_orig_next, float factor)
bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], const int dist_px, const SelectPick_Params *params)
static void keyIndex_updateCV(EditNurb *editnurb, char *cv, char *newcv, int count, int size)
static void fcurve_path_rename(const char *orig_rna_path, const char *rna_path, const blender::Span< FCurve * > orig_curves, blender::Set< FCurve * > &processed_fcurves)
void CURVE_OT_smooth_radius(wmOperatorType *ot)
static int curve_extrude_exec(bContext *C, wmOperator *)
void ED_curve_editnurb_load(Main *bmain, Object *obedit)
void ED_curve_bpcpy(EditNurb *editnurb, BPoint *dst, BPoint *src, int count)
static blender::Vector< FCurve * > curve_rename_fcurves(Curve *cu, blender::Span< FCurve * > orig_curves)
static int set_goal_weight_exec(bContext *C, wmOperator *op)
static int curve_normals_make_consistent_exec(bContext *C, wmOperator *op)
static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
GHash * ED_curve_keyindex_hash_duplicate(GHash *keyindex)
void CURVE_OT_smooth(wmOperatorType *ot)
static void rotate_direction_nurb(Nurb *nu)
bool ed_editnurb_spin(float viewmat[4][4], View3D *v3d, Object *obedit, const float axis[3], const float cent[3])
static int separate_exec(bContext *C, wmOperator *op)
void CURVE_OT_split(wmOperatorType *ot)
static int set_radius_exec(bContext *C, wmOperator *op)
int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, View3D *v3d, const float location_init[3])
void CURVE_OT_smooth_weight(wmOperatorType *ot)
void CURVE_OT_radius_set(wmOperatorType *ot)
static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void keyIndex_delBP(EditNurb *editnurb, BPoint *bp)
static void ed_surf_delete_selected(Object *obedit)
static int curve_delete_exec(bContext *C, wmOperator *op)
static bool merge_2_nurb(Curve *cu, ListBase *editnurb, Nurb *nu1, Nurb *nu2)
void CURVE_OT_decimate(wmOperatorType *ot)
static BPoint * getKeyIndexOrig_bp(EditNurb *editnurb, BPoint *bp)
static BezTriple * getKeyIndexOrig_bezt(EditNurb *editnurb, const BezTriple *bezt)
static const EnumPropertyItem curve_delete_type_items[]
static int sel_to_copy_ints(const BPoint *bp, const int next_j, const int max_j, const int next_i, const int max_i, const uint8_t flag, int copy_intervals[], int *interval_count, bool *out_is_first_sel)
void CURVE_OT_handle_type_set(wmOperatorType *ot)
void CURVE_OT_subdivide(wmOperatorType *ot)
static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
static void keyIndex_delBezt(EditNurb *editnurb, BezTriple *bezt)
void CURVE_OT_tilt_clear(wmOperatorType *ot)
static bool is_cyclic(const Nurb *nu)
bool ED_curve_select_check(const View3D *v3d, const EditNurb *editnurb)
bool ED_curve_nurb_select_check(const View3D *v3d, const Nurb *nu)
bool ED_curve_deselect_all(EditNurb *editnurb)
int ED_curve_nurb_select_count(const View3D *v3d, const Nurb *nu)
draw_view in_light_buf[] float
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
void *(* MEM_mallocN)(size_t len, const char *str)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
static void clear(Message &msg)
Vector< FCurve * > fcurves_for_assigned_action(AnimData *adt)
bool action_fcurve_remove(Action &action, FCurve &fcu)
bool shape_key_report_if_locked(const Object *obedit, ReportList *reports)
void base_activate(bContext *C, Base *base)
Base * add_duplicate(Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base, eDupli_ID_Flags dupflag)
void base_free_and_unlink(Main *bmain, Scene *scene, Object *ob)
Vector< T * > listbase_to_vector(ListBase &list)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
ObjectRuntimeHandle * runtime
struct ToolSettings * toolsettings
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_flag_only_pass_through_on_press(int retval, const wmEvent *event)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)