|
Blender V5.0
|
#include <overlay_bounds.hh>
Inherits blender::draw::overlay::Overlay.
Public Member Functions | |
| Bounds (const SelectionType selection_type) | |
| void | begin_sync (Resources &, const State &) final |
| void | object_sync (Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final |
| void | end_sync (Resources &res, const State &state) final |
| void | draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final |
Draw object bounds and texture space.
The object bound can be drawn because of:
Texture space can be modified by (Data > Texture Space) and displayed by (Object > Viewport Display > Texture Space)
Definition at line 33 of file overlay_bounds.hh.
|
inline |
Definition at line 51 of file overlay_bounds.hh.
Synchronization creates and fill render passes based on context state and scene state.
It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.
IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).
This method must be implemented.
Implements blender::draw::overlay::Overlay.
Definition at line 53 of file overlay_bounds.hh.
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 224 of file overlay_bounds.hh.
References GPU_framebuffer_bind(), and view.
Finalize passes or buffers used for object sync. Runs once at the start of the sync cycle.
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 206 of file overlay_bounds.hh.
References DRW_CLIPPING_UBO_SLOT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, OVERLAY_GLOBALS_SLOT, and state.
|
inlinefinalvirtual |
Fills passes or buffers for each object. Runs for each individual object state. IMPORTANT: Can run only once for instances using the same state (#ObjectRef might contains instancing data).
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 63 of file overlay_bounds.hh.
References BKE_curve_texspace_ensure(), BKE_mball_is_basis(), BKE_mesh_texspace_ensure(), BKE_object_boundbox_get(), BKE_object_evaluated_geometry_bounds(), BLI_assert_unreachable, Object::boundtype, blender::Bounds< T >::center(), data, Object::data, DRW_object_get_data_for_drawing(), Object::dt, Object::dtx, ELEM, blender::math::from_scale(), GS, ID_CU_LEGACY, ID_CV, ID_MB, ID_ME, ID_PT, ID_VO, blender::draw::overlay::is_from_dupli_or_set(), blender::MatBase< T, NumCol, NumRow, Alignment >::location(), blender::math::max(), blender::math::midpoint(), ID::name, OB_ARMATURE, OB_BOUND_BOX, OB_BOUND_CAPSULE, OB_BOUND_CONE, OB_BOUND_CYLINDER, OB_BOUND_SPHERE, OB_BOUNDBOX, OB_CAMERA, OB_DRAWBOUNDOX, OB_EMPTY, OB_LAMP, OB_LATTICE, OB_LIGHTPROBE, OB_MBALL, OB_SPEAKER, OB_TEXSPACE, RB_SHAPE_BOX, RB_SHAPE_CAPSULE, RB_SHAPE_CONE, RB_SHAPE_CYLINDER, RB_SHAPE_SPHERE, blender::math::reduce_max(), Object::rigidbody_object, blender::math::scale(), RigidBodyOb::shape, size(), state, Curve::texspace_location, Mesh::texspace_location, MetaBall::texspace_location, Curve::texspace_size, Mesh::texspace_size, MetaBall::texspace_size, Object::type, and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().