Blender V4.5
blender::draw::overlay::Metaballs Class Reference

#include <overlay_metaball.hh>

Inherits blender::draw::overlay::Overlay.

Public Member Functions

 Metaballs (const SelectionType selection_type)
 
void begin_sync (Resources &, const State &) final
 
void edit_object_sync (Manager &, const ObjectRef &ob_ref, Resources &res, 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
 

Detailed Description

Draw meta-balls radius overlays.

Definition at line 22 of file overlay_metaball.hh.

Constructor & Destructor Documentation

◆ Metaballs()

blender::draw::overlay::Metaballs::Metaballs ( const SelectionType selection_type)
inline

Definition at line 33 of file overlay_metaball.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Metaballs::begin_sync ( Resources & ,
const State &  )
inlinefinalvirtual

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 35 of file overlay_metaball.hh.

References blender::draw::overlay::ShapeInstanceBuf< InstanceDataT >::clear().

◆ draw_line()

void blender::draw::overlay::Metaballs::draw_line ( Framebuffer & framebuffer,
Manager & manager,
View & view )
inlinefinalvirtual

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 107 of file overlay_metaball.hh.

References GPU_framebuffer_bind(), and view.

◆ edit_object_sync()

void blender::draw::overlay::Metaballs::edit_object_sync ( Manager & ,
const ObjectRef & ,
Resources & ,
const State &  )
inlinefinalvirtual

Fills passes or buffers for each object in edit mode. Runs for each individual object state for a specific mode. 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 40 of file overlay_metaball.hh.

References blender::draw::overlay::ShapeInstanceBuf< InstanceDataT >::append(), BKE_mball_element_display_radius_calc_with_stiffness(), DRW_object_get_data_for_drawing(), MetaBall::editelems, LISTBASE_FOREACH, MB_SCALE_RAD, MBALLSEL_RADIUS, MBALLSEL_STIFF, and SELECT.

Referenced by blender::draw::overlay::Instance::object_sync().

◆ end_sync()

◆ object_sync()

void blender::draw::overlay::Metaballs::object_sync ( Manager & ,
const ObjectRef & ,
Resources & ,
const 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 72 of file overlay_metaball.hh.

References blender::draw::overlay::ShapeInstanceBuf< InstanceDataT >::append(), BKE_mball_element_display_radius_calc(), DRW_object_get_data_for_drawing(), MetaBall::elems, LISTBASE_FOREACH, and state.

Referenced by blender::draw::overlay::Instance::object_sync().


The documentation for this class was generated from the following file: