forked from bartvdbraak/blender
fix own error in recent smoothview cleanup, also correct some cross references in bmesh docs.
This commit is contained in:
parent
9281f3e27e
commit
e9caa21830
@ -498,7 +498,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*if no object, set to INT_MAX so we don't mess up any shapekey layers*/
|
||||
/* if no object, set to INT_MAX so we don't mess up any shapekey layers */
|
||||
uid = INT_MAX;
|
||||
}
|
||||
|
||||
@ -1188,7 +1188,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
|
||||
wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba);
|
||||
|
||||
/* Now copy colors in all face verts. */
|
||||
/*first add colors to the tessellation faces*/
|
||||
/* first add colors to the tessellation faces */
|
||||
/* XXX Why update that layer? We have to update WEIGHT_MLOOPCOL anyway,
|
||||
* and tessellation recreates mface layers from mloop/mpoly ones, so no
|
||||
* need to fill WEIGHT_MCOL here. */
|
||||
|
@ -210,7 +210,7 @@ bArmature *BKE_armature_copy(bArmature *arm)
|
||||
newArm = BKE_libblock_copy(&arm->id);
|
||||
BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
|
||||
|
||||
/* Duplicate the childrens' lists*/
|
||||
/* Duplicate the childrens' lists */
|
||||
newBone = newArm->bonebase.first;
|
||||
for (oldBone = arm->bonebase.first; oldBone; oldBone = oldBone->next) {
|
||||
newBone->parent = NULL;
|
||||
|
@ -425,7 +425,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
|
||||
if (flbr->ob) {
|
||||
float vec2[3], t;
|
||||
|
||||
/* first check we're not blocking the leader*/
|
||||
/* first check we're not blocking the leader */
|
||||
sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
|
||||
mul_v3_fl(vec, 1.0f/bbd->timestep);
|
||||
|
||||
|
@ -1869,7 +1869,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
|
||||
|
||||
dm->deformedOnly = 1;
|
||||
|
||||
/*don't add origindex layer if one already exists*/
|
||||
/* don't add origindex layer if one already exists */
|
||||
add_orig = !CustomData_has_layer(&bm->pdata, CD_ORIGINDEX);
|
||||
|
||||
mask = use_mdisps ? CD_MASK_DERIVEDMESH | CD_MASK_MDISPS : CD_MASK_DERIVEDMESH;
|
||||
@ -1886,7 +1886,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
|
||||
CustomData_merge(&bm->pdata, &dm->polyData, mask,
|
||||
CD_CALLOC, dm->numPolyData);
|
||||
|
||||
/*add tessellation mface layers*/
|
||||
/* add tessellation mface layers */
|
||||
if (use_tessface) {
|
||||
CustomData_from_bmeshpoly(&dm->faceData, &dm->polyData, &dm->loopData, em->tottri);
|
||||
}
|
||||
@ -2260,7 +2260,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
|
||||
newe = MEM_callocN(sizeof(int) * dm->numEdgeData, "newv etable CDDM_merge_verts");
|
||||
newl = MEM_callocN(sizeof(int) * totloop, "newv ltable CDDM_merge_verts");
|
||||
|
||||
/*fill newl with destination vertex indices*/
|
||||
/* fill newl with destination vertex indices */
|
||||
mv = cddm->mvert;
|
||||
c = 0;
|
||||
for (i = 0; i < dm->numVertData; i++, mv++) {
|
||||
@ -2271,14 +2271,14 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
|
||||
}
|
||||
}
|
||||
|
||||
/*now link target vertices to destination indices*/
|
||||
/* now link target vertices to destination indices */
|
||||
for (i = 0; i < dm->numVertData; i++) {
|
||||
if (vtargetmap[i] != -1) {
|
||||
newv[i] = newv[vtargetmap[i]];
|
||||
}
|
||||
}
|
||||
|
||||
/*find-replace merged vertices with target vertices*/
|
||||
/* find-replace merged vertices with target vertices */
|
||||
ml = cddm->mloop;
|
||||
for (i = 0; i < totloop; i++, ml++) {
|
||||
if (vtargetmap[ml->v] != -1) {
|
||||
@ -2286,7 +2286,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
|
||||
}
|
||||
}
|
||||
|
||||
/*now go through and fix edges and faces*/
|
||||
/* now go through and fix edges and faces */
|
||||
med = cddm->medge;
|
||||
c = 0;
|
||||
for (i = 0; i < dm->numEdgeData; i++, med++) {
|
||||
|
@ -2139,8 +2139,8 @@ void CustomData_set(const CustomData *data, int index, int type, void *source)
|
||||
memcpy(dest, source, typeInfo->size);
|
||||
}
|
||||
|
||||
/*Bmesh functions*/
|
||||
/*needed to convert to/from different face reps*/
|
||||
/* BMesh functions */
|
||||
/* needed to convert to/from different face reps */
|
||||
void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata,
|
||||
int totloop, int totpoly)
|
||||
{
|
||||
|
@ -4318,7 +4318,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
|
||||
dir_factor = dir_dot * MIN2(speed_scale, 1.0f) * w_factor;
|
||||
if (dir_factor > 0.5f) dir_factor = 0.5f;
|
||||
|
||||
/* mix new wetness*/
|
||||
/* mix new wetness */
|
||||
ePoint->wetness += dir_factor;
|
||||
CLAMP(ePoint->wetness, 0.0f, MAX_WETNESS);
|
||||
|
||||
|
@ -151,7 +151,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
|
||||
#endif
|
||||
|
||||
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
|
||||
/*don't consider two-edged faces*/
|
||||
/* don't consider two-edged faces */
|
||||
if (efa->len < 3) {
|
||||
/* do nothing */
|
||||
}
|
||||
@ -198,7 +198,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
|
||||
|
||||
/* scanfill time */
|
||||
BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, j) {
|
||||
/*mark order*/
|
||||
/*mark order */
|
||||
BM_elem_index_set(l, j); /* set_loop */
|
||||
|
||||
sf_vert = BLI_scanfill_vert_add(&sf_ctx, l->v->co);
|
||||
@ -334,7 +334,7 @@ typedef struct EditDerivedBMesh {
|
||||
float (*polyNos)[3];
|
||||
|
||||
/* private variables, for number of verts/edges/faces
|
||||
* within the above hash/table members*/
|
||||
* within the above hash/table members */
|
||||
int tv, te, tf;
|
||||
} EditDerivedBMesh;
|
||||
|
||||
|
@ -422,7 +422,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
|
||||
}
|
||||
#endif
|
||||
|
||||
/* make a copy at distance ofsx, ofsy with shear*/
|
||||
/* make a copy at distance ofsx, ofsy with shear */
|
||||
fsize = cu->fsize;
|
||||
shear = cu->shear;
|
||||
si = sinf(rot);
|
||||
|
@ -97,7 +97,7 @@ void free_gpencil_layers(ListBase *list)
|
||||
/* error checking */
|
||||
if (list == NULL) return;
|
||||
|
||||
/* delete layers*/
|
||||
/* delete layers */
|
||||
for (gpl = list->first; gpl; gpl = gpln) {
|
||||
gpln = gpl->next;
|
||||
|
||||
|
@ -159,12 +159,12 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
|
||||
|
||||
newarr = MEM_callocN(sizeof(IDProperty) * newsize, "idproperty array resized");
|
||||
if (newlen >= prop->len) {
|
||||
/* newlen is bigger*/
|
||||
/* newlen is bigger */
|
||||
memcpy(newarr, prop->data.pointer, prop->len * sizeof(IDProperty));
|
||||
}
|
||||
else {
|
||||
int i;
|
||||
/* newlen is smaller*/
|
||||
/* newlen is smaller */
|
||||
for (i = newlen; i < prop->len; i++) {
|
||||
IDP_FreeProperty(GETPROP(prop, i));
|
||||
}
|
||||
@ -233,12 +233,12 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
|
||||
|
||||
newarr = MEM_callocN(idp_size_table[(int)prop->subtype] * newsize, "idproperty array resized");
|
||||
if (newlen >= prop->len) {
|
||||
/* newlen is bigger*/
|
||||
/* newlen is bigger */
|
||||
memcpy(newarr, prop->data.pointer, prop->len * idp_size_table[(int)prop->subtype]);
|
||||
idp_resize_group_array(prop, newlen, newarr);
|
||||
}
|
||||
else {
|
||||
/* newlen is smaller*/
|
||||
/* newlen is smaller */
|
||||
idp_resize_group_array(prop, newlen, newarr);
|
||||
memcpy(newarr, prop->data.pointer, newlen * idp_size_table[(int)prop->subtype]);
|
||||
}
|
||||
@ -694,7 +694,7 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
|
||||
break;
|
||||
case IDP_ARRAY:
|
||||
{
|
||||
/*for now, we only support float and int and double arrays*/
|
||||
/* for now, we only support float and int and double arrays */
|
||||
if ( (val->array.type == IDP_FLOAT) ||
|
||||
(val->array.type == IDP_INT) ||
|
||||
(val->array.type == IDP_DOUBLE) ||
|
||||
|
@ -167,7 +167,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
|
||||
for (j = 0; j < vtot; j++, v1++, v2++) {
|
||||
if (len_v3v3(v1->co, v2->co) > thresh)
|
||||
return MESHCMP_VERTCOMISMATCH;
|
||||
/*I don't care about normals, let's just do coodinates*/
|
||||
/* I don't care about normals, let's just do coodinates */
|
||||
}
|
||||
}
|
||||
|
||||
@ -990,7 +990,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
|
||||
|
||||
MEM_freeN(edsort);
|
||||
|
||||
/*set edge members of mloops*/
|
||||
/* set edge members of mloops */
|
||||
medge = *alledge;
|
||||
for (a = 0; a < *_totedge; a++, medge++) {
|
||||
BLI_edgehash_insert(hash, medge->v1, medge->v2, SET_INT_IN_POINTER(a));
|
||||
@ -2820,7 +2820,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
|
||||
mf = &mface[k];
|
||||
|
||||
if (mf->edcode == 3) {
|
||||
/*sort loop indices to ensure winding is correct*/
|
||||
/* sort loop indices to ensure winding is correct */
|
||||
/* NO SORT - looks like we can skip this */
|
||||
|
||||
lindex[0] = mf->v1;
|
||||
@ -2828,7 +2828,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
|
||||
lindex[2] = mf->v3;
|
||||
lindex[3] = 0; /* unused */
|
||||
|
||||
/*transform loop indices to vert indices*/
|
||||
/* transform loop indices to vert indices */
|
||||
mf->v1 = mloop[mf->v1].v;
|
||||
mf->v2 = mloop[mf->v2].v;
|
||||
mf->v3 = mloop[mf->v3].v;
|
||||
@ -2839,7 +2839,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
|
||||
test_index_face(mf, fdata, k, 3);
|
||||
}
|
||||
else {
|
||||
/*sort loop indices to ensure winding is correct*/
|
||||
/* sort loop indices to ensure winding is correct */
|
||||
/* NO SORT - looks like we can skip this */
|
||||
|
||||
lindex[0] = mf->v1;
|
||||
@ -2847,7 +2847,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
|
||||
lindex[2] = mf->v3;
|
||||
lindex[3] = mf->v4;
|
||||
|
||||
/*transform loop indices to vert indices*/
|
||||
/* transform loop indices to vert indices */
|
||||
mf->v1 = mloop[mf->v1].v;
|
||||
mf->v2 = mloop[mf->v2].v;
|
||||
mf->v3 = mloop[mf->v3].v;
|
||||
|
@ -1815,7 +1815,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
|
||||
/* backup */
|
||||
|
||||
|
||||
/* now fill in polys to mfaces*/
|
||||
/* now fill in polys to mfaces */
|
||||
mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata,
|
||||
mesh->totface, backup_mesh.totloop, backup_mesh.totpoly);
|
||||
|
||||
|
@ -1946,7 +1946,7 @@ int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
|
||||
}
|
||||
|
||||
/**
|
||||
* High level function which wraps both #bm_vert_separate and #bm_edge_separate
|
||||
* High level function which wraps both #bmesh_vert_separate and #bmesh_edge_separate
|
||||
*/
|
||||
int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
|
||||
BMEdge **e_in, int e_in_len)
|
||||
|
@ -567,9 +567,9 @@ BMFace *BM_active_face_get(BMesh *bm, int sloppy)
|
||||
* These functions were written to be used by the Modifier widget
|
||||
* when in Rotate about active mode, but can be used anywhere.
|
||||
*
|
||||
* - #EM_editselection_center
|
||||
* - #EM_editselection_normal
|
||||
* - #EM_editselection_plane
|
||||
* - #BM_editselection_center
|
||||
* - #BM_editselection_normal
|
||||
* - #BM_editselection_plane
|
||||
*/
|
||||
void BM_editselection_center(BMEditSelection *ese, float r_center[3])
|
||||
{
|
||||
|
@ -384,7 +384,7 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
|
||||
* \param bm The bmesh
|
||||
* \param f the original face
|
||||
* \param v1, v2 vertices which define the split edge, must be different
|
||||
* \param co Array of coordinates for intermediate points
|
||||
* \param cos Array of coordinates for intermediate points
|
||||
* \param n Length of \a cos (must be > 0)
|
||||
* \param r_l pointer which will receive the BMLoop for the first split edge (from \a v1) in the new face
|
||||
* \param example Edge used for attributes of splitting edge, if non-NULL
|
||||
@ -888,6 +888,7 @@ int BM_edge_rotate_check(BMEdge *e)
|
||||
* 1) does the newly forms edge form a flipped face (compare with previous cross product)
|
||||
* 2) does the newly formed edge cause a zero area corner (or close enough to be almost zero)
|
||||
*
|
||||
* \param e The edge to test rotation.
|
||||
* \param l1,l2 are the loops of the proposed verts to rotate too and should
|
||||
* be the result of calling #BM_edge_calc_rotate
|
||||
*/
|
||||
|
@ -664,7 +664,8 @@ static int bm_face_goodline(float const (*projectverts)[3], BMFace *f, int v1i,
|
||||
* \brief Find Ear
|
||||
*
|
||||
* Used by tessellator to find the next triangle to 'clip off' of a polygon while tessellating.
|
||||
*
|
||||
* \param f The face to search.
|
||||
* \param verts an array of face vert coords.
|
||||
* \param use_beauty Currently only applies to quads, can be extended later on.
|
||||
* \param abscoss Must be allocated by caller, and at least f->len length
|
||||
* (allow to avoid allocating a new one for each tri!).
|
||||
|
@ -797,7 +797,6 @@ float BM_loop_calc_face_angle(BMLoop *l)
|
||||
*
|
||||
* Calculate the normal at this loop corner or fallback to the face normal on straight lines.
|
||||
*
|
||||
* \param bm The BMesh
|
||||
* \param l The loop to calculate the normal at
|
||||
* \param r_normal Resulting normal
|
||||
*/
|
||||
@ -821,7 +820,6 @@ void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3])
|
||||
* Calculate the tangent at this loop corner or fallback to the face normal on straight lines.
|
||||
* This vector always points inward into the face.
|
||||
*
|
||||
* \param bm The BMesh
|
||||
* \param l The loop to calculate the tangent at
|
||||
* \param r_tangent Resulting tangent
|
||||
*/
|
||||
@ -881,6 +879,7 @@ float BM_edge_calc_face_angle(BMEdge *e)
|
||||
* \param e
|
||||
* \param e_loop The loop to calculate the tangent at,
|
||||
* used to get the face and winding direction.
|
||||
* \param r_tangent The loop corner tangent to set
|
||||
*/
|
||||
|
||||
void BM_edge_calc_face_tangent(BMEdge *e, BMLoop *e_loop, float r_tangent[3])
|
||||
|
@ -229,7 +229,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
|
||||
if ( (i != (data->poly_order - 1)) || ((i == 0) && data->poly_order == 2) ) {
|
||||
uiDefBut(block, LABEL, 1, ") +", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
|
||||
|
||||
/* set up new row for the next pair of coefficients*/
|
||||
/* set up new row for the next pair of coefficients */
|
||||
row = uiLayoutRow(layout, TRUE);
|
||||
block = uiLayoutGetBlock(row);
|
||||
}
|
||||
|
@ -1585,7 +1585,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties s*/
|
||||
/* properties */
|
||||
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
|
||||
}
|
||||
|
||||
|
@ -2826,7 +2826,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
|
||||
}
|
||||
|
||||
/* creates the name_array parameter for vgroup_do_remap, call this before fiddling
|
||||
* with the order of vgroups then call vgroup_do_remap after*/
|
||||
* with the order of vgroups then call vgroup_do_remap after */
|
||||
static char *vgroup_init_remap(Object *ob)
|
||||
{
|
||||
bDeformGroup *def;
|
||||
|
@ -1425,7 +1425,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type)
|
||||
/* tell WM to refresh, cursor types etc */
|
||||
WM_event_add_mousemove(C);
|
||||
|
||||
/*send space change notifier*/
|
||||
/* send space change notifier */
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
|
||||
|
||||
ED_area_tag_refresh(sa);
|
||||
@ -1452,7 +1452,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
|
||||
}
|
||||
ED_area_tag_redraw(sa);
|
||||
|
||||
/*send space change notifier*/
|
||||
/* send space change notifier */
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
|
||||
}
|
||||
|
||||
@ -1503,7 +1503,7 @@ static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)
|
||||
ED_area_newspace(C, CTX_wm_area(C), CTX_wm_area(C)->butspacetype);
|
||||
ED_area_tag_redraw(CTX_wm_area(C));
|
||||
|
||||
/*send space change notifier*/
|
||||
/* send space change notifier */
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, CTX_wm_area(C));
|
||||
}
|
||||
|
||||
|
@ -2057,7 +2057,7 @@ static void project_bucket_clip_face(
|
||||
float v1_clipSS[2], v2_clipSS[2];
|
||||
float w[3];
|
||||
|
||||
/* calc center*/
|
||||
/* calc center */
|
||||
float cent[2] = {0.0f, 0.0f};
|
||||
/*float up[2] = {0.0f, 1.0f};*/
|
||||
int i;
|
||||
|
@ -308,7 +308,7 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
|
||||
|
||||
step_inv = 1.0f - step;
|
||||
|
||||
interp_v3_v3v3(rv3d->ofs, sms->new_ofs, sms->orig_ofs, step);
|
||||
interp_v3_v3v3(rv3d->ofs, sms->orig_ofs, sms->new_ofs, step);
|
||||
interp_qt_qtqt(rv3d->viewquat, sms->orig_quat, sms->new_quat, step);
|
||||
|
||||
rv3d->dist = sms->new_dist * step + sms->orig_dist * step_inv;
|
||||
|
@ -882,13 +882,13 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result,
|
||||
mid_v3_v3v3(result, min, max);
|
||||
break;
|
||||
|
||||
case V3D_CURSOR: /*cursor center*/
|
||||
case V3D_CURSOR: /* cursor center */
|
||||
cursx = give_cursor(scene, v3d);
|
||||
/* shift to objects world */
|
||||
sub_v3_v3v3(result, cursx, ob->obmat[3]);
|
||||
break;
|
||||
|
||||
case V3D_LOCAL: /*object center*/
|
||||
case V3D_LOCAL: /* object center */
|
||||
case V3D_CENTROID: /* multiple objects centers, only one object here*/
|
||||
default:
|
||||
result[0] = result[1] = result[2] = 0.0;
|
||||
|
@ -1496,7 +1496,7 @@ static void bound_rectf(rctf *box, const float v1[2])
|
||||
static void isb_bsp_split_init(ISBBranch *root, MemArena *mem, int level)
|
||||
{
|
||||
|
||||
/* if level > 0 we create new branches and go deeper*/
|
||||
/* if level > 0 we create new branches and go deeper */
|
||||
if (level > 0) {
|
||||
ISBBranch *left, *right;
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user