Blender V4.3
blender::draw::overlay Namespace Reference

Classes

class  AntiAliasing
class  Armatures
class  AttributeViewer
class  Background
class  Bounds
struct  CameraInstanceData
class  Cameras
class  Curves
class  EditText
class  Empties
class  Facing
class  Fade
class  Fluids
class  ForceFields
class  Framebuffer
class  GreasePencil
class  Grid
class  Images
class  Instance
class  Lattices
class  LightProbes
class  Lights
struct  LinePrimitiveBuf
class  Meshes
class  MeshUVs
class  Metaballs
class  ModeTransfer
class  MotionPath
class  Origins
class  Outline
class  Paints
class  Particles
struct  PointPrimitiveBuf
class  Prepass
class  Relations
struct  Resources
class  Sculpts
class  ShaderModule
class  ShapeCache
struct  ShapeInstanceBuf
class  Speakers
struct  State
class  StorageVectorBuffer
class  Texture
class  TextureFromPool
class  TextureRef
struct  Vertex
struct  VertexPrimitiveBuf
struct  VertexTriple
struct  VertShaded
class  Wireframe
class  XrayFade

Typedefs

using SelectionType = select::SelectionType

Enumerations

enum  eArmatureDrawMode { ARM_DRAW_MODE_OBJECT , ARM_DRAW_MODE_POSE , ARM_DRAW_MODE_EDIT }
enum  VertexClass {
  VCLASS_NONE = 0 , VCLASS_LIGHT_AREA_SHAPE = 1 << 0 , VCLASS_LIGHT_SPOT_SHAPE = 1 << 1 , VCLASS_LIGHT_SPOT_BLEND = 1 << 2 ,
  VCLASS_LIGHT_SPOT_CONE = 1 << 3 , VCLASS_LIGHT_DIST = 1 << 4 , VCLASS_CAMERA_FRAME = 1 << 5 , VCLASS_CAMERA_DIST = 1 << 6 ,
  VCLASS_CAMERA_VOLUME = 1 << 7 , VCLASS_SCREENSPACE = 1 << 8 , VCLASS_SCREENALIGNED = 1 << 9 , VCLASS_EMPTY_SCALED = 1 << 10 ,
  VCLASS_EMPTY_AXES = 1 << 11 , VCLASS_EMPTY_AXES_NAME = 1 << 12 , VCLASS_EMPTY_AXES_SHADOW = 1 << 13 , VCLASS_EMPTY_SIZE = 1 << 14
}

Functions

static float4x4 winmat_polygon_offset (float4x4 winmat, float view_dist, float offset)
static void shader_patch_common (gpu::shader::ShaderCreateInfo &info)
static void shader_patch_edit_mesh_normal_common (gpu::shader::ShaderCreateInfo &info)
static gpu::VertBufvbo_from_vector (const Vector< Vertex > &vector)
static gpu::VertBufvbo_from_vector (Vector< VertShaded > &vector)
static gpu::VertBufvbo_from_vector (Vector< VertexTriple > &vector)
static void append_line_loop (Vector< Vertex > &dest, Span< float2 > verts, float z, int flag, bool dashed=false)
static float light_distance_z_get (char axis, const bool start)
static Vector< float2ring_vertices (const float radius, const int segments, const bool half=false)
static Vector< Vertexsphere_axes_circles (const float radius, const VertexClass vclass, const int segments)
static void light_append_direction_line (const char axis, Span< float2 > diamond, Vector< Vertex > &verts)
static void light_append_direction_line (Vector< Vertex > &verts)
static VertShaded sphere_lat_lon_vert (const float2 &lat_pt, const float2 &lon_pt)
static void append_sphere (Vector< VertShaded > &dest, const eDRWLevelOfDetail level_of_detail)
static void add_values_to_text_cache (const GVArray &values, const Span< float3 > positions, const float4x4 &object_to_world)
static void add_attributes_to_text_cache (bke::AttributeAccessor attribute_accessor, const float4x4 &object_to_world)
static void add_instance_attributes_to_text_cache (bke::AttributeAccessor attribute_accessor, const float4x4 &object_to_world, int instance_index)

Variables

constexpr int overlay_edit_text
static constexpr int diamond_nsegments = 4
static constexpr int inner_nsegments = 8
static constexpr int outer_nsegments = 10
static constexpr int circle_nsegments = 32
static constexpr float bone_box_verts [8][3]
static constexpr std::array< uint, 24 > bone_box_wire_lines
static const std::array< uint3, 12 > bone_box_solid_tris
static const std::array< uint4, 12 > bone_box_wire_lines_adjacency
static const std::array< float3, 12 > bone_box_solid_normals
static const std::array< float3, 6 > bone_octahedral_verts
static const std::array< float3, 6 > bone_octahedral_smooth_normals
static const std::array< uint2, 12 > bone_octahedral_wire_lines
static const std::array< uint3, 8 > bone_octahedral_solid_tris
static const std::array< uint4, 12 > bone_octahedral_wire_lines_adjacency
static const float bone_octahedral_solid_normals [8][3]

Typedef Documentation

◆ SelectionType

Enumeration Type Documentation

◆ eArmatureDrawMode

Enumerator
ARM_DRAW_MODE_OBJECT 
ARM_DRAW_MODE_POSE 
ARM_DRAW_MODE_EDIT 

Definition at line 19 of file overlay_next_armature.hh.

◆ VertexClass

Enumerator
VCLASS_NONE 
VCLASS_LIGHT_AREA_SHAPE 
VCLASS_LIGHT_SPOT_SHAPE 
VCLASS_LIGHT_SPOT_BLEND 
VCLASS_LIGHT_SPOT_CONE 
VCLASS_LIGHT_DIST 
VCLASS_CAMERA_FRAME 
VCLASS_CAMERA_DIST 
VCLASS_CAMERA_VOLUME 
VCLASS_SCREENSPACE 
VCLASS_SCREENALIGNED 
VCLASS_EMPTY_SCALED 
VCLASS_EMPTY_AXES 
VCLASS_EMPTY_AXES_NAME 
VCLASS_EMPTY_AXES_SHADOW 
VCLASS_EMPTY_SIZE 

Definition at line 77 of file overlay_next_shape.cc.

Function Documentation

◆ add_attributes_to_text_cache()

void blender::draw::overlay::add_attributes_to_text_cache ( bke::AttributeAccessor attribute_accessor,
const float4x4 & object_to_world )
static

◆ add_instance_attributes_to_text_cache()

void blender::draw::overlay::add_instance_attributes_to_text_cache ( bke::AttributeAccessor attribute_accessor,
const float4x4 & object_to_world,
int instance_index )
static

◆ add_values_to_text_cache()

void blender::draw::overlay::add_values_to_text_cache ( const GVArray & values,
const Span< float3 > positions,
const float4x4 & object_to_world )
static

◆ append_line_loop()

void blender::draw::overlay::append_line_loop ( Vector< Vertex > & dest,
Span< float2 > verts,
float z,
int flag,
bool dashed = false )
static

◆ append_sphere()

◆ light_append_direction_line() [1/2]

void blender::draw::overlay::light_append_direction_line ( const char axis,
Span< float2 > diamond,
Vector< Vertex > & verts )
static

◆ light_append_direction_line() [2/2]

void blender::draw::overlay::light_append_direction_line ( Vector< Vertex > & verts)
static

◆ light_distance_z_get()

float blender::draw::overlay::light_distance_z_get ( char axis,
const bool start )
static

Definition at line 281 of file overlay_next_shape.cc.

Referenced by light_append_direction_line().

◆ ring_vertices()

Vector< float2 > blender::draw::overlay::ring_vertices ( const float radius,
const int segments,
const bool half = false )
static

◆ shader_patch_common()

◆ shader_patch_edit_mesh_normal_common()

◆ sphere_axes_circles()

Vector< Vertex > blender::draw::overlay::sphere_axes_circles ( const float radius,
const VertexClass vclass,
const int segments )
static

Definition at line 315 of file overlay_next_shape.cc.

References ring_vertices(), and verts.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ sphere_lat_lon_vert()

VertShaded blender::draw::overlay::sphere_lat_lon_vert ( const float2 & lat_pt,
const float2 & lon_pt )
static

Definition at line 359 of file overlay_next_shape.cc.

References VCLASS_EMPTY_SCALED, x, y, and z().

Referenced by append_sphere().

◆ vbo_from_vector() [1/3]

◆ vbo_from_vector() [2/3]

◆ vbo_from_vector() [3/3]

◆ winmat_polygon_offset()

Variable Documentation

◆ bone_box_solid_normals

const std::array<float3, 12> blender::draw::overlay::bone_box_solid_normals
static
Initial value:
= {
float3{0.0f, -1.0f, 0.0f},
{0.0f, -1.0f, 0.0f},
{1.0f, 0.0f, 0.0f},
{1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, -1.0f},
{0.0f, 0.0f, -1.0f},
{-1.0f, 0.0f, 0.0f},
{-1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 1.0f},
{0.0f, 0.0f, 1.0f},
{0.0f, 1.0f, 0.0f},
{0.0f, 1.0f, 0.0f},
}
VecBase< float, 3 > float3

Definition at line 160 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_box_solid_tris

const std::array<uint3, 12> blender::draw::overlay::bone_box_solid_tris
static
Initial value:
{
uint3{0, 2, 1},
{0, 3, 2},
{0, 1, 5},
{0, 5, 4},
{1, 2, 6},
{1, 6, 5},
{2, 3, 7},
{2, 7, 6},
{3, 0, 4},
{3, 4, 7},
{4, 5, 6},
{4, 6, 7},
}
VecBase< uint32_t, 3 > uint3

Definition at line 120 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_box_verts

float blender::draw::overlay::bone_box_verts[8][3]
staticconstexpr
Initial value:
= {
{1.0f, 0.0f, 1.0f},
{1.0f, 0.0f, -1.0f},
{-1.0f, 0.0f, -1.0f},
{-1.0f, 0.0f, 1.0f},
{1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, 1.0f},
}

Definition at line 105 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_box_wire_lines

std::array<uint, 24> blender::draw::overlay::bone_box_wire_lines
staticconstexpr
Initial value:
= {
0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
}

Definition at line 116 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_box_wire_lines_adjacency

const std::array<uint4, 12> blender::draw::overlay::bone_box_wire_lines_adjacency
static
Initial value:
= {
uint4{4, 2, 0, 11},
{0, 1, 2, 8},
{2, 4, 1, 14},
{1, 0, 4, 20},
{0, 8, 11, 14},
{2, 14, 8, 20},
{1, 20, 14, 11},
{4, 11, 20, 8},
{20, 0, 11, 2},
{11, 2, 8, 1},
{8, 1, 14, 4},
{14, 4, 20, 0},
}
VecBase< uint32_t, 4 > uint4

Store indices of generated verts from bone_box_solid_tris to define adjacency infos. See bone_octahedral_solid_tris for more infos.

Definition at line 144 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_octahedral_smooth_normals

const std::array<float3, 6> blender::draw::overlay::bone_octahedral_smooth_normals
static
Initial value:
{
float3{0.0f, -1.0f, 0.0f},
{0.0f, 1.0f, 0.0f},
}
#define M_SQRT1_2
draw_view in_light_buf[] float

NOTE: This is not the correct normals. The correct smooth normals for the equator vertices should be {+-0.943608f * M_SQRT1_2, -0.331048f, +-0.943608f * M_SQRT1_2} but it creates problems for outlines when bones are scaled.

Definition at line 195 of file overlay_next_shape.cc.

◆ bone_octahedral_solid_normals

const float blender::draw::overlay::bone_octahedral_solid_normals[8][3]
static
Initial value:
= {
{M_SQRT1_2, -M_SQRT1_2, 0.00000000f},
{-0.00000000f, -M_SQRT1_2, -M_SQRT1_2},
{-M_SQRT1_2, -M_SQRT1_2, 0.00000000f},
{0.00000000f, -M_SQRT1_2, M_SQRT1_2},
{0.99388373f, 0.11043154f, -0.00000000f},
{0.00000000f, 0.11043154f, -0.99388373f},
{-0.99388373f, 0.11043154f, 0.00000000f},
{0.00000000f, 0.11043154f, 0.99388373f},
}

Definition at line 258 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_octahedral_solid_tris

const std::array<uint3, 8> blender::draw::overlay::bone_octahedral_solid_tris
static
Initial value:
= {
uint3{2, 1, 0},
{3, 2, 0},
{4, 3, 0},
{1, 4, 0},
{5, 1, 2},
{5, 2, 3},
{5, 3, 4},
{5, 4, 1},
}

Definition at line 219 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_octahedral_verts

const std::array<float3, 6> blender::draw::overlay::bone_octahedral_verts
static
Initial value:
{
float3{0.0f, 0.0f, 0.0f},
{0.1f, 0.1f, 0.1f},
{0.1f, 0.1f, -0.1f},
{-0.1f, 0.1f, -0.1f},
{-0.1f, 0.1f, 0.1f},
{0.0f, 1.0f, 0.0f},
}

Definition at line 180 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_octahedral_wire_lines

const std::array<uint2, 12> blender::draw::overlay::bone_octahedral_wire_lines
static
Initial value:
= {
uint2{0, 1},
{1, 5},
{5, 3},
{3, 0},
{0, 4},
{4, 5},
{5, 2},
{2, 0},
{1, 2},
{2, 3},
{3, 4},
{4, 1},
}
VecBase< uint32_t, 2 > uint2

Definition at line 204 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ bone_octahedral_wire_lines_adjacency

const std::array<uint4, 12> blender::draw::overlay::bone_octahedral_wire_lines_adjacency
static
Initial value:
= {
uint4{0, 1, 2, 6},
{0, 12, 1, 6},
{0, 3, 12, 6},
{0, 2, 3, 6},
{1, 6, 2, 3},
{1, 12, 6, 3},
{1, 0, 12, 3},
{1, 2, 0, 3},
{2, 0, 1, 12},
{2, 3, 0, 12},
{2, 6, 3, 12},
{2, 1, 6, 12},
}

Store indices of generated verts from bone_octahedral_solid_tris to define adjacency infos. Example: triangle {2, 1, 0} is adjacent to {3, 2, 0}, {1, 4, 0} and {5, 1, 2}. {2, 1, 0} becomes {0, 1, 2} {3, 2, 0} becomes {3, 4, 5} {1, 4, 0} becomes {9, 10, 11} {5, 1, 2} becomes {12, 13, 14} According to opengl specification it becomes (starting from the first vertex of the first face aka. vertex 2): {0, 12, 1, 10, 2, 3}

Definition at line 242 of file overlay_next_shape.cc.

Referenced by blender::draw::overlay::ShapeCache::ShapeCache().

◆ circle_nsegments

int blender::draw::overlay::circle_nsegments = 32
staticconstexpr

◆ diamond_nsegments

int blender::draw::overlay::diamond_nsegments = 4
staticconstexpr

◆ inner_nsegments

int blender::draw::overlay::inner_nsegments = 8
staticconstexpr

◆ outer_nsegments

int blender::draw::overlay::outer_nsegments = 10
staticconstexpr

◆ overlay_edit_text

int blender::draw::overlay::overlay_edit_text
constexpr