Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_key.c
| Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | static void rna_KeyBlock_normals_vert_calc(ID *id, | ||||
| if (ELEM(NULL, me, data) || (me->totvert == 0)) { | if (ELEM(NULL, me, data) || (me->totvert == 0)) { | ||||
| *normals = NULL; | *normals = NULL; | ||||
| return; | return; | ||||
| } | } | ||||
| *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | ||||
| BKE_keyblock_mesh_calc_normals(data, me, (float(*)[3])(*normals), NULL, NULL); | BKE_keyblock_mesh_calc_normals_vertex(data, me, (float(*)[3])(*normals)); | ||||
| } | } | ||||
| static int rna_KeyBlock_normals_poly_len(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) | static int rna_KeyBlock_normals_poly_len(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) | ||||
| { | { | ||||
| Mesh *me = rna_KeyBlock_normals_get_mesh(ptr, NULL); | Mesh *me = rna_KeyBlock_normals_get_mesh(ptr, NULL); | ||||
| length[0] = me ? me->totpoly : 0; | length[0] = me ? me->totpoly : 0; | ||||
| length[1] = 3; | length[1] = 3; | ||||
| Show All 12 Lines | static void rna_KeyBlock_normals_poly_calc(ID *id, | ||||
| if (ELEM(NULL, me, data) || (me->totpoly == 0)) { | if (ELEM(NULL, me, data) || (me->totpoly == 0)) { | ||||
| *normals = NULL; | *normals = NULL; | ||||
| return; | return; | ||||
| } | } | ||||
| *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | ||||
| BKE_keyblock_mesh_calc_normals(data, me, NULL, (float(*)[3])(*normals), NULL); | BKE_keyblock_mesh_calc_normals_poly(data, me, (float(*)[3])(*normals)); | ||||
| } | } | ||||
| static int rna_KeyBlock_normals_loop_len(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) | static int rna_KeyBlock_normals_loop_len(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) | ||||
| { | { | ||||
| Mesh *me = rna_KeyBlock_normals_get_mesh(ptr, NULL); | Mesh *me = rna_KeyBlock_normals_get_mesh(ptr, NULL); | ||||
| length[0] = me ? me->totloop : 0; | length[0] = me ? me->totloop : 0; | ||||
| length[1] = 3; | length[1] = 3; | ||||
| Show All 12 Lines | static void rna_KeyBlock_normals_loop_calc(ID *id, | ||||
| if (ELEM(NULL, me, data) || (me->totloop == 0)) { | if (ELEM(NULL, me, data) || (me->totloop == 0)) { | ||||
| *normals = NULL; | *normals = NULL; | ||||
| return; | return; | ||||
| } | } | ||||
| *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | *normals = MEM_mallocN(sizeof(**normals) * (size_t)(*normals_len), __func__); | ||||
| BKE_keyblock_mesh_calc_normals(data, me, NULL, NULL, (float(*)[3])(*normals)); | BKE_keyblock_mesh_calc_normals_split(data, me, (float(*)[3])(*normals)); | ||||
| } | } | ||||
| PointerRNA rna_object_shapekey_index_get(ID *id, int value) | PointerRNA rna_object_shapekey_index_get(ID *id, int value) | ||||
| { | { | ||||
| Key *key = rna_ShapeKey_find_key(id); | Key *key = rna_ShapeKey_find_key(id); | ||||
| KeyBlock *kb = NULL; | KeyBlock *kb = NULL; | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| ▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines | |||||