69#include "curve_fit_nd.h"
115void printknots(
Object *obedit)
121 for (nu = editnurb->
first; nu; nu = nu->
next) {
125 for (a = 0; a <
num; a++) {
131 for (a = 0; a <
num; a++) {
147 void *cv,
int key_index,
int nu_index,
int pt_index,
int vertex_index)
169 int a, key_index = 0, nu_index = 0, pt_index = 0, vertex_index = 0;
181 origbezt = orignu->
bezt;
190 *origbezt_cpy = *origbezt;
191 keyIndex =
init_cvKeyIndex(origbezt_cpy, key_index, nu_index, pt_index, vertex_index);
211 *origbp_cpy = *origbp;
212 keyIndex =
init_cvKeyIndex(origbp_cpy, key_index, nu_index, pt_index, vertex_index);
223 orignu = orignu->
next;
331 if (editnurb->
keyindex ==
nullptr) {
392 bezt2 = bezt1 + (a - 1);
408 if (bezt1 != bezt2) {
423 if (nu->
pntsv == 1) {
428 while (bp1 != bp2 && a > 0) {
459 while (bp1 != bp2 && a > 0) {
492 fp =
static_cast<float *
>(currkey->data);
502 *(fp + 9) = -*(fp + 9);
518 *(fp + 3) = -*(fp + 3);
570 memcpy(bezt, basebezt,
sizeof(
BezTriple));
571 memcpy(bezt->
vec, key,
sizeof(
float[9]));
578 memcpy(key, bezt->
vec,
sizeof(
float[9]));
593 float *startfp, *prevfp, *nextfp;
600 prevp = bezt + (a - 1);
656 if (cu->
key ==
nullptr) {
668 float (*ofs)[3] =
nullptr;
669 std::optional<blender::Array<bool>> dependent;
670 const float *oldkey, *ofp;
685 totvec += nu->
pntsu * 4;
703 for (j = 0; j < 3; j++) {
736 const bool apply_offset = (ofs && (currkey != actkey) && (*dependent)[currkey_i]);
738 float *fp = newkey =
static_cast<float *
>(
740 ofp = oldkey =
static_cast<float *
>(currkey->data);
746 newnu =
static_cast<Nurb *
>(newnurbs->
first);
749 if (currkey == actkey) {
750 const bool restore = actkey != cu->
key->
refkey;
760 for (j = 0; j < 3; j++,
i++) {
763 if (restore && oldbezt) {
770 if (restore && oldbezt) {
793 if (restore && oldbp) {
819 curofp = ofp + index;
821 for (j = 0; j < 3; j++,
i++) {
841 for (j = 0; j < 3; j++,
i++) {
859 curofp = ofp + index;
892 currkey->totelem = totvert;
896 currkey->data = newkey;
919 const char *rna_path,
923 const int len = strlen(orig_rna_path);
925 for (
FCurve *fcu : orig_curves) {
926 if (processed_fcurves.
contains(fcu)) {
929 if (!
STREQLEN(fcu->rna_path, orig_rna_path,
len)) {
933 processed_fcurves.
add(fcu);
935 const char *suffix = fcu->rna_path +
len;
936 char *new_rna_path =
BLI_sprintfN(
"%s%s", rna_path, suffix);
938 fcu->rna_path = new_rna_path;
959 char rna_path[64], orig_rna_path[64];
972 SNPRINTF_UTF8(rna_path,
"splines[%d].bezier_points[%d]", nu_index, pt_index);
977 "splines[%d].bezier_points[%d]",
982 char handle_path[64], orig_handle_path[64];
983 SNPRINTF_UTF8(orig_handle_path,
"%s.handle_left", orig_rna_path);
987 SNPRINTF_UTF8(orig_handle_path,
"%s.handle_right", orig_rna_path);
1018 SNPRINTF_UTF8(rna_path,
"splines[%d].points[%d]", nu_index, pt_index);
1023 orig_rna_path,
"splines[%d].points[%d]", keyIndex->
nu_index, keyIndex->
pt_index);
1049 for (
FCurve *fcu : orig_curves) {
1050 if (processed_fcurves.
contains(fcu)) {
1054 if (
STRPREFIX(fcu->rna_path,
"splines")) {
1055 const char *ch = strchr(fcu->rna_path,
'.');
1058 fcurves_to_remove.
append(fcu);
1084 for (
FCurve *fcu : orig_curves) {
1085 if (processed_fcurves.
contains(fcu)) {
1088 if (
STRPREFIX(fcu->rna_path,
"splines")) {
1089 fcurves_to_remove.
append(fcu);
1093 return fcurves_to_remove;
1109 if (adt->
action !=
nullptr) {
1117 for (
FCurve *fcurve : fcurves_to_remove) {
1118 if (is_action_legacy) {
1136 for (
FCurve *driver : fcurves_to_remove) {
1160 int *old_to_new_map;
1162 int old_totvert = 0;
1165 old_totvert += nu->
pntsu * 3;
1173 for (
int i = 0;
i < old_totvert;
i++) {
1174 old_to_new_map[
i] = -1;
1177 int vertex_index = 0;
1185 if (keyIndex && keyIndex->
vertex_index + 2 < old_totvert) {
1187 old_to_new_map[keyIndex->
vertex_index] = vertex_index + 2;
1188 old_to_new_map[keyIndex->
vertex_index + 1] = vertex_index + 1;
1189 old_to_new_map[keyIndex->
vertex_index + 2] = vertex_index;
1193 old_to_new_map[keyIndex->
vertex_index + 1] = vertex_index + 1;
1194 old_to_new_map[keyIndex->
vertex_index + 2] = vertex_index + 2;
1216 *r_old_totvert = old_totvert;
1217 return old_to_new_map;
1224 int *old_to_new_map =
nullptr;
1227 if (editnurb->
keyindex ==
nullptr) {
1237 if ((object->parent) && (object->parent->data == curve) &&
1240 if (old_to_new_map ==
nullptr) {
1244 if (object->par1 < old_totvert) {
1245 index = old_to_new_map[
object->par1];
1247 object->par1 = index;
1250 if (object->par2 < old_totvert) {
1251 index = old_to_new_map[
object->par2];
1253 object->par2 = index;
1256 if (object->par3 < old_totvert) {
1257 index = old_to_new_map[
object->par3];
1259 object->par3 = index;
1263 if (object->data == curve) {
1269 if (old_to_new_map ==
nullptr) {
1274 if (hmd->
indexar[
i] < old_totvert) {
1275 index = old_to_new_map[hmd->
indexar[
i]];
1290 if (old_to_new_map !=
nullptr) {
1299 if (obedit ==
nullptr) {
1305 ListBase newnurb = {
nullptr,
nullptr}, oldnurb = cu->
nurb;
1344 undo_editmode_clear();
1399 int error_vertex_keys;
1407 for (
Base *oldbase : bases) {
1410 Curve *oldcu, *newcu;
1412 ListBase newnurb = {
nullptr,
nullptr};
1414 oldob = oldbase->object;
1415 oldcu =
static_cast<Curve *
>(oldob->
data);
1418 status.error_vertex_keys++;
1474 const int tot_errors =
status.error_vertex_keys +
status.error_generic;
1475 if (tot_errors > 0) {
1484 if (((
status.error_vertex_keys ? 1 : 0) + (
status.error_generic ? 1 : 0)) > 1) {
1489 if (
status.error_vertex_keys) {
1507 ot->name =
"Separate";
1508 ot->idname =
"CURVE_OT_separate";
1509 ot->description =
"Separate selected points from connected unselected points into a new object";
1531 bool changed =
false;
1532 int count_failed = 0;
1536 for (
Object *obedit : objects) {
1543 ListBase newnurb = {
nullptr,
nullptr};
1568 if (changed ==
false) {
1569 if (count_failed != 0) {
1581 ot->idname =
"CURVE_OT_split";
1582 ot->description =
"Split off selected points from connected unselected points";
1608 for (a = 0; a < nu->
pntsu; a++, bp++) {
1613 if (sel == nu->
pntsu) {
1616 else if (sel >= 1) {
1633 for (a = 0; a < nu->
pntsu; a++) {
1637 if (bp->f1 &
flag) {
1641 if (sel == nu->
pntsv) {
1644 else if (sel >= 1) {
1655 const float cent[3],
1656 const float rotmat[3][3])
1744 BPoint *bp, *bpn, *newbp;
1745 int a,
b, newu, newv;
1776 newv = nu->
pntsv - newv;
1777 if (newv != nu->
pntsv) {
1802 newu = nu->
pntsu - newu;
1803 if (newu != nu->
pntsu) {
1808 for (a = 0; a < nu->
pntsu; a++, bp++) {
1821 if (newu == 1 && nu->
pntsv > 1) {
1846 int a, type, nuindex = 0;
1865 if (cu->
actnu == nuindex) {
1891 if (cu->
actnu == nuindex) {
1907 clamp_nurb_order_u(nu);
1917 for (a = 0; a < nu->
pntsu; a++) {
1919 memmove(bezt, bezt + 1, (nu->
pntsu - a - 1) *
sizeof(
BezTriple));
1939 else if (nu->
pntsv == 1) {
1942 for (a = 0; a < nu->
pntsu; a++) {
1944 memmove(bp, bp + 1, (nu->
pntsu - a - 1) *
sizeof(
BPoint));
1966 clamp_nurb_order_u(nu);
1979 const bool selstatus,
2002 int copy_intervals[],
2003 int *interval_count,
2004 bool *out_is_first_sel)
2008 int selected_leg_count = 0;
2010 int selected_in_prev_leg = -1;
2013 bool is_first_sel =
false;
2014 bool is_last_sel =
false;
2016 for (
int j = 0; j < max_j; j++, bp_j += next_j) {
2017 const BPoint *bp_j_i = bp_j;
2018 int selected_in_curr_leg = 0;
2019 for (
int i = 0;
i <
max_i;
i++, bp_j_i += next_i) {
2021 selected_in_curr_leg++;
2024 if (selected_in_curr_leg ==
max_i) {
2025 selected_leg_count++;
2027 is_first_sel =
true;
2029 else if (j + 1 == max_j) {
2033 else if (not_full == -1) {
2034 not_full = selected_in_curr_leg;
2037 else if (not_full != selected_in_curr_leg) {
2041 if (selected_in_prev_leg != selected_in_curr_leg) {
2042 copy_intervals[ins] = selected_in_curr_leg ==
max_i || j == 0 ? j : j - 1;
2044 selected_in_prev_leg = selected_in_curr_leg;
2046 copy_intervals[ins] = j;
2048 if (selected_leg_count &&
2051 (selected_leg_count < max_j || max_j == 1))
2055 if (is_first_sel && (copy_intervals[0] < copy_intervals[1] || max_j == 1)) {
2056 memmove(copy_intervals + 1, copy_intervals, (ins + 1) *
sizeof(copy_intervals[0]));
2057 copy_intervals[0] = 0;
2059 is_first_sel =
false;
2062 if (is_last_sel && copy_intervals[ins - 1] < copy_intervals[ins]) {
2063 copy_intervals[ins + 1] = copy_intervals[ins];
2067 *interval_count = ins;
2068 *out_is_first_sel = ins > 1 ? is_first_sel :
false;
2069 return selected_leg_count;
2098 bool is_first_sel_u;
2103 if (selected_us == -1) {
2107 bool is_first_sel_v;
2109 const bool is_point = nu->
pntsu == 1;
2110 const bool is_curve = nu->
pntsv == 1;
2111 const bool extrude_every_u_point = selected_us == nu->
pntsu;
2112 if (is_point || (is_curve && !extrude_every_u_point)) {
2113 intvls_v[0] = intvls_v[1] = 0;
2115 is_first_sel_v =
false;
2129 const int new_pntsu = nu->
pntsu + intvl_cnt_u - 1;
2130 const int new_pntsv = nu->
pntsv + intvl_cnt_v - 1;
2132 BPoint *new_bp_v = new_bp;
2134 bool selected_v = is_first_sel_v;
2135 for (
int j = 1; j <= intvl_cnt_v; j++, selected_v = !selected_v) {
2137 for (
int v_j = intvls_v[j - 1]; v_j <= intvls_v[j];
2138 v_j++, new_bp_v += new_pntsu, old_bp_v += nu->
pntsu)
2140 BPoint *new_bp_u_v = new_bp_v;
2141 bool selected_u = is_first_sel_u;
2142 for (
int i = 1;
i <= intvl_cnt_u;
i++, selected_u = !selected_u) {
2143 const int copy_from = intvls_u[
i - 1];
2144 const int copy_to = intvls_u[
i];
2145 const int copy_count = copy_to - copy_from + 1;
2146 const bool sel_status = selected_u || selected_v ?
true :
false;
2147 ED_curve_bpcpy(editnurb, new_bp_u_v, old_bp_v + copy_from, copy_count);
2149 new_bp_u_v += copy_count;
2156 nu->
pntsu = new_pntsu;
2157 if (nu->
pntsv == 1 && new_pntsv > 1) {
2160 nu->
pntsv = new_pntsv;
2184 if ((start <= cu->actvert) && (end > cu->
actvert)) {
2198 BPoint *bp, *bp1, *bp2, *bp3;
2200 int a,
b, c, starta, enda, diffa, cyclicu, cyclicv, newu, newv;
2205 cyclicu = cyclicv = 0;
2207 for (a = 0, bezt = nu->
bezt; a < nu->pntsu; a++, bezt++) {
2215 if (a >= nu->
pntsu - 1) {
2221 if (enda >= starta) {
2222 newu = diffa = enda - starta + 1;
2228 if (enda == nu->
pntsu - 1) {
2233 editnurb, newnurb, cu, starta, starta + diffa, cu->
actvert - starta);
2238 if (newu != diffa) {
2242 editnurb, newnurb, cu, 0, cyclicu, newu - cyclicu + cu->
actvert);
2247 if (newu != nu->
pntsu) {
2276 else if (nu->
pntsv == 1) {
2277 for (a = 0, bp = nu->
bp; a < nu->pntsu; a++, bp++) {
2285 if (a >= nu->
pntsu - 1) {
2291 if (enda >= starta) {
2292 newu = diffa = enda - starta + 1;
2298 if (enda == nu->
pntsu - 1) {
2303 editnurb, newnurb, cu, starta, starta + diffa, cu->
actvert - starta);
2307 memcpy(newnu->
bp, &nu->
bp[starta], diffa *
sizeof(
BPoint));
2308 if (newu != diffa) {
2309 memcpy(&newnu->
bp[diffa], nu->
bp, cyclicu *
sizeof(
BPoint));
2312 editnurb, newnurb, cu, 0, cyclicu, newu - cyclicu + cu->
actvert);
2317 if (newu != nu->
pntsu) {
2336 memcpy(newnu->
bp, nu->
bp, cyclicu *
sizeof(
BPoint));
2352 for (a = 0; a < nu->
pntsv; a++) {
2353 for (
b = 0;
b < nu->
pntsu;
b++, bp++) {
2361 for (a = 0; a < nu->
pntsu; a++) {
2363 if (
ELEM(newv, 0, usel[a])) {
2375 if ((newu == 0 || newv == 0) ||
2379 printf(
"Can't duplicate Nurb\n");
2383 for (a = 0, bp1 = nu->
bp; a < nu->pntsu * nu->
pntsv; a++, bp1++) {
2391 for (c = a / nu->
pntsu, bp3 = bp2; c < nu->pntsv; c++, bp3 += nu->
pntsu) {
2410 if ((newu + newv) > 2) {
2420 if (cyclicu != 0 || cyclicv != 0) {
2425 if (a + newu == nu->
pntsu && cyclicu != 0) {
2428 for (
b = 0;
b < newv;
b++) {
2429 memcpy(&newnu->
bp[
b * newnu->
pntsu],
2432 memcpy(&newnu->
bp[
b * newnu->
pntsu + newu],
2434 cyclicu *
sizeof(
BPoint));
2442 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2443 starta =
b * nu->
pntsu + a;
2468 cyclicu = cyclicv = 0;
2470 else if ((a / nu->
pntsu) + newv == nu->
pntsv && cyclicv != 0) {
2473 memcpy(newnu->
bp, &nu->
bp[a], newu * newv *
sizeof(
BPoint));
2474 memcpy(&newnu->
bp[newu * newv], nu->
bp, newu * cyclicv *
sizeof(
BPoint));
2479 editnurb, newnurb, cu, cu->
actvert, a, (newu * newv) + cu->
actvert);
2481 cyclicu = cyclicv = 0;
2485 for (
b = 0;
b < newv;
b++) {
2486 memcpy(&newnu->
bp[
b * newu], &nu->
bp[
b * nu->
pntsu + a], newu *
sizeof(
BPoint));
2496 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2497 starta =
b * nu->
pntsu + a;
2504 (starta % nu->
pntsu))))
2513 if (newu != nu->
pntsu) {
2516 if (newv != nu->
pntsv) {
2522 if (cyclicu != 0 || cyclicv != 0) {
2524 newu = cyclicu == 0 ? nu->
pntsu : cyclicu;
2525 newv = cyclicv == 0 ? nu->
pntsv : cyclicv;
2528 for (
b = 0;
b < newv;
b++) {
2538 for (
b = 0, diffa = 0;
b < newv;
b++, diffa += nu->
pntsu - newu) {
2554 if (newu != nu->
pntsu) {
2557 if (newv != nu->
pntsv) {
2588 for (a = 0, bp = nu->
bp; a < nu->pntsu * nu->
pntsv; a++, bp++) {
2615 for (
Object *obedit : objects) {
2648 ot->name =
"Switch Direction";
2649 ot->description =
"Switch direction of selected splines";
2650 ot->idname =
"CURVE_OT_switch_direction";
2673 for (
Object *obedit : objects) {
2682 for (bezt = nu->
bezt, a = 0; a < nu->pntsu; a++, bezt++) {
2689 for (bp = nu->
bp, a = 0; a < nu->pntsu * nu->
pntsv; a++, bp++) {
2707 ot->name =
"Set Goal Weight";
2708 ot->description =
"Set softbody goal weight for selected points";
2709 ot->idname =
"CURVE_OT_spline_weight_set";
2738 for (
Object *obedit : objects) {
2754 for (bezt = nu->
bezt, a = 0; a < nu->pntsu; a++, bezt++) {
2761 for (bp = nu->
bp, a = 0; a < nu->pntsu * nu->
pntsv; a++, bp++) {
2779 ot->name =
"Set Curve Radius";
2780 ot->description =
"Set per-point radius which is used for bevel tapering";
2781 ot->idname =
"CURVE_OT_radius_set";
2809 for (
int i = 0;
i < 3;
i++) {
2811 float val_old = bezt->
vec[1][
i];
2814 float val_new = (bezt_orig_prev->
vec[1][
i] * 0.5f) + (bezt_orig_next->
vec[1][
i] * 0.5f);
2815 float offset = (val_old * (1.0f - factor)) + (val_new * factor) - val_old;
2818 bezt->
vec[1][
i] += offset;
2819 bezt->
vec[0][
i] += offset;
2820 bezt->
vec[2][
i] += offset;
2828 const BPoint *bp_orig_prev,
2829 const BPoint *bp_orig_next,
2834 for (
int i = 0;
i < 3;
i++) {
2835 float val_old, val_new, offset;
2837 val_old = bp->
vec[
i];
2838 val_new = (bp_orig_prev->
vec[
i] * 0.5f) + (bp_orig_next->
vec[
i] * 0.5f);
2839 offset = (val_old * (1.0f - factor)) + (val_new * factor) - val_old;
2841 bp->
vec[
i] += offset;
2847 const float factor = 1.0f / 6.0f;
2855 for (
Object *obedit : objects) {
2872 bool changed =
false;
2881 a_end = nu->
pntsu - 1;
2885 for (; a < a_end; a++) {
2887 bezt = &nu->
bezt[a];
2889 const BezTriple *bezt_orig_prev, *bezt_orig_next;
2891 bezt_orig_prev = &bezt_orig[
mod_i(a - 1, nu->
pntsu)];
2892 bezt_orig_next = &bezt_orig[
mod_i(a + 1, nu->
pntsu)];
2915 a_end = nu->
pntsu - 1;
2918 for (; a < a_end; a++) {
2921 const BPoint *bp_orig_prev, *bp_orig_next;
2923 bp_orig_prev = &bp_orig[
mod_i(a - 1, nu->
pntsu)];
2924 bp_orig_next = &bp_orig[
mod_i(a + 1, nu->
pntsu)];
2943 ot->name =
"Smooth";
2944 ot->description =
"Flatten angles of selected points";
2945 ot->idname =
"CURVE_OT_smooth";
2973 int start_sel, end_sel;
2974 float start_rad, end_rad, fac, range;
2978#define BEZT_VALUE(bezt) (*((float *)((char *)(bezt) + bezt_offsetof)))
2980 for (last_sel = 0; last_sel < nu->
pntsu; last_sel++) {
2986 for (bezt = &nu->
bezt[last_sel], a = last_sel; a < nu->pntsu; a++, bezt++) {
2993 end_sel = start_sel;
2994 for (bezt = &nu->
bezt[start_sel + 1], a = start_sel + 1; a < nu->pntsu; a++, bezt++) {
3001 if (start_sel == -1) {
3002 last_sel = nu->
pntsu;
3008 start_rad = end_rad =
FLT_MAX;
3010 if (start_sel == end_sel) {
3012 if (start_sel > 0) {
3015 if (end_sel != -1 && end_sel < nu->pntsu) {
3022 else if (start_rad !=
FLT_MAX) {
3025 else if (end_rad !=
FLT_MAX) {
3031 if (start_sel == 0) {
3038 if (end_sel == nu->
pntsu - 1) {
3047 range =
float(end_sel - start_sel) + 2.0f;
3048 for (bezt = &nu->
bezt[start_sel], a = start_sel; a <= end_sel; a++, bezt++) {
3049 fac =
float(1 + a - start_sel) / range;
3050 BEZT_VALUE(bezt) = start_rad * (1.0f - fac) + end_rad * fac;
3058#define BP_VALUE(bp) (*((float *)((char *)(bp) + bp_offset)))
3061 for (last_sel = 0; last_sel < nu->
pntsu; last_sel++) {
3067 for (bp = &nu->
bp[last_sel], a = last_sel; a < nu->pntsu; a++, bp++) {
3074 end_sel = start_sel;
3075 for (bp = &nu->
bp[start_sel + 1], a = start_sel + 1; a < nu->pntsu; a++, bp++) {
3082 if (start_sel == -1) {
3083 last_sel = nu->
pntsu;
3089 start_rad = end_rad =
FLT_MAX;
3091 if (start_sel == end_sel) {
3093 if (start_sel > 0) {
3094 start_rad =
BP_VALUE(&nu->
bp[start_sel - 1]);
3096 if (end_sel != -1 && end_sel < nu->pntsu) {
3101 BP_VALUE(&nu->
bp[start_sel]) = (start_rad + end_rad) / 2;
3103 else if (start_rad !=
FLT_MAX) {
3106 else if (end_rad !=
FLT_MAX) {
3112 if (start_sel == 0) {
3117 start_rad =
BP_VALUE(&nu->
bp[start_sel - 1]);
3119 if (end_sel == nu->
pntsu - 1) {
3128 range =
float(end_sel - start_sel) + 2.0f;
3129 for (bp = &nu->
bp[start_sel], a = start_sel; a <= end_sel; a++, bp++) {
3130 fac =
float(1 + a - start_sel) / range;
3131 BP_VALUE(bp) = start_rad * (1.0f - fac) + end_rad * fac;
3154 for (
Object *obedit : objects) {
3169 ot->name =
"Smooth Curve Weight";
3170 ot->description =
"Interpolate weight of selected points";
3171 ot->idname =
"CURVE_OT_smooth_weight";
3197 for (
Object *obedit : objects) {
3219 ot->name =
"Smooth Curve Radius";
3220 ot->description =
"Interpolate radii of selected points";
3221 ot->idname =
"CURVE_OT_smooth_radius";
3246 for (
Object *obedit : objects) {
3268 ot->name =
"Smooth Curve Tilt";
3269 ot->description =
"Interpolate tilt of selected points";
3270 ot->idname =
"CURVE_OT_smooth_tilt";
3296 for (
Object *obedit : objects) {
3327 if (sel == nu->
pntsu) {
3365 ot->name =
"Hide Selected";
3366 ot->idname =
"CURVE_OT_hide";
3367 ot->description =
"Hide (un)selected control points";
3378 ot->srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected");
3392 bool changed_multi =
false;
3396 for (
Object *obedit : objects) {
3401 bool changed =
false;
3435 changed_multi =
true;
3444 ot->name =
"Reveal Hidden";
3445 ot->idname =
"CURVE_OT_reveal";
3446 ot->description =
"Reveal hidden control points";
3485 BPoint *bp, *prevbp, *bpnew, *bpn;
3487 int a,
b, sel, amount, *usel, *vsel;
3507 if (nextbezt ==
nullptr) {
3513 amount += number_cuts;
3530 if (nextbezt ==
nullptr) {
3537 float prevvec[3][3];
3538 float prev_tilt = bezt->
tilt;
3539 float prev_radius = bezt->
radius;
3540 float prev_weight = bezt->
weight;
3542 memcpy(prevvec, bezt->
vec,
sizeof(
float[9]));
3544 for (
int i = 0;
i < number_cuts;
i++) {
3545 factor = 1.0f / (number_cuts + 1 -
i);
3547 memcpy(beztn, nextbezt,
sizeof(
BezTriple));
3575 memcpy(prevvec, beztn->
vec,
sizeof(
float[9]));
3586 nu->
pntsu += amount;
3591 else if (nu->
pntsv == 1) {
3603 if (nextbp ==
nullptr) {
3608 amount += number_cuts;
3623 memcpy(bpn, bp,
sizeof(
BPoint));
3628 if (nextbp ==
nullptr) {
3634 for (
int i = 0;
i < number_cuts;
i++) {
3635 factor =
float(
i + 1) / (number_cuts + 1);
3637 memcpy(bpn, nextbp,
sizeof(
BPoint));
3647 nu->
pntsu += amount;
3703 for (a = 0; a < nu->
pntsv; a++) {
3718 int countu = nu->
pntsu + (nu->
pntsu - 1) * number_cuts;
3721 int tot = ((number_cuts + 1) * nu->
pntsu - number_cuts) *
3722 ((number_cuts + 1) * nu->
pntsv - number_cuts);
3727 for (a = 0; a < nu->
pntsv; a++) {
3735 for (
int i = 0;
i < number_cuts;
i++) {
3736 factor =
float(
i + 1) / (number_cuts + 1);
3743 bpn += number_cuts * countu;
3746 bpn = bpnew + ((number_cuts + 1) * nu->
pntsu - number_cuts);
3747 bp = bpnew + (number_cuts + 1) * ((number_cuts + 1) * nu->
pntsu - number_cuts);
3749 for (a = 1; a < nu->
pntsv; a++) {
3751 for (
b = 0;
b < (number_cuts + 1) * nu->
pntsu - number_cuts;
b++) {
3753 for (
int i = 0;
i < number_cuts;
i++) {
3754 factor =
float(
i + 1) / (number_cuts + 1);
3763 bp += number_cuts * countu;
3764 bpn += number_cuts * countu;
3765 prevbp += number_cuts * countu;
3769 nu->
pntsu = (number_cuts + 1) * nu->
pntsu - number_cuts;
3770 nu->
pntsv = (number_cuts + 1) * nu->
pntsv - number_cuts;
3777 for (a = 0; a < nu->
pntsv - 1; a++) {
3778 if (vsel[a] == nu->
pntsu && vsel[a + 1] == nu->
pntsu) {
3786 for (a = 0; a < nu->
pntsv; a++) {
3793 if ((a < nu->pntsv - 1) && vsel[a] == nu->
pntsu && vsel[a + 1] == nu->
pntsu) {
3794 for (
int i = 0;
i < number_cuts;
i++) {
3795 factor =
float(
i + 1) / (number_cuts + 1);
3796 prevbp = bp - nu->
pntsu;
3824 for (a = 0; a < nu->
pntsu - 1; a++) {
3825 if (usel[a] == nu->
pntsv && usel[a + 1] == nu->
pntsv) {
3836 for (a = 0; a < nu->
pntsv; a++) {
3850 for (
int i = 0;
i < number_cuts;
i++) {
3851 factor =
float(
i + 1) / (number_cuts + 1);
3885 for (
Object *obedit : objects) {
3910 ot->name =
"Subdivide";
3911 ot->description =
"Subdivide selected segments";
3912 ot->idname =
"CURVE_OT_subdivide";
3921 prop =
RNA_def_int(
ot->srna,
"number_cuts", 1, 1, 1000,
"Number of Cuts",
"", 1, 10);
3941 for (
Object *obedit : objects) {
3945 bool changed =
false;
3946 bool changed_size =
false;
3952 const int pntsu_prev = nu->
pntsu;
3953 const char *err_msg =
nullptr;
3956 if (pntsu_prev != nu->
pntsu) {
3957 changed_size =
true;
3989 {
CU_POLY,
"POLY", 0,
"Poly",
""},
3990 {
CU_BEZIER,
"BEZIER", 0,
"Bézier",
""},
3991 {
CU_NURBS,
"NURBS", 0,
"NURBS",
""},
3992 {0,
nullptr, 0,
nullptr,
nullptr},
3996 ot->name =
"Set Spline Type";
3997 ot->description =
"Set type of active spline";
3998 ot->idname =
"CURVE_OT_spline_type_set";
4014 "Use handles when converting Bézier curves into polygons");
4035 for (
Object *obedit : objects) {
4055 {
HD_AUTO,
"AUTOMATIC", 0,
"Automatic",
""},
4056 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
4057 {5,
"ALIGNED", 0,
"Aligned",
""},
4058 {6,
"FREE_ALIGN", 0,
"Free",
""},
4059 {3,
"TOGGLE_FREE_ALIGN", 0,
"Toggle Free/Align",
""},
4060 {0,
nullptr, 0,
nullptr,
nullptr},
4064 ot->name =
"Set Handle Type";
4065 ot->description =
"Set type of handles for selected control points";
4066 ot->idname =
"CURVE_OT_handle_type_set";
4077 ot->prop =
RNA_def_enum(
ot->srna,
"type", editcurve_handle_type_items, 1,
"Type",
"Spline type");
4099 for (
Object *obedit : objects) {
4124 ot->name =
"Recalculate Handles";
4125 ot->description =
"Recalculate the direction of selected handles";
4126 ot->idname =
"CURVE_OT_normals_make_consistent";
4136 RNA_def_boolean(
ot->srna,
"calc_length",
false,
"Length",
"Recalculate handle length");
4149 float *fp1, *fp2, *tempf;
4152 if (base ==
nullptr || tot == 0) {
4159 fp2 = fp1 + (a - 1);
4161 while (fp1 != fp2 && a > 0) {
4162 std::swap(*fp1, *fp2);
4173 fp2[0] =
fabsf(fp1[1] - fp1[0]);
4185 fp1[0] = fp1[-1] + fp2[0];
4194 BPoint *bp1, *bp2, *temp;
4208 for (u = 0; u < nu->
pntsu; u++, bp1++) {
4209 bp2 = temp + (nu->
pntsu - u - 1) * (nu->
pntsv) +
v;
4241 ListBase nbase = {
nullptr,
nullptr};
4242 NurbSort *nus, *nustest, *headdo, *taildo;
4244 float dist, headdist, taildist;
4270 while (nbase.
first) {
4272 headdist = taildist = 1.0e30;
4273 headdo = taildo =
nullptr;
4279 if (dist < headdist) {
4285 if (dist < taildist) {
4289 nustest = nustest->
next;
4292 if (headdist < taildist) {
4312 BPoint *bp, *bp1, *bp2, *temp;
4347 if (nu1->
pntsv != 1) {
4380 if (nu1->
pntsu == 1) {
4383 if (nu2->
pntsv != 1) {
4399 bp1 = &nu1->
bp[nu1->
pntsu - 1];
4407 bp1 = &nu1->
bp[nu1->
pntsu - 1];
4440 for (u = 0; u < nu1->
pntsu; u++, bp++) {
4475 ListBase nsortbase = {
nullptr,
nullptr};
4479 if (nsortbase.
first == nsortbase.
last) {
4496 else if (nus2->
nu->
pntsv == 1) {
4542 int error_selected_few;
4543 int error_resolution;
4549 for (
Object *obedit : objects) {
4558 Nurb *nu, *nu1 =
nullptr, *nu2 =
nullptr;
4564 nu =
static_cast<Nurb *
>(nubase->
first);
4572 if (nu_select_num) {
4578 if (nu_select_num > 1) {
4582 if (nu->
pntsv == 1) {
4596 switch (merge_result) {
4599 goto curve_merge_tag_object;
4601 status.error_resolution++;
4602 goto curve_merge_tag_object;
4604 status.error_selected_few++;
4607 status.error_resolution++;
4615 if (nu->
pntsu == 1) {
4623 if (nu2 ==
nullptr) {
4626 else if (nu1 ==
nullptr) {
4640 if (nu1 ==
nullptr) {
4643 else if (nu2 ==
nullptr) {
4656 else if (nu->
pntsv == 1) {
4664 if (nu2 ==
nullptr) {
4667 else if (nu1 ==
nullptr) {
4677 if (nu1 ==
nullptr) {
4680 else if (nu2 ==
nullptr) {
4698 if ((nu1 && nu2) && (nu1 != nu2)) {
4699 if (nu1->
type == nu2->type) {
4707 nu1->
pntsu += nu2->pntsu;
4723 nu1->
pntsu += nu2->pntsu;
4741 else if ((nu1 && !nu2) || (!nu1 && nu2)) {
4743 std::swap(nu1, nu2);
4775 curve_merge_tag_object:
4785 const int tot_errors =
status.error_selected_few +
status.error_resolution +
4787 if (tot_errors > 0) {
4795 if (((
status.error_selected_few ? 1 : 0) + (
status.error_resolution ? 1 : 0) +
4796 (
status.error_generic ? 1 : 0)) > 1)
4802 if (
status.error_selected_few) {
4805 else if (
status.error_resolution) {
4821 ot->name =
"Make Segment";
4822 ot->idname =
"CURVE_OT_make_segment";
4823 ot->description =
"Join two curves by their selected ends";
4848 Base *basact =
nullptr;
4850 bool changed =
false;
4861 if ((found &&
params.select_passthrough) &&
4862 (((bezt ? (&bezt->
f1)[hand] : bp->
f1) &
SELECT) != 0))
4866 else if (found ||
params.deselect_all) {
4870 for (
Object *ob_iter : objects) {
4890 if (use_handle_select) {
4916 if (use_handle_select) {
4926 else if (hand == 0) {
4945 if (use_handle_select) {
4956 if (use_handle_select) {
4965 else if (hand == 0) {
4992 if (use_handle_select) {
5040 return changed || found;
5050 float viewmat[4][4],
View3D *v3d,
Object *obedit,
const float axis[3],
const float cent[3])
5054 float cmat[3][3], tmat[3][3], imat[3][3];
5055 float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
5056 float persmat[3][3], persinv[3][3];
5057 bool ok, changed =
false;
5064 copy_m3_m4(bmat, obedit->object_to_world().ptr());
5091 for (a = 0; a < 7; a++) {
5135 float cent[3], axis[3], viewmat[4][4];
5136 bool changed =
false;
5137 int count_failed = 0;
5151 for (
Object *obedit : objects) {
5159 mul_m4_v3(obedit->world_to_object().ptr(), cent);
5175 if (changed ==
false) {
5176 if (count_failed != 0) {
5188 float axis[3] = {0.0f, 0.0f, 1.0f};
5204 ot->idname =
"CURVE_OT_spin";
5205 ot->description =
"Extrude selected boundary row around pivot point and current view axis";
5222 "Center in global view space",
5226 ot->srna,
"axis", 3,
nullptr, -1.0f, 1.0f,
"Axis",
"Axis in global view space", -1.0f, 1.0f);
5237 bool changed =
false;
5256 int pnt_len = nu->
pntsu;
5259 bool is_prev_selected =
false;
5260 bool duplic_first =
false;
5261 bool duplic_last =
false;
5269 bezt_prev = &nu->
bezt[0];
5273 bezt_prev = &nu->
bezt[pnt_len - 1];
5284 bezt_stack = nu->
bezt[0];
5286 bezt_prev = &bezt_stack;
5293 for (bezt = &nu->
bezt[0];
i--; bezt++) {
5295 if (bezt_prev && is_prev_selected != is_selected) {
5298 if (bezt == cu_actvert.bezt) {
5299 act_offset = new_points;
5302 is_prev_selected = is_selected;
5310 is_prev_selected =
false;
5316 else if (duplic_first) {
5317 bezt_prev = &bezt_stack;
5318 is_prev_selected =
false;
5321 bezt_prev =
nullptr;
5323 BezTriple *bezt_src, *bezt_dst, *bezt_src_iter, *bezt_dst_iter;
5324 const int new_len = pnt_len + new_points;
5326 bezt_src = nu->
bezt;
5328 bezt_src_iter = &bezt_src[0];
5329 bezt_dst_iter = &bezt_dst[0];
5331 for (bezt = &nu->
bezt[0];
i < pnt_len;
i++, bezt++) {
5339 if (bezt_prev && is_prev_selected != is_selected) {
5340 int count =
i - offset + 1;
5341 if (is_prev_selected) {
5351 bezt_dst_iter +=
count + 1;
5352 bezt_src_iter +=
count;
5356 is_prev_selected = is_selected;
5359 int remain = pnt_len - offset;
5365 ED_curve_beztcpy(editnurb, &bezt_dst[new_len - 1], &bezt_src[pnt_len - 1], 1);
5370 nu->
bezt = bezt_dst;
5371 nu->
pntsu += new_points;
5376 BPoint *bp, *bp_prev =
nullptr;
5381 bp_prev = &nu->
bp[0];
5387 bp_stack = nu->
bp[0];
5389 bp_prev = &bp_stack;
5397 for (bp = &nu->
bp[0];
i--; bp++) {
5398 bool is_selected = (bp->
f1 &
SELECT) != 0;
5399 if (bp_prev && is_prev_selected != is_selected) {
5402 if (bp == cu_actvert.bp) {
5403 act_offset = new_points;
5406 is_prev_selected = is_selected;
5410 BPoint *bp_src, *bp_dst, *bp_src_iter, *bp_dst_iter;
5411 const int new_len = pnt_len + new_points;
5413 is_prev_selected =
false;
5419 else if (duplic_first) {
5420 bp_prev = &bp_stack;
5421 is_prev_selected =
false;
5428 bp_src_iter = &bp_src[0];
5429 bp_dst_iter = &bp_dst[0];
5431 for (bp = &nu->
bp[0];
i < pnt_len;
i++, bp++) {
5432 bool is_selected = (bp->
f1 &
SELECT) != 0;
5433 if (bp_prev && is_prev_selected != is_selected) {
5434 int count =
i - offset + 1;
5435 if (is_prev_selected) {
5445 bp_dst_iter +=
count + 1;
5446 bp_src_iter +=
count;
5450 is_prev_selected = is_selected;
5453 int remain = pnt_len - offset;
5459 ED_curve_bpcpy(editnurb, &bp_dst[new_len - 1], &bp_src[pnt_len - 1], 1);
5465 nu->
pntsu += new_points;
5489 bool changed =
false;
5522 mul_v3_fl(center, 1.0f /
float(verts_len));
5587 memcpy(nurb_new->
bp, nu->
bp,
sizeof(
BPoint));
5713 const float eps = 1e-6f;
5720 const float *plane_co = vc.
obedit->object_to_world().location();
5732 float location_test[3];
5757 ot->name =
"Extrude to Cursor or Add";
5758 ot->idname =
"CURVE_OT_vertex_add";
5759 ot->description =
"Add a new control point (linked to only selected end-curve one, if any)";
5777 "Location to add new vertex at",
5797 for (
Object *obedit : objects) {
5800 bool changed =
false;
5828 ot->name =
"Extrude";
5829 ot->description =
"Extrude selected control point(s)";
5830 ot->idname =
"CURVE_OT_extrude";
5859 bool changed =
false;
5910 if (direction == 0 && nu->
pntsu > 1) {
5916 if (direction == 1 && nu->
pntsv > 1) {
5938 bool changed_multi =
false;
5942 for (
Object *obedit : objects) {
5951 changed_multi =
true;
5989 {0,
"CYCLIC_U", 0,
"Cyclic U",
""},
5990 {1,
"CYCLIC_V", 0,
"Cyclic V",
""},
5991 {0,
nullptr, 0,
nullptr,
nullptr},
5995 ot->name =
"Toggle Cyclic";
5996 ot->description =
"Make active spline closed/opened loop";
5997 ot->idname =
"CURVE_OT_cyclic_toggle";
6013 "Direction to make surface cyclic in");
6028 bool changed =
false;
6029 int count_failed = 0;
6033 for (
Object *obedit : objects) {
6040 ListBase newnurb = {
nullptr,
nullptr};
6054 if (changed ==
false) {
6055 if (count_failed != 0) {
6066 ot->name =
"Duplicate Curve";
6067 ot->description =
"Duplicate selected control points";
6068 ot->idname =
"CURVE_OT_duplicate";
6100 ListBase *nubase = &editnurb->
nurbs, newnurb = {
nullptr,
nullptr};
6104 int a,
b, starta, enda, cut, cyclicut;
6108 starta = enda = cut = -1;
6112 for (a = 0, bezt = nu->
bezt; a < nu->pntsu; a++, bezt++) {
6118 if (a < nu->pntsu - 1) {
6129 if (starta <= 1 && a == nu->pntsu - 1) {
6131 if (starta == 1 && enda != a) {
6137 cut = enda - starta + 1;
6140 else if (starta == 0) {
6143 cut = enda - starta + 1;
6153 starta = nu->
pntsu - 1;
6165 else if (enda == nu->
pntsu - 1) {
6168 cut = enda - starta + 1;
6170 bezt2 = &nu->
bezt[1];
6179 else if (cyclicut != 0) {
6193 cut = enda - starta + 1;
6197 if (nu1 !=
nullptr) {
6201 if (starta != 0 || enda != nu->
pntsu - 1) {
6213 bezt2 = &nu->
bezt[1];
6231 else if (nu->
pntsv >= 1) {
6235 for (a = 0, bp = nu->
bp; a < nu->pntsu; a++, bp++) {
6241 if (a < nu->pntsu - 1) {
6245 else if (a < nu->pntsu - 1 && !((bp + 1)->f1 &
SELECT)) {
6252 if (starta <= 1 && a == nu->pntsu - 1) {
6254 if (starta == 1 && enda != a) {
6260 cut = enda - starta + 1;
6263 else if (starta == 0) {
6266 cut = enda - starta + 1;
6277 starta = nu->
pntsu - 1;
6289 else if (enda == nu->
pntsu - 1) {
6292 cut = enda - starta + 1;
6304 else if (cyclicut != 0) {
6309 editnurb, &nu1->
bp[
b * nu1->
pntsu + cut], &nu->
bp[
b * nu->
pntsu], cyclicut);
6320 cut = enda - starta + 1;
6324 if (nu1 !=
nullptr) {
6331 if (starta != 0 || enda != nu->
pntsu - 1) {
6366 for (a = 0, bp = nu->
bp; a < nu->pntsv; a++, bp += nu->
pntsu) {
6372 if (a < nu->pntsv - 1) {
6376 else if (a < nu->pntsv - 1 && !((bp + nu->
pntsu)->f1 &
SELECT)) {
6383 if (starta <= 1 && a == nu->pntsv - 1) {
6385 if (starta == 1 && enda != a) {
6391 cut = enda - starta + 1;
6394 else if (starta == 0) {
6397 cut = enda - starta + 1;
6405 starta = nu->
pntsv - 1;
6417 else if (enda == nu->
pntsv - 1) {
6420 cut = enda - starta + 1;
6429 else if (cyclicut != 0) {
6443 cut = enda - starta + 1;
6447 if (nu1 !=
nullptr) {
6451 if (starta != 0 || enda != nu->
pntsv - 1) {
6513 if (nu->
pntsv > 1) {
6536 bool changed_multi =
false;
6538 for (
Object *obedit : objects) {
6540 bool changed =
false;
6558 changed_multi =
true;
6570 if (changed_multi) {
6579 {0,
nullptr, 0,
nullptr,
nullptr},
6607 ot->name =
"Delete";
6608 ot->description =
"Delete selected control points or segments";
6609 ot->idname =
"CURVE_OT_delete";
6644 const uint span_len,
6645 const uint span_step[2])
6647 int i_span_edge_len = span_len + 1;
6650 const int points_len = ((cu->
resolu - 1) * i_span_edge_len) + 1;
6652 float *points_stride = points;
6653 const int points_stride_len = (cu->
resolu - 1);
6655 for (
int segment = 0; segment < i_span_edge_len; segment++) {
6659 for (
int axis = 0; axis < dims; axis++) {
6661 bezt_a->
vec[2][axis],
6662 bezt_b->
vec[0][axis],
6663 bezt_b->
vec[1][axis],
6664 points_stride + axis,
6666 dims *
sizeof(
float));
6669 points_stride += dims * points_stride_len;
6672 BLI_assert(points_stride + dims == points + (points_len * dims));
6674 float tan_l[3], tan_r[3], error_sq_dummy;
6675 uint error_index_dummy;
6682 curve_fit_cubic_to_points_single_fl(points,
6692 &error_index_dummy);
6713 for (
Object *obedit : objects) {
6761 ot->name =
"Dissolve Vertices";
6762 ot->description =
"Delete selected control points, correcting surrounding handles";
6763 ot->idname =
"CURVE_OT_dissolve_verts";
6784 for (
i = nu->
pntsu, bezt = nu->
bezt;
i--; bezt++) {
6785 if (bezt->
f2 & flag_test) {
6796 const float error_sq_max =
FLT_MAX;
6798 bool all_supported_multi =
true;
6804 for (
Object *obedit : objects) {
6806 bool all_supported =
true;
6807 bool changed =
false;
6815 const int error_target_len =
max_ii(2, nu->
pntsu * ratio);
6816 if (error_target_len != nu->
pntsu) {
6823 all_supported =
false;
6828 if (all_supported ==
false) {
6829 all_supported_multi =
false;
6843 if (all_supported_multi ==
false) {
6853 ot->name =
"Decimate Curve";
6854 ot->description =
"Simplify selected curves";
6855 ot->idname =
"CURVE_OT_decimate";
6884 for (
Object *obedit : objects) {
6913 ot->name =
"Shade Smooth";
6914 ot->idname =
"CURVE_OT_shade_smooth";
6915 ot->description =
"Set shading to smooth";
6928 ot->name =
"Shade Flat";
6929 ot->idname =
"CURVE_OT_shade_flat";
6930 ot->description =
"Set shading to flat";
6955 float imat[4][4], cmat[4][4];
6960 if (ob_iter == ob_active) {
6982 if (ob_iter->type == ob_active->
type) {
6983 if (ob_iter != ob_active) {
6985 cu =
static_cast<Curve *
>(ob_iter->data);
6989 mul_m4_m4m4(cmat, imat, ob_iter->object_to_world().ptr());
6992 bool do_radius =
false;
6993 float compensate_radius = 0.0f;
7010 if ((bezt = newnu->
bezt)) {
7015 bezt->
radius *= compensate_radius;
7025 if ((bp = newnu->
bp)) {
7041 cu =
static_cast<Curve *
>(ob_active->
data);
7077 for (
Object *obedit : objects) {
7127 ot->name =
"Clear Tilt";
7128 ot->idname =
"CURVE_OT_tilt_clear";
7129 ot->description =
"Clear the tilt of selected control points";
7174 float min[3],
max[3], texspace_size[3], texspace_location[3];
7184 texspace_size[0] = (
max[0] -
min[0]) / 2.0f;
7185 texspace_size[1] = (
max[1] -
min[1]) / 2.0f;
7186 texspace_size[2] = (
max[2] -
min[2]) / 2.0f;
7188 for (a = 0; a < 3; a++) {
7189 if (texspace_size[a] == 0.0f) {
7190 texspace_size[a] = 1.0f;
7192 else if (texspace_size[a] > 0.0f && texspace_size[a] < 0.00001f) {
7193 texspace_size[a] = 0.00001f;
7195 else if (texspace_size[a] < 0.0f && texspace_size[a] > -0.00001f) {
7196 texspace_size[a] = -0.00001f;
7214 ot->name =
"Match Texture Space";
7215 ot->idname =
"CURVE_OT_match_texture_space";
7216 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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const 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 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 unit_m4(float m[4][4])
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])
ATTR_WARN_UNUSED_RESULT const size_t num
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define SNPRINTF_UTF8(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)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)
#define BEZT_SEL_ALL(bezt)
#define BEZT_DESEL_ALL(bezt)
#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)
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_gpu(const bContext *C)
static void split(const char *text, const char *seps, char ***str, int *count)
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)
@ OPTYPE_DEPENDS_ON_CURSOR
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
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
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)
static wmOperatorStatus shade_smooth_exec(bContext *C, wmOperator *op)
static bool ed_editcurve_extrude(Curve *cu, EditNurb *editnurb, View3D *v3d)
static void keyIndex_updateBP(EditNurb *editnurb, BPoint *bp, BPoint *newbp, int count)
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)
static void interp_bpoint(BPoint *bp_target, const BPoint *bp_a, const BPoint *bp_b, const float factor)
static bool is_u_selected(Nurb *nu, int u)
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 wmOperatorStatus curve_normals_make_consistent_exec(bContext *C, wmOperator *op)
static bool test_bezt_is_sel_any(const void *bezt_v, void *user_data)
static wmOperatorStatus switch_direction_exec(bContext *C, wmOperator *)
static wmOperatorStatus add_vertex_exec(bContext *C, wmOperator *op)
static wmOperatorStatus set_spline_type_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus hide_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)
static wmOperatorStatus curve_smooth_radius_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus curve_extrude_exec(bContext *C, wmOperator *)
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 wmOperatorStatus duplicate_exec(bContext *C, wmOperator *op)
static NurbDim editnurb_find_max_points_num(const EditNurb *editnurb)
void CURVE_OT_shade_smooth(wmOperatorType *ot)
static wmOperatorStatus curve_smooth_tilt_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus toggle_cyclic_exec(bContext *C, wmOperator *op)
void ED_curve_beztcpy(EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
static wmOperatorStatus make_segment_exec(bContext *C, wmOperator *op)
void CURVE_OT_delete(wmOperatorType *ot)
static void rotateflagNurb(ListBase *editnurb, short flag, const float cent[3], const float rotmat[3][3])
void ED_curve_editnurb_make(Object *obedit)
static void bezt_to_key(BezTriple *bezt, float *key)
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 CVKeyIndex * getCVKeyIndex(EditNurb *editnurb, const void *cv)
void CURVE_OT_spline_type_set(wmOperatorType *ot)
static wmOperatorStatus clear_tilt_exec(bContext *C, wmOperator *op)
static bool match_texture_space_poll(bContext *C)
void CURVE_OT_shade_flat(wmOperatorType *ot)
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)
void CURVE_OT_vertex_add(wmOperatorType *ot)
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)
static wmOperatorStatus set_goal_weight_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus curve_dissolve_exec(bContext *C, wmOperator *)
static void adduplicateflagNurb(Object *obedit, View3D *v3d, ListBase *newnurb, const uint8_t flag, const bool split)
static wmOperatorStatus curve_smooth_weight_exec(bContext *C, wmOperator *)
static int getKeyIndexOrig_keyIndex(EditNurb *editnurb, void *cv)
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 wmOperatorStatus add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus smooth_exec(bContext *C, wmOperator *op)
static wmOperatorStatus spin_exec(bContext *C, wmOperator *op)
static wmOperatorStatus curve_split_exec(bContext *C, wmOperator *op)
bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], const int dist_px, const SelectPick_Params ¶ms)
KeyBlock * ED_curve_get_edit_shape_key(const Curve *cu)
wmOperatorStatus ED_curve_join_objects_exec(bContext *C, wmOperator *op)
@ CURVE_MERGE_ERR_RESOLUTION_ALL
@ CURVE_MERGE_ERR_FEW_SELECTION
@ CURVE_MERGE_ERR_RESOLUTION_SOME
int ED_curve_updateAnimPaths(Main *bmain, Curve *cu)
static wmOperatorStatus reveal_exec(bContext *C, wmOperator *op)
static void switchdirection_knots(float *base, int tot)
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 wmOperatorStatus curve_decimate_exec(bContext *C, wmOperator *op)
static wmOperatorStatus subdivide_exec(bContext *C, wmOperator *op)
void CURVE_OT_cyclic_toggle(wmOperatorType *ot)
static wmOperatorStatus spin_invoke(bContext *C, wmOperator *op, const wmEvent *)
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)
static wmOperatorStatus set_radius_exec(bContext *C, wmOperator *op)
static wmOperatorStatus separate_exec(bContext *C, wmOperator *op)
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)
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 void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
GHash * ED_curve_keyindex_hash_duplicate(GHash *keyindex)
static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op)
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])
void CURVE_OT_split(wmOperatorType *ot)
static wmOperatorStatus toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus match_texture_space_exec(bContext *C, wmOperator *)
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 void keyIndex_delBP(EditNurb *editnurb, BPoint *bp)
static void ed_surf_delete_selected(Object *obedit)
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 wmOperatorStatus curve_delete_exec(bContext *C, wmOperator *op)
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)
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
void * MEM_mallocN(size_t len, const char *str)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
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)
bool material_active_index_set(Object *ob, int index)
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)
float texspace_location[3]
ObjectRuntimeHandle * runtime
struct ToolSettings * toolsettings
void op_enum(blender::StringRefNull opname, blender::StringRefNull propname, IDProperty *properties, blender::wm::OpCallContext context, eUI_Item_Flag flag, const int active=-1)
struct ReportList * reports
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_flag_only_pass_through_on_press(wmOperatorStatus retval, const wmEvent *event)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)