Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_curve_api.c
| Show All 37 Lines | |||||
| static void rna_Nurb_valid_message(Nurb *nu, int direction, int *result_len, const char **r_result) | static void rna_Nurb_valid_message(Nurb *nu, int direction, int *result_len, const char **r_result) | ||||
| { | { | ||||
| const bool is_surf = nu->pntsv > 1; | const bool is_surf = nu->pntsv > 1; | ||||
| const short type = nu->type; | const short type = nu->type; | ||||
| int pnts; | int pnts; | ||||
| short order, flag; | short order, flag; | ||||
| const char *dir; | |||||
| if (direction == 0) { | if (direction == 0) { | ||||
| pnts = nu->pntsu; | pnts = nu->pntsu; | ||||
| order = nu->orderu; | order = nu->orderu; | ||||
| flag = nu->flagu; | flag = nu->flagu; | ||||
| dir = "U"; | |||||
| } | } | ||||
| else { | else { | ||||
| pnts = nu->pntsv; | pnts = nu->pntsv; | ||||
| order = nu->orderv; | order = nu->orderv; | ||||
| flag = nu->flagv; | flag = nu->flagv; | ||||
| dir = "V"; | |||||
| } | } | ||||
| char buf[64]; | char buf[64]; | ||||
| if (BKE_nurb_valid_message(pnts, order, flag, type, is_surf, dir, buf, sizeof(buf))) { | if (BKE_nurb_valid_message(pnts, order, flag, type, is_surf, direction, buf, sizeof(buf))) { | ||||
| const int buf_len = strlen(buf); | const int buf_len = strlen(buf); | ||||
| *r_result = BLI_strdupn(buf, buf_len); | *r_result = BLI_strdupn(buf, buf_len); | ||||
| *result_len = buf_len; | *result_len = buf_len; | ||||
| } | } | ||||
| else { | else { | ||||
| *r_result = NULL; | *r_result = NULL; | ||||
| *result_len = 0; | *result_len = 0; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||