Math Lib: rename fill_*, to copy_*
matching convention for fixed length api, eg: copy_v3_fl
This commit is contained in:
@@ -295,11 +295,11 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges,
|
||||
dm->dirty = 0;
|
||||
|
||||
/* don't use CustomData_reset(...); because we dont want to touch customdata */
|
||||
fill_vn_i(dm->vertData.typemap, CD_NUMTYPES, -1);
|
||||
fill_vn_i(dm->edgeData.typemap, CD_NUMTYPES, -1);
|
||||
fill_vn_i(dm->faceData.typemap, CD_NUMTYPES, -1);
|
||||
fill_vn_i(dm->loopData.typemap, CD_NUMTYPES, -1);
|
||||
fill_vn_i(dm->polyData.typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(dm->vertData.typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(dm->edgeData.typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(dm->faceData.typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(dm->loopData.typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(dm->polyData.typemap, CD_NUMTYPES, -1);
|
||||
}
|
||||
|
||||
void DM_from_template(DerivedMesh *dm, DerivedMesh *source, DerivedMeshType type,
|
||||
@@ -1276,7 +1276,7 @@ static void calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, int const d
|
||||
else {
|
||||
weightpaint_color(col, dm_wcinfo, 0.0f);
|
||||
}
|
||||
fill_vn_i((int *)r_wtcol_v, numVerts, *((int *)col));
|
||||
copy_vn_i((int *)r_wtcol_v, numVerts, *((int *)col));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1091,7 +1091,7 @@ static void layerDefault_mcol(void *data, int count)
|
||||
|
||||
static void layerDefault_origindex(void *data, int count)
|
||||
{
|
||||
fill_vn_i((int *)data, count, ORIGINDEX_NONE);
|
||||
copy_vn_i((int *)data, count, ORIGINDEX_NONE);
|
||||
}
|
||||
|
||||
static void layerInterp_bweight(
|
||||
@@ -1542,7 +1542,7 @@ static void CustomData_external_free(CustomData *data)
|
||||
void CustomData_reset(CustomData *data)
|
||||
{
|
||||
memset(data, 0, sizeof(*data));
|
||||
fill_vn_i(data->typemap, CD_NUMTYPES, -1);
|
||||
copy_vn_i(data->typemap, CD_NUMTYPES, -1);
|
||||
}
|
||||
|
||||
void CustomData_free(CustomData *data, int totelem)
|
||||
|
@@ -982,7 +982,7 @@ void BKE_defvert_extract_vgroup_to_vertweights(
|
||||
}
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(r_weights, num_verts, invert_vgroup ? 1.0f : 0.0f);
|
||||
copy_vn_fl(r_weights, num_verts, invert_vgroup ? 1.0f : 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,7 +1008,7 @@ void BKE_defvert_extract_vgroup_to_edgeweights(
|
||||
MEM_freeN(tmp_weights);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(r_weights, num_edges, 0.0f);
|
||||
copy_vn_fl(r_weights, num_edges, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,7 +1031,7 @@ void BKE_defvert_extract_vgroup_to_loopweights(
|
||||
MEM_freeN(tmp_weights);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(r_weights, num_loops, 0.0f);
|
||||
copy_vn_fl(r_weights, num_loops, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void BKE_defvert_extract_vgroup_to_polyweights(
|
||||
MEM_freeN(tmp_weights);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(r_weights, num_polys, 0.0f);
|
||||
copy_vn_fl(r_weights, num_polys, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1968,7 +1968,7 @@ static void statvis_calc_thickness(
|
||||
|
||||
BLI_assert(min <= max);
|
||||
|
||||
fill_vn_fl(face_dists, em->bm->totface, max);
|
||||
copy_vn_fl(face_dists, em->bm->totface, max);
|
||||
|
||||
if (use_jit) {
|
||||
int j;
|
||||
@@ -2223,7 +2223,7 @@ static void statvis_calc_sharp(
|
||||
|
||||
(void)vertexCos; /* TODO */
|
||||
|
||||
fill_vn_fl(vert_angles, em->bm->totvert, -M_PI);
|
||||
copy_vn_fl(vert_angles, em->bm->totvert, -M_PI);
|
||||
|
||||
/* first assign float values to verts */
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
|
@@ -707,7 +707,7 @@ void BKE_mesh_remap_calc_edges_from_dm(
|
||||
BLI_space_transform_apply_normal(space_transform, v2_no);
|
||||
}
|
||||
|
||||
fill_vn_fl(weights, (int)numedges_src, 0.0f);
|
||||
copy_vn_fl(weights, (int)numedges_src, 0.0f);
|
||||
|
||||
/* We adjust our ray-casting grid to ray_radius (the smaller, the more rays are cast),
|
||||
* with lower/upper bounds. */
|
||||
@@ -1916,7 +1916,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
|
||||
BLI_space_transform_apply_normal(space_transform, tmp_no);
|
||||
}
|
||||
|
||||
fill_vn_fl(weights, (int)numpolys_src, 0.0f);
|
||||
copy_vn_fl(weights, (int)numpolys_src, 0.0f);
|
||||
|
||||
if (UNLIKELY((size_t)mp->totloop > tmp_poly_size)) {
|
||||
tmp_poly_size = (size_t)mp->totloop;
|
||||
|
@@ -308,7 +308,7 @@ void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist);
|
||||
void axis_sort_v3(const float axis_values[3], int r_axis_order[3]);
|
||||
|
||||
/***************************** Array Functions *******************************/
|
||||
/* attempted to follow fixed length vertex functions. names could be improved*/
|
||||
/* follow fixed length vector function conventions. */
|
||||
double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size) ATTR_WARN_UNUSED_RESULT;
|
||||
double len_squared_vn(const float *array, const int size) ATTR_WARN_UNUSED_RESULT;
|
||||
float normalize_vn_vn(float *array_tar, const float *array_src, const int size);
|
||||
@@ -329,11 +329,11 @@ void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_
|
||||
void msub_vn_vn(float *array_tar, const float *array_src, const float f, const int size);
|
||||
void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
|
||||
void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
|
||||
void fill_vn_i(int *array_tar, const int size, const int val);
|
||||
void fill_vn_short(short *array_tar, const int size, const short val);
|
||||
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
|
||||
void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val);
|
||||
void fill_vn_fl(float *array_tar, const int size, const float val);
|
||||
void copy_vn_i(int *array_tar, const int size, const int val);
|
||||
void copy_vn_short(short *array_tar, const int size, const short val);
|
||||
void copy_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
|
||||
void copy_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val);
|
||||
void copy_vn_fl(float *array_tar, const int size, const float val);
|
||||
|
||||
/**************************** Inline Definitions ******************************/
|
||||
|
||||
|
@@ -229,7 +229,7 @@ bool BLI_astar_graph_solve(
|
||||
r_solution->steps = 0;
|
||||
prev_nodes[node_index_src] = -1;
|
||||
BLI_BITMAP_SET_ALL(done_nodes, false, as_graph->node_num);
|
||||
fill_vn_fl(g_costs, as_graph->node_num, FLT_MAX);
|
||||
copy_vn_fl(g_costs, as_graph->node_num, FLT_MAX);
|
||||
g_costs[node_index_src] = 0.0f;
|
||||
g_steps[node_index_src] = 0;
|
||||
|
||||
|
@@ -112,10 +112,10 @@ BLI_INLINE void bicubic_interpolation(const unsigned char *byte_buffer, const fl
|
||||
/* sample area entirely outside image? */
|
||||
if (ceil(u) < 0 || floor(u) > width - 1 || ceil(v) < 0 || floor(v) > height - 1) {
|
||||
if (float_output) {
|
||||
fill_vn_fl(float_output, components, 0.0f);
|
||||
copy_vn_fl(float_output, components, 0.0f);
|
||||
}
|
||||
if (byte_output) {
|
||||
fill_vn_uchar(byte_output, components, 0);
|
||||
copy_vn_uchar(byte_output, components, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
|
||||
|
||||
/* sample area entirely outside image? */
|
||||
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
|
||||
fill_vn_fl(float_output, components, 0.0f);
|
||||
copy_vn_fl(float_output, components, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const f
|
||||
|
||||
/* sample area entirely outside image? */
|
||||
if (x2 < 0 || x1 > width - 1 || y2 < 0 || y1 > height - 1) {
|
||||
fill_vn_uchar(byte_output, components, 0);
|
||||
copy_vn_uchar(byte_output, components, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -876,7 +876,7 @@ float normalize_vn_vn(float *array_tar, const float *array_src, const int size)
|
||||
mul_vn_vn_fl(array_tar, array_src, size, 1.0f / d_sqrt);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(array_tar, size, 0.0f);
|
||||
copy_vn_fl(array_tar, size, 0.0f);
|
||||
d_sqrt = 0.0f;
|
||||
}
|
||||
return d_sqrt;
|
||||
@@ -1051,7 +1051,7 @@ void interp_vn_vn(float *array_tar, const float *array_src, const float t, const
|
||||
}
|
||||
}
|
||||
|
||||
void fill_vn_i(int *array_tar, const int size, const int val)
|
||||
void copy_vn_i(int *array_tar, const int size, const int val)
|
||||
{
|
||||
int *tar = array_tar + (size - 1);
|
||||
int i = size;
|
||||
@@ -1060,7 +1060,7 @@ void fill_vn_i(int *array_tar, const int size, const int val)
|
||||
}
|
||||
}
|
||||
|
||||
void fill_vn_short(short *array_tar, const int size, const short val)
|
||||
void copy_vn_short(short *array_tar, const int size, const short val)
|
||||
{
|
||||
short *tar = array_tar + (size - 1);
|
||||
int i = size;
|
||||
@@ -1069,7 +1069,7 @@ void fill_vn_short(short *array_tar, const int size, const short val)
|
||||
}
|
||||
}
|
||||
|
||||
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
|
||||
void copy_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
|
||||
{
|
||||
unsigned short *tar = array_tar + (size - 1);
|
||||
int i = size;
|
||||
@@ -1078,7 +1078,7 @@ void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned sh
|
||||
}
|
||||
}
|
||||
|
||||
void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val)
|
||||
void copy_vn_uchar(unsigned char *array_tar, const int size, const unsigned char val)
|
||||
{
|
||||
unsigned char *tar = array_tar + (size - 1);
|
||||
int i = size;
|
||||
@@ -1087,7 +1087,7 @@ void fill_vn_uchar(unsigned char *array_tar, const int size, const unsigned char
|
||||
}
|
||||
}
|
||||
|
||||
void fill_vn_fl(float *array_tar, const int size, const float val)
|
||||
void copy_vn_fl(float *array_tar, const int size, const float val)
|
||||
{
|
||||
float *tar = array_tar + (size - 1);
|
||||
int i = size;
|
||||
|
@@ -845,7 +845,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
|
||||
Object *ob;
|
||||
for (ob = main->object.first; ob; ob = ob->id.next) {
|
||||
if (is_zero_v3(ob->dscale)) {
|
||||
fill_vn_fl(ob->dscale, 3, 1.0f);
|
||||
copy_vn_fl(ob->dscale, 3, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1057,7 +1057,7 @@ LinkNode *BM_vert_loop_groups_data_layer_create(
|
||||
mul_vn_fl(lf->data_weights, lf->data_len, 1.0f / lwc.weight_accum);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(lf->data_weights, lf->data_len, 1.0f / (float)lf->data_len);
|
||||
copy_vn_fl(lf->data_weights, lf->data_len, 1.0f / (float)lf->data_len);
|
||||
}
|
||||
|
||||
BLI_linklist_prepend_arena(&groups, lf, lwc.arena);
|
||||
|
@@ -190,7 +190,7 @@ void BM_mesh_decimate_dissolve_ex(
|
||||
/* prepare for cleanup */
|
||||
BM_mesh_elem_index_ensure(bm, BM_VERT);
|
||||
vert_reverse_lookup = MEM_mallocN(sizeof(int) * bm->totvert, __func__);
|
||||
fill_vn_i(vert_reverse_lookup, bm->totvert, -1);
|
||||
copy_vn_i(vert_reverse_lookup, bm->totvert, -1);
|
||||
for (i = 0; i < vinput_len; i++) {
|
||||
BMVert *v = vinput_arr[i];
|
||||
vert_reverse_lookup[BM_elem_index_get(v)] = i;
|
||||
|
@@ -126,7 +126,7 @@ LinkNode *BM_mesh_calc_path_vert(
|
||||
verts_prev = MEM_callocN(sizeof(*verts_prev) * totvert, __func__);
|
||||
cost = MEM_mallocN(sizeof(*cost) * totvert, __func__);
|
||||
|
||||
fill_vn_fl(cost, totvert, 1e20f);
|
||||
copy_vn_fl(cost, totvert, 1e20f);
|
||||
|
||||
/*
|
||||
* Arrays are now filled as follows:
|
||||
@@ -252,7 +252,7 @@ LinkNode *BM_mesh_calc_path_edge(
|
||||
edges_prev = MEM_callocN(sizeof(*edges_prev) * totedge, "SeamPathPrevious");
|
||||
cost = MEM_mallocN(sizeof(*cost) * totedge, "SeamPathCost");
|
||||
|
||||
fill_vn_fl(cost, totedge, 1e20f);
|
||||
copy_vn_fl(cost, totedge, 1e20f);
|
||||
|
||||
/*
|
||||
* Arrays are now filled as follows:
|
||||
@@ -378,7 +378,7 @@ LinkNode *BM_mesh_calc_path_face(
|
||||
faces_prev = MEM_callocN(sizeof(*faces_prev) * totface, __func__);
|
||||
cost = MEM_mallocN(sizeof(*cost) * totface, __func__);
|
||||
|
||||
fill_vn_fl(cost, totface, 1e20f);
|
||||
copy_vn_fl(cost, totface, 1e20f);
|
||||
|
||||
/*
|
||||
* Arrays are now filled as follows:
|
||||
|
@@ -186,7 +186,7 @@ static void vpaint_proj_dm_map_cosnos_update(struct VertProjHandle *vp_handle,
|
||||
|
||||
/* highly unlikely this will become unavailable once painting starts (perhaps with animated modifiers) */
|
||||
if (LIKELY(dm->foreachMappedVert)) {
|
||||
fill_vn_fl(vp_handle->dists_sq, me->totvert, FLT_MAX);
|
||||
copy_vn_fl(vp_handle->dists_sq, me->totvert, FLT_MAX);
|
||||
|
||||
dm->foreachMappedVert(dm, vpaint_proj_dm_map_cosnos_update__map_cb, &vp_update, DM_FOREACH_USE_NORMAL);
|
||||
}
|
||||
|
@@ -199,7 +199,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
|
||||
bool has_skinradius = false;
|
||||
PointerRNA data_ptr;
|
||||
|
||||
fill_vn_fl(median, NBR_TRANSFORM_PROPERTIES, 0.0f);
|
||||
copy_vn_fl(median, NBR_TRANSFORM_PROPERTIES, 0.0f);
|
||||
tot = totedgedata = totcurvedata = totlattdata = totcurvebweight = 0;
|
||||
|
||||
/* make sure we got storage */
|
||||
|
@@ -6017,7 +6017,7 @@ static bool createEdgeSlideVerts(TransInfo *t)
|
||||
|
||||
loop_dir = MEM_callocN(sizeof(float) * 3 * loop_nr, "sv loop_dir");
|
||||
loop_maxdist = MEM_mallocN(sizeof(float) * loop_nr, "sv loop_maxdist");
|
||||
fill_vn_fl(loop_maxdist, loop_nr, -1.0f);
|
||||
copy_vn_fl(loop_maxdist, loop_nr, -1.0f);
|
||||
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
|
||||
|
@@ -2124,7 +2124,7 @@ static struct TransIslandData *editmesh_islands_info_calc(BMEditMesh *em, int *r
|
||||
vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__);
|
||||
/* we shouldn't need this, but with incorrect selection flushing
|
||||
* its possible we have a selected vertex thats not in a face, for now best not crash in that case. */
|
||||
fill_vn_i(vert_map, bm->totvert, -1);
|
||||
copy_vn_i(vert_map, bm->totvert, -1);
|
||||
|
||||
BM_mesh_elem_table_ensure(bm, htype);
|
||||
ele_array = (htype == BM_FACE) ? (void **)bm->ftable : (void **)bm->etable;
|
||||
|
@@ -73,14 +73,14 @@ void initNumInput(NumInput *n)
|
||||
{
|
||||
n->idx_max = 0;
|
||||
n->unit_sys = USER_UNIT_NONE;
|
||||
fill_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
|
||||
copy_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
|
||||
n->unit_use_radians = false;
|
||||
|
||||
n->flag = 0;
|
||||
fill_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
|
||||
copy_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
|
||||
zero_v3(n->val);
|
||||
fill_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
|
||||
fill_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
|
||||
copy_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
|
||||
copy_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
|
||||
|
||||
n->idx = 0;
|
||||
n->str[0] = '\0';
|
||||
|
@@ -2120,7 +2120,7 @@ static int uv_mouse_select(bContext *C, const float co[2], bool extend, bool loo
|
||||
/* mark 1 vertex as being hit */
|
||||
hitv = BLI_array_alloca(hitv, hit.efa->len);
|
||||
hituv = BLI_array_alloca(hituv, hit.efa->len);
|
||||
fill_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
|
||||
copy_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
|
||||
|
||||
hitv[hit.lindex] = BM_elem_index_get(hit.l->v);
|
||||
hituv[hit.lindex] = hit.luv->uv;
|
||||
@@ -2137,7 +2137,7 @@ static int uv_mouse_select(bContext *C, const float co[2], bool extend, bool loo
|
||||
/* mark 2 edge vertices as being hit */
|
||||
hitv = BLI_array_alloca(hitv, hit.efa->len);
|
||||
hituv = BLI_array_alloca(hituv, hit.efa->len);
|
||||
fill_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
|
||||
copy_vn_i(hitv, hit.efa->len, 0xFFFFFFFF);
|
||||
|
||||
hitv[hit.lindex] = BM_elem_index_get(hit.l->v);
|
||||
hitv[(hit.lindex + 1) % hit.efa->len] = BM_elem_index_get(hit.l->next->v);
|
||||
|
@@ -454,7 +454,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
|
||||
|
||||
if (bitspersample == 32) {
|
||||
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
|
||||
fill_vn_fl(fbuf, ibuf->x, 1.0f);
|
||||
copy_vn_fl(fbuf, ibuf->x, 1.0f);
|
||||
else if (chan >= spp) /* for grayscale, duplicate first channel into G and B */
|
||||
success |= TIFFReadScanline(image, fbuf, row, 0);
|
||||
else
|
||||
@@ -464,7 +464,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image)
|
||||
}
|
||||
else if (bitspersample == 16) {
|
||||
if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */
|
||||
fill_vn_ushort(sbuf, ibuf->x, 65535);
|
||||
copy_vn_ushort(sbuf, ibuf->x, 65535);
|
||||
else if (chan >= spp) /* for grayscale, duplicate first channel into G and B */
|
||||
success |= TIFFReadScanline(image, fbuf, row, 0);
|
||||
else
|
||||
|
@@ -1387,7 +1387,7 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
|
||||
memcpy(values, bb->vec, sizeof(bb->vec));
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f);
|
||||
copy_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -364,22 +364,22 @@ static void dm_merge_transform(
|
||||
/* set origindex */
|
||||
index_orig = result->getVertDataArray(result, CD_ORIGINDEX);
|
||||
if (index_orig) {
|
||||
fill_vn_i(index_orig + cap_verts_index, cap_nverts, ORIGINDEX_NONE);
|
||||
copy_vn_i(index_orig + cap_verts_index, cap_nverts, ORIGINDEX_NONE);
|
||||
}
|
||||
|
||||
index_orig = result->getEdgeDataArray(result, CD_ORIGINDEX);
|
||||
if (index_orig) {
|
||||
fill_vn_i(index_orig + cap_edges_index, cap_nedges, ORIGINDEX_NONE);
|
||||
copy_vn_i(index_orig + cap_edges_index, cap_nedges, ORIGINDEX_NONE);
|
||||
}
|
||||
|
||||
index_orig = result->getPolyDataArray(result, CD_ORIGINDEX);
|
||||
if (index_orig) {
|
||||
fill_vn_i(index_orig + cap_polys_index, cap_npolys, ORIGINDEX_NONE);
|
||||
copy_vn_i(index_orig + cap_polys_index, cap_npolys, ORIGINDEX_NONE);
|
||||
}
|
||||
|
||||
index_orig = result->getLoopDataArray(result, CD_ORIGINDEX);
|
||||
if (index_orig) {
|
||||
fill_vn_i(index_orig + cap_loops_index, cap_nloops, ORIGINDEX_NONE);
|
||||
copy_vn_i(index_orig + cap_loops_index, cap_nloops, ORIGINDEX_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ static DerivedMesh *arrayModifier_doArray(
|
||||
if (use_merge) {
|
||||
/* Will need full_doubles_map for handling merge */
|
||||
full_doubles_map = MEM_mallocN(sizeof(int) * result_nverts, "mod array doubles map");
|
||||
fill_vn_i(full_doubles_map, result_nverts, -1);
|
||||
copy_vn_i(full_doubles_map, result_nverts, -1);
|
||||
}
|
||||
|
||||
/* copy customdata to original geometry */
|
||||
|
@@ -391,7 +391,7 @@ static void smooth_verts(
|
||||
smooth_weights);
|
||||
}
|
||||
else {
|
||||
fill_vn_fl(smooth_weights, (int)numVerts, 1.0f);
|
||||
copy_vn_fl(smooth_weights, (int)numVerts, 1.0f);
|
||||
}
|
||||
|
||||
if (csmd->flag & MOD_CORRECTIVESMOOTH_PIN_BOUNDARY) {
|
||||
|
@@ -1801,7 +1801,7 @@ static void skin_set_orig_indices(DerivedMesh *dm)
|
||||
totpoly = dm->getNumPolys(dm);
|
||||
orig = CustomData_add_layer(&dm->polyData, CD_ORIGINDEX,
|
||||
CD_CALLOC, NULL, totpoly);
|
||||
fill_vn_i(orig, totpoly, ORIGINDEX_NONE);
|
||||
copy_vn_i(orig, totpoly, ORIGINDEX_NONE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -298,7 +298,7 @@ static DerivedMesh *applyModifier(
|
||||
|
||||
/* save doing 2 loops here... */
|
||||
#if 0
|
||||
fill_vn_i(edge_users, numEdges, INVALID_UNUSED);
|
||||
copy_vn_i(edge_users, numEdges, INVALID_UNUSED);
|
||||
#endif
|
||||
|
||||
for (eidx = 0, ed = orig_medge; eidx < numEdges; eidx++, ed++) {
|
||||
@@ -505,7 +505,7 @@ static DerivedMesh *applyModifier(
|
||||
unsigned int i;
|
||||
|
||||
vert_lens = MEM_mallocN(sizeof(float) * numVerts, "vert_lens");
|
||||
fill_vn_fl(vert_lens, (int)numVerts, FLT_MAX);
|
||||
copy_vn_fl(vert_lens, (int)numVerts, FLT_MAX);
|
||||
for (i = 0; i < numEdges; i++) {
|
||||
const float ed_len_sq = len_squared_v3v3(mvert[medge[i].v1].co, mvert[medge[i].v2].co);
|
||||
vert_lens[medge[i].v1] = min_ff(vert_lens[medge[i].v1], ed_len_sq);
|
||||
@@ -672,7 +672,7 @@ static DerivedMesh *applyModifier(
|
||||
float *vert_lens_sq = MEM_mallocN(sizeof(float) * numVerts, "vert_lens");
|
||||
const float offset = fabsf(smd->offset) * smd->offset_clamp;
|
||||
const float offset_sq = offset * offset;
|
||||
fill_vn_fl(vert_lens_sq, (int)numVerts, FLT_MAX);
|
||||
copy_vn_fl(vert_lens_sq, (int)numVerts, FLT_MAX);
|
||||
for (i = 0; i < numEdges; i++) {
|
||||
const float ed_len = len_squared_v3v3(mvert[medge[i].v1].co, mvert[medge[i].v2].co);
|
||||
vert_lens_sq[medge[i].v1] = min_ff(vert_lens_sq[medge[i].v1], ed_len);
|
||||
|
@@ -1858,7 +1858,7 @@ static PyObject *Matrix_zero(MatrixObject *self)
|
||||
if (BaseMath_Prepare_ForWrite(self) == -1)
|
||||
return NULL;
|
||||
|
||||
fill_vn_fl(self->matrix, self->num_col * self->num_row, 0.0f);
|
||||
copy_vn_fl(self->matrix, self->num_col * self->num_row, 0.0f);
|
||||
|
||||
if (BaseMath_WriteCallback(self) == -1)
|
||||
return NULL;
|
||||
|
@@ -76,7 +76,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fill_vn_fl(vec, size, 0.0f);
|
||||
copy_vn_fl(vec, size, 0.0f);
|
||||
break;
|
||||
case 1:
|
||||
if ((size = mathutils_array_parse_alloc(&vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) {
|
||||
@@ -142,7 +142,7 @@ static PyObject *C_Vector_Fill(PyObject *cls, PyObject *args)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fill_vn_fl(vec, size, fill);
|
||||
copy_vn_fl(vec, size, fill);
|
||||
|
||||
return Vector_CreatePyObject_alloc(vec, size, (PyTypeObject *)cls);
|
||||
}
|
||||
@@ -339,7 +339,7 @@ static PyObject *Vector_zero(VectorObject *self)
|
||||
if (BaseMath_Prepare_ForWrite(self) == -1)
|
||||
return NULL;
|
||||
|
||||
fill_vn_fl(self->vec, self->size, 0.0f);
|
||||
copy_vn_fl(self->vec, self->size, 0.0f);
|
||||
|
||||
if (BaseMath_WriteCallback(self) == -1)
|
||||
return NULL;
|
||||
@@ -426,7 +426,7 @@ static PyObject *Vector_resize(VectorObject *self, PyObject *value)
|
||||
|
||||
/* If the vector has increased in length, set all new elements to 0.0f */
|
||||
if (size > self->size) {
|
||||
fill_vn_fl(self->vec + self->size, size - self->size, 0.0f);
|
||||
copy_vn_fl(self->vec + self->size, size - self->size, 0.0f);
|
||||
}
|
||||
|
||||
self->size = size;
|
||||
@@ -465,7 +465,7 @@ static PyObject *Vector_resized(VectorObject *self, PyObject *value)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fill_vn_fl(vec, size, 0.0f);
|
||||
copy_vn_fl(vec, size, 0.0f);
|
||||
memcpy(vec, self->vec, self->size * sizeof(float));
|
||||
|
||||
return Vector_CreatePyObject_alloc(vec, size, NULL);
|
||||
@@ -2236,7 +2236,7 @@ static int Vector_length_set(VectorObject *self, PyObject *value)
|
||||
return -1;
|
||||
}
|
||||
if (param == 0.0) {
|
||||
fill_vn_fl(self->vec, self->size, 0.0f);
|
||||
copy_vn_fl(self->vec, self->size, 0.0f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3030,7 +3030,7 @@ PyObject *Vector_CreatePyObject(
|
||||
memcpy(self->vec, vec, size * sizeof(float));
|
||||
}
|
||||
else { /* new empty */
|
||||
fill_vn_fl(self->vec, size, 0.0f);
|
||||
copy_vn_fl(self->vec, size, 0.0f);
|
||||
if (size == 4) { /* do the homogeneous thing */
|
||||
self->vec[3] = 1.0f;
|
||||
}
|
||||
|
Reference in New Issue
Block a user