Page MenuHome

Display Weights in Wireframe Mode
AbandonedPublic

Authored by Gaia Clary (gaiaclary) on Mar 9 2014, 12:57 PM.

Details

Diff Detail

Branch
master

Event Timeline

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 1:13 PM

Removed an unrelated Change that was committed unintentionally

source/blender/blenkernel/intern/editderivedmesh.c
326

This should be accessed once and used for every vertex. Then cd_dvert_offset < 0 can be avoided.

Also should check cd_dvert_offset == -1 since its only ever -1

339

BM_vert_at_index isn't needed here, currently its getting the index from the vert, then the vert from the index, just pass the vert. eed->v1 / eed->v2

345

Not sure why col0 is passed.

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

is obedit arg needed?

source/blender/blenkernel/intern/editderivedmesh.c
368

suggest split this into 2 edge loops. same for loop above.

375

best call call color glColor3fv here.

Joshua Leung (aligorith) requested changes to this revision.Mar 9 2014, 1:28 PM
Joshua Leung (aligorith) added inline comments.
source/blender/blenkernel/BKE_DerivedMesh.h
439

I'm not sure that it's good idea (or even necessary) to be passing in an object pointer here. Some reasons:

  1. All the methods here are in an OO-style, with the first parameter being DerivedMesh (i.e. equivalent to "self" in Python)
  2. The only thing you actually do with that pointer is access ob->data, and from there check if a particular flag is set.

Some better options are:

  1. Pass this value in as an additional bool argument instead (like you're doing with dt). Even better may be leaving this as a general flag, but then that may be overkill for now.
  2. Include dt and this bool argument within the "userData" struct that gets passed in, and just add some data unpacking at the start of the method.
source/blender/blenkernel/BKE_DerivedMesh.h
439

Agree, however I dont think its even needed - BMEditMesh has an object pointer.

source/blender/blenkernel/intern/editderivedmesh.c
360

No need to add Object arg, use bmdm->em->ob instead.

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 2:45 PM

Work in Progress. Added parts of the requested changes (not finished)

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 3:16 PM

Removed all unnecessary passing of variables.
Moved the check if weights shall be displayed further up into drawobject.c
and pass a boolean variable instead of flags.

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 3:29 PM

Further cleanup.

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 3:33 PM

Forgot to revert a function declaration

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 11:49 PM

Added support for display unweighted verts with appropriate Theme color.
Also take into account the Show Zero Weights setting from the tool shelf.

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 9 2014, 11:53 PM

Removed obsolete variable

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 10 2014, 2:32 PM

simplified and cleaned the patch. (still work in progress)

Gaia Clary (gaiaclary) updated this revision to Unknown Object (????).Mar 10 2014, 3:21 PM

Moved weightuser information into DMWeightColorInfo to avoid excessive passing of parameters

attached simplified patch with less modifications made

Campbell Barton (campbellbarton) requested changes to this revision.Apr 17 2014, 9:44 AM

The patch didnt work when in edge draw mode, attached update.

Also force depth view when wire color is used.

Note: There is really no need for emDM_drawMappedEdgesInterp to be modified here. draw_em_fancy_edges is already handling color and could optionally use a different function then draw_dm_edges_sel_interp that uses color weights.

Even if this is done, not sure its really good to include this with blender... Would be interesteded if this is something users really think helps them a lot.

This Diff is obsolete and has been replaced by D585