diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 07:08:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 07:09:09 +0300 |
commit | c7ec1fa5e66ef96b7ea1f1c082683c227930bae3 (patch) | |
tree | ae918690dbd5b078a23e41e9faaa5a2cf8bcef92 /source/blender/blenkernel/intern/object.c | |
parent | 7fe3d1e7d718561e275f21acc7261207e67bf685 (diff) |
Cleanup: use BKE_object_* prefix for object API
Also minor style cleanup.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 9c166d154a3..af815175302 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2672,6 +2672,24 @@ void BKE_object_empty_draw_type_set(Object *ob, const int value) } } +bool BKE_object_empty_image_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d) +{ + int visibility_flag = ob->empty_image_visibility_flag; + + if ((visibility_flag & OB_EMPTY_IMAGE_VISIBLE_BACKSIDE) == 0) { + if (dot_v3v3((float *)&ob->obmat[2], (float *)&rv3d->viewinv[2]) < 0.0f) { + return false; + } + } + + if (rv3d->is_persp) { + return visibility_flag & OB_EMPTY_IMAGE_VISIBLE_PERSPECTIVE; + } + else { + return visibility_flag & OB_EMPTY_IMAGE_VISIBLE_ORTHOGRAPHIC; + } +} + bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, float r_min[3], float r_max[3], const bool use_hidden) { bool ok = false; @@ -4048,7 +4066,6 @@ bool BKE_object_modifier_update_subframe( return false; } - void BKE_object_type_set_empty_for_versioning(Object *ob) { ob->type = OB_EMPTY; @@ -4059,21 +4076,3 @@ void BKE_object_type_set_empty_for_versioning(Object *ob) } ob->mode = OB_MODE_OBJECT; } - -bool BKE_image_empty_visible_in_view3d(const Object *ob, const RegionView3D *rv3d) -{ - int visibility_flag = ob->empty_image_visibility_flag; - - if ((visibility_flag & OB_EMPTY_IMAGE_VISIBLE_BACKSIDE) == 0) { - if (dot_v3v3((float *)&ob->obmat[2], (float *)&rv3d->viewinv[2]) < 0.0f) { - return false; - } - } - - if (rv3d->is_persp) { - return visibility_flag & OB_EMPTY_IMAGE_VISIBLE_PERSPECTIVE; - } - else { - return visibility_flag & OB_EMPTY_IMAGE_VISIBLE_ORTHOGRAPHIC; - } -} |