Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/drawobject.c
| Show First 20 Lines • Show All 2,427 Lines • ▼ Show 20 Lines | static void draw_dm_edges_sel_interp(BMEditMesh *em, DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol) | ||||
| data.selCol = selCol; | data.selCol = selCol; | ||||
| data.lastCol = NULL; | data.lastCol = NULL; | ||||
| dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_sel_interp__setDrawInterpOptions, &data); | dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_sel_interp__setDrawInterpOptions, &data); | ||||
| } | } | ||||
| static void bm_color_from_weight(float col[3], BMVert *vert, drawDMEdgesWeightInterp_userData *data) | static void bm_color_from_weight(float col[3], BMVert *vert, drawDMEdgesWeightInterp_userData *data) | ||||
| { | { | ||||
| bool use_alert_color = false; | |||||
| if (data->cd_dvert_offset == -1 || data->vgroup_index == -1) { | |||||
| if (data->weight_user != OB_DRAW_GROUPUSER_NONE) { | |||||
| copy_v3_v3(col, data->alert_color); | |||||
| } | |||||
| else { | |||||
| weight_to_rgb(col, 0.0f); | |||||
| } | |||||
| return; | |||||
| } | |||||
gaiaclary: I have moved this check down into this function, because otherwise we will get an inconsistent… | |||||
| MDeformVert *dvert = BM_ELEM_CD_GET_VOID_P(vert, data->cd_dvert_offset); | MDeformVert *dvert = BM_ELEM_CD_GET_VOID_P(vert, data->cd_dvert_offset); | ||||
| float weight = defvert_find_weight(dvert, data->vgroup_index); | float weight = defvert_find_weight(dvert, data->vgroup_index); | ||||
| if ((weight == 0.0f) && | if ((weight == 0.0f) && | ||||
| ((data->weight_user == OB_DRAW_GROUPUSER_ACTIVE) || | ((data->weight_user == OB_DRAW_GROUPUSER_ACTIVE) || | ||||
| ((data->weight_user == OB_DRAW_GROUPUSER_ALL) && defvert_is_weight_zero(dvert, data->defgroup_tot)))) | ((data->weight_user == OB_DRAW_GROUPUSER_ALL) && defvert_is_weight_zero(dvert, data->defgroup_tot)))) | ||||
| { | { | ||||
| copy_v3_v3(col, data->alert_color); | copy_v3_v3(col, data->alert_color); | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | static void draw_dm_edges_weight_interp(BMEditMesh *em, DerivedMesh *dm, const char weight_user) | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_weight_interp__setDrawInterpOptions, &data); | dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_weight_interp__setDrawInterpOptions, &data); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| static bool draw_dm_edges_weight_check(Mesh *me, BMEditMesh *em, View3D *v3d) | static bool draw_dm_edges_weight_check(Mesh *me, BMEditMesh *em, View3D *v3d) | ||||
| { | { | ||||
| if ((me->drawflag & ME_DRAWEIGHT) && | if (me->drawflag & ME_DRAWEIGHT) | ||||
gaiaclaryAuthorUnsubmitted Not Done Inline ActionsSee previous comment. gaiaclary: See previous comment. | |||||
| (em->ob->actdef) && | |||||
| (CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT))) | |||||
| { | { | ||||
| if ((v3d->drawtype == OB_WIRE) || | if ((v3d->drawtype == OB_WIRE) || | ||||
| (v3d->flag2 & V3D_SOLID_MATCAP) || | (v3d->flag2 & V3D_SOLID_MATCAP) || | ||||
| ((v3d->flag2 & V3D_OCCLUDE_WIRE) && (v3d->drawtype > OB_WIRE))) | ((v3d->flag2 & V3D_OCCLUDE_WIRE) && (v3d->drawtype > OB_WIRE))) | ||||
| { | { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 5,673 Lines • Show Last 20 Lines | |||||
I have moved this check down into this function, because otherwise we will get an inconsistent behavior when no weights are defined, but weights should be displayed. In that case the solid view mode shows the unreferenced weights color, while the wireframe mode would display blue edges.
This change makes it consistently display the unreferenced weights color.