Page MenuHome

fix T53766
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Jan 23 2018, 7:24 PM.

Details

Summary

MeasureIt: measurements not appearing on all layers an object exists on

Diff Detail

Event Timeline

nBurn (nBurn) added a comment.EditedJan 25 2018, 7:25 PM

I tested and can confirm this fixes the bug from T53766. This change looks fine to me. but I think this might be cleaner \ easier to follow:

if myobj.layers[x] is True and x in layers:
    op = myobj.MeasureGenerator[0]
    draw_segments(context, myobj, op, region, rv3d)
    break

Your thoughts?

I forgot MeasureIt runs continuously when the add-on is enabled and measurements are set to "Show". That's why I think I originally left this as two separate statements than using boolean logic to join them as I was not sure how Python handled boolean logic behind the scenes.

@nBurn (nBurn): left me nervous :) , but checked here --> Short-circuit evaluation should apply for pythons and

@Philipp Oeser (lichtwerk) I thought I remembered reading that Python does 1 or 2 additional operations behind the scenes somewhere, but I can't remember the details. I didn't see any significant change in performance with this hastily written test code though, so I say leave the last commit as is. :)