Page MenuHome

The Show weights feature shows some inconsistencies...
Needs RevisionPublic

Authored by Gaia Clary (gaiaclary) on Jun 19 2014, 12:16 AM.

Details

Summary

The problem becomes only apparent when you change the "unreferenced verts color" to something different from black. Then you see weird behaviour depending on whether weight groups are not yet defined, or have been defined and then removed.

Also the display is inconsistent when you switch between solid mode and wireframe mode.

This patch solve both issues.

Diff Detail

Branch
master

Event Timeline

@Campbell Barton (campbellbarton): This is a follow up patch for the weights in wireframe mode patch. this patch makes Blender behave much more consistent when we compare solid mode vs. wireframe mode. In order to see the inconsistencies, you best change the "unreferenced weights" color from black to pink. then you see the inconsistent behaviour immediately.

Here is a blend file as demo:

  • Change the unreferenced weights color to pink (in user preferences)
  • then open the blend file above
  • When you now go to edit mode, then you see the right cube displays in pink, while the left cube displays in black.

the patch fixes this problem.

source/blender/blenkernel/intern/DerivedMesh.c
1219

Here is the reason why a face is drawn in black when no weights are defined for the face verts.
This change uses the Theme's "unreferenced weights color" instead.

source/blender/editors/space_view3d/drawobject.c
2446

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.

2505

See previous comment.

This addresses an inconsistency, but not too happy committing this code... its adding checks to this draw code mainly because its adding a bunch of checks for corner case.

The use of un-weighted color is handy when you're painting, but when theres no weights at all, its not really useful IMHO.

If you think this is important, suggest to have an alternative callback to pass in to drawMappedEdgesInterp, since theres no need to check per-vertex checks if theres no weights in the entire mesh.
You can set the color once, then draw all edges in that case.

Campbell Barton (campbellbarton) requested changes to this revision.Jun 19 2014, 8:20 AM
Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Jun 19 2014, 9:55 AM

Removed changes from drawobject.c
i believe that setting the color to 0 in this case ( line 1218: col_i = 0; )
was not the intention.

With this patch faces are drawn in the unreferenced weights color when
one of the "show zero weights" options is enabled.

@Campbell Barton (campbellbarton): Could you agree that this change is reasonable ? I believe that line 1218 : col_i=0 was used before we had the "unreferenced weights" Theme color.

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Jun 19 2014, 12:21 PM
  • Added back solution for drawing unweighted wires when no weights are defined

but show zero weights is enabled.

This revision now requires changes to proceed.Nov 20 2014, 9:46 AM