Page MenuHome

Add backdrop callback.
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Apr 19 2019, 6:52 PM.

Details

Summary

Issue has come up here and here
changing the view matrix every time regardless if there
was a callback seemed unnecessarily expensive, added
ED_region_has_draw_cb to see if a region has a call
back of a specific type.

Currently 0,0 is in the lower left corer unsure what
would be better here, 0,0 in the lower left or in the
center of the region.

for easy testing the script from Stevo312 can be used just change the callback to BACKDROP

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested changes to this revision.Apr 23 2019, 11:15 AM

Having REGION_DRAW_BACKDROP makes sense.

The ED_region_has_draw_cb function seems to be an unnecessary optimization.
AFAIK changing the view matrix is very cheap compared to the other stuff that is happening.
If you remove it, you can ignore the inline comments.

source/blender/editors/include/ED_space_api.h
71

missing name for the int parameter

source/blender/editors/space_api/spacetypes.c
268 ↗(On Diff #14831)

why not return bool?

What kind of type? Choose a more descriptive variable name?

This revision now requires changes to proceed.Apr 23 2019, 11:15 AM
Ray Molenkamp (LazyDodo) edited the summary of this revision. (Show Details)
  • Merge remote-tracking branch 'origin/master' into backdrop_cb
  • Remove unneeded optimization.
Ray Molenkamp (LazyDodo) marked an inline comment as done.Apr 23 2019, 2:45 PM
This revision is now accepted and ready to land.Apr 23 2019, 2:51 PM
This revision was automatically updated to reflect the committed changes.