Blender V4.3
blender::draw::select::SelectMap Struct Reference

#include <select_instance.hh>

Inherited by blender::draw::overlay::Resources.

Public Member Functions

 SelectMap (const SelectionType selection_type)
 
const ID select_id (const ObjectRef &ob_ref, uint sub_object_id=0)
 
void begin_sync ()
 
void select_bind (PassSimple &pass)
 
void select_bind (PassMain &pass)
 
void select_bind (PassMain &pass, PassMain::Sub &sub)
 
void end_sync ()
 
void read_result ()
 

Static Public Member Functions

static const ID select_invalid_id ()
 

Public Attributes

const SelectionType selection_type
 
Vector< uintselect_id_map
 
Vector< std::string > map_names
 
StorageArrayBuffer< uintselect_output_buf = {"select_output_buf"}
 
StorageArrayBuffer< uint, 4, truedummy_select_buf = {"dummy_select_buf"}
 
UniformBuffer< SelectInfoDatainfo_buf
 
bool disable_depth_test = false
 

Detailed Description

Generate selection IDs from objects and keep record of the mapping between them. The id's are contiguous so that we can create a destination buffer.

Definition at line 88 of file select_instance.hh.

Constructor & Destructor Documentation

◆ SelectMap()

blender::draw::select::SelectMap::SelectMap ( const SelectionType selection_type)
inline

Definition at line 106 of file select_instance.hh.

Member Function Documentation

◆ begin_sync()

◆ end_sync()

◆ read_result()

◆ select_bind() [1/3]

void blender::draw::select::SelectMap::select_bind ( PassMain & pass)
inline

IMPORTANT: Changes the draw state. Need to be called after the pass's own state_set.

Definition at line 198 of file select_instance.hh.

References disable_depth_test, blender::draw::select::DISABLED, DRW_STATE_WRITE_COLOR, dummy_select_buf, info_buf, SELECT_DATA, SELECT_ID_IN, SELECT_ID_OUT, select_output_buf, and selection_type.

◆ select_bind() [2/3]

◆ select_bind() [3/3]

◆ select_id()

const ID blender::draw::select::SelectMap::select_id ( const ObjectRef & ob_ref,
uint sub_object_id = 0 )
inlinenodiscard

Definition at line 110 of file select_instance.hh.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index(), blender::draw::select::DISABLED, Object::id, map_names, ID::name, blender::draw::ObjectRef::object, printf, Object::runtime, select_id_map, and selection_type.

Referenced by ArmatureBoneDrawStrategyBBone::draw_bone(), ArmatureBoneDrawStrategyCustomShape::draw_bone(), ArmatureBoneDrawStrategyOcta::draw_bone(), ArmatureBoneDrawStrategyWire::draw_bone(), drw_shgroup_bone_axes(), drw_shgroup_bone_envelope(), drw_shgroup_bone_sphere(), drw_shgroup_bone_stick(), blender::draw::overlay::Lattices::edit_object_sync(), blender::draw::overlay::Metaballs::edit_object_sync(), blender::draw::overlay::Bounds::object_sync(), blender::draw::overlay::Cameras::object_sync(), blender::draw::overlay::Empties::object_sync(), blender::draw::overlay::Fluids::object_sync(), blender::draw::overlay::ForceFields::object_sync(), blender::draw::overlay::Lattices::object_sync(), blender::draw::overlay::LightProbes::object_sync(), blender::draw::overlay::Lights::object_sync(), blender::draw::overlay::Metaballs::object_sync(), blender::draw::overlay::Particles::object_sync(), blender::draw::overlay::Prepass::object_sync(), blender::draw::overlay::Speakers::object_sync(), blender::draw::overlay::Wireframe::object_sync(), blender::draw::overlay::Prepass::particle_sync(), and blender::draw::overlay::Prepass::sculpt_sync().

◆ select_invalid_id()

Member Data Documentation

◆ disable_depth_test

bool blender::draw::select::SelectMap::disable_depth_test = false

Will remove the depth test state from any pass drawing objects with select id.

Definition at line 104 of file select_instance.hh.

Referenced by begin_sync(), select_bind(), select_bind(), and select_bind().

◆ dummy_select_buf

StorageArrayBuffer<uint, 4, true> blender::draw::select::SelectMap::dummy_select_buf = {"dummy_select_buf"}

Dummy buffer. Might be better to remove, but simplify the shader create info patching.

Definition at line 100 of file select_instance.hh.

Referenced by select_bind(), and select_bind().

◆ info_buf

UniformBuffer<SelectInfoData> blender::draw::select::SelectMap::info_buf

Uniform buffer to bind to all passes to pass information about the selection state.

Definition at line 102 of file select_instance.hh.

Referenced by begin_sync(), end_sync(), read_result(), select_bind(), select_bind(), and select_bind().

◆ map_names

Vector<std::string> blender::draw::select::SelectMap::map_names

Debug map containing a copy of the object name.

Definition at line 95 of file select_instance.hh.

Referenced by begin_sync(), and select_id().

◆ select_id_map

Vector<uint> blender::draw::select::SelectMap::select_id_map

Mapping between internal IDs and object->runtime->select_id.

Definition at line 92 of file select_instance.hh.

Referenced by begin_sync(), end_sync(), read_result(), and select_id().

◆ select_output_buf

StorageArrayBuffer<uint> blender::draw::select::SelectMap::select_output_buf = {"select_output_buf"}

Stores the result of the whole selection drawing. Content depends on selection mode.

Definition at line 98 of file select_instance.hh.

Referenced by end_sync(), read_result(), select_bind(), select_bind(), and select_bind().

◆ selection_type


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