Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/key.c
| Show First 20 Lines • Show All 688 Lines • ▼ Show 20 Lines | case ID_CU: | ||||
| } | } | ||||
| else { | else { | ||||
| *ofs = sizeof(float[KEYELEM_FLOAT_LEN_BEZTRIPLE]); | *ofs = sizeof(float[KEYELEM_FLOAT_LEN_BEZTRIPLE]); | ||||
| *step = KEYELEM_ELEM_LEN_BEZTRIPLE; | *step = KEYELEM_ELEM_LEN_BEZTRIPLE; | ||||
| } | } | ||||
| *poinsize = sizeof(float[KEYELEM_ELEM_SIZE_CURVE]); | *poinsize = sizeof(float[KEYELEM_ELEM_SIZE_CURVE]); | ||||
| break; | break; | ||||
| default: | default: | ||||
| BLI_assert(!"invalid 'key->from' ID type"); | BLI_assert_msg(0, "invalid 'key->from' ID type"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void cp_key(const int start, | static void cp_key(const int start, | ||||
| int end, | int end, | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | while (cp[0]) { | ||||
| default: | default: | ||||
| /* should never happen */ | /* should never happen */ | ||||
| if (freek1) { | if (freek1) { | ||||
| MEM_freeN(freek1); | MEM_freeN(freek1); | ||||
| } | } | ||||
| if (freekref) { | if (freekref) { | ||||
| MEM_freeN(freekref); | MEM_freeN(freekref); | ||||
| } | } | ||||
| BLI_assert(!"invalid 'cp[1]'"); | BLI_assert_msg(0, "invalid 'cp[1]'"); | ||||
| return; | return; | ||||
| } | } | ||||
| poin += *ofsp; | poin += *ofsp; | ||||
| cp += 2; | cp += 2; | ||||
| ofsp++; | ofsp++; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if (kb != key->refkey) { | ||||
| (float *)from, | (float *)from, | ||||
| weight); | weight); | ||||
| break; | break; | ||||
| default: | default: | ||||
| /* should never happen */ | /* should never happen */ | ||||
| if (freefrom) { | if (freefrom) { | ||||
| MEM_freeN(freefrom); | MEM_freeN(freefrom); | ||||
| } | } | ||||
| BLI_assert(!"invalid 'cp[1]'"); | BLI_assert_msg(0, "invalid 'cp[1]'"); | ||||
| return; | return; | ||||
| } | } | ||||
| poin += *ofsp; | poin += *ofsp; | ||||
| cp += 2; | cp += 2; | ||||
| ofsp++; | ofsp++; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | while (cp[0]) { /* (cp[0] == amount) */ | ||||
| MEM_freeN(freek2); | MEM_freeN(freek2); | ||||
| } | } | ||||
| if (freek3) { | if (freek3) { | ||||
| MEM_freeN(freek3); | MEM_freeN(freek3); | ||||
| } | } | ||||
| if (freek4) { | if (freek4) { | ||||
| MEM_freeN(freek4); | MEM_freeN(freek4); | ||||
| } | } | ||||
| BLI_assert(!"invalid 'cp[1]'"); | BLI_assert_msg(0, "invalid 'cp[1]'"); | ||||
| return; | return; | ||||
| } | } | ||||
| poin += *ofsp; | poin += *ofsp; | ||||
| cp += 2; | cp += 2; | ||||
| ofsp++; | ofsp++; | ||||
| } | } | ||||
| /* lets do it the difficult way: when keys have a different size */ | /* lets do it the difficult way: when keys have a different size */ | ||||
| ▲ Show 20 Lines • Show All 474 Lines • ▼ Show 20 Lines | |||||
| * Set the data to all key-blocks (or shape_index if != -1). | * Set the data to all key-blocks (or shape_index if != -1). | ||||
| */ | */ | ||||
| void BKE_keyblock_data_set_with_mat4(Key *key, | void BKE_keyblock_data_set_with_mat4(Key *key, | ||||
| const int shape_index, | const int shape_index, | ||||
| const float (*coords)[3], | const float (*coords)[3], | ||||
| const float mat[4][4]) | const float mat[4][4]) | ||||
| { | { | ||||
| if (key->elemsize != sizeof(float[3])) { | if (key->elemsize != sizeof(float[3])) { | ||||
| BLI_assert(!"Invalid elemsize"); | BLI_assert_msg(0, "Invalid elemsize"); | ||||
| return; | return; | ||||
| } | } | ||||
| const float(*elements)[3] = coords; | const float(*elements)[3] = coords; | ||||
| int index = 0; | int index = 0; | ||||
| for (KeyBlock *kb = key->block.first; kb; kb = kb->next, index++) { | for (KeyBlock *kb = key->block.first; kb; kb = kb->next, index++) { | ||||
| if (ELEM(shape_index, -1, index)) { | if (ELEM(shape_index, -1, index)) { | ||||
| ▲ Show 20 Lines • Show All 915 Lines • Show Last 20 Lines | |||||