diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-29 05:04:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-29 05:19:22 +0300 |
commit | 15079b0b439ac814600d33cca88c37a8df259f00 (patch) | |
tree | 0f8a5a3166524a7907b9e1db85e0fd3800d62a61 /source/blender/editors/space_view3d/drawobject.c | |
parent | e14fd191054c699722195c7e2b7c635bf837f411 (diff) |
Fix crash & performance regression w/ base lookup
Was doing O(n^2) list lookups with blender-render drawing & transform.
Also missing NULL checks would crash.
Use Object.base_flag (already used by new draw manager in places)
to avoid list lookup.
Note, transform still performs inefficient lookups,
but only for selected parents (like 2.7x), not all parents.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f41602f7899..8b1f44557e4 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -9195,8 +9195,7 @@ afterdraw: /* help lines and so */ if (ob != scene->obedit && ob->parent) { - Base *base_parent = BKE_scene_layer_base_find(sl, ob->parent); - if ((base_parent->flag & BASE_VISIBLED) != 0) { + if ((ob->parent->base_flag & BASE_VISIBLED) != 0) { setlinestyle(3); immBegin(GWN_PRIM_LINES, 2); immVertex3fv(pos, ob->obmat[3]); |