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

Classes

class  AntiAliasing
 
class  Armatures
 
class  AttributeTexts
 
class  AttributeViewer
 
class  Axes
 
class  Background
 
struct  BoneInstanceData
 
class  Bounds
 
struct  CameraInstanceData
 
class  Cameras
 
class  Cursor
 
class  Curves
 
class  Empties
 
struct  Engine
 
class  Facing
 
class  Fade
 
struct  FlatObjectRef
 
class  Fluids
 
class  ForceFields
 
class  GreasePencil
 
struct  GreasePencilDepthPlane
 
class  Grid
 
class  ImagePrepass
 
class  Images
 
class  Instance
 
class  Lattices
 
class  LightProbes
 
class  Lights
 
struct  LinePrimitiveBuf
 
class  Meshes
 
class  MeshUVs
 
class  Metaballs
 
class  ModeTransfer
 
class  MotionPath
 
class  Names
 
class  Origins
 
class  Outline
 
struct  Overlay
 
class  Paints
 
class  Particles
 
class  PointClouds
 
struct  PointPrimitiveBuf
 
class  Prepass
 
class  Relations
 
struct  Resources
 
class  Sculpts
 
class  ShaderModule
 
class  ShapeCache
 
struct  ShapeInstanceBuf
 
class  Speakers
 
struct  State
 
class  Text
 
struct  Vertex
 
struct  VertexBone
 
struct  VertexPrimitiveBuf
 
struct  VertexTriple
 
struct  VertexWithColor
 
struct  VertShaded
 
class  Wireframe
 
class  XrayFade
 

Typedefs

using SelectionType = select::SelectionType
 
using StaticShader = gpu::StaticShader
 

Enumerations

enum  eArmatureDrawMode { ARM_DRAW_MODE_OBJECT , ARM_DRAW_MODE_POSE , ARM_DRAW_MODE_EDIT }
 

Functions

static bool is_from_dupli_or_set (const Object *ob)
 
static bool is_from_dupli_or_set (const ObjectRef &ob_ref)
 
static void append_line_loop (Vector< Vertex > &dest, Span< float2 > verts, float z, VertexClass 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)
 

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

◆ StaticShader

Enumeration Type Documentation

◆ eArmatureDrawMode

Enumerator
ARM_DRAW_MODE_OBJECT 
ARM_DRAW_MODE_POSE 
ARM_DRAW_MODE_EDIT 

Definition at line 23 of file overlay_armature.hh.

Function Documentation

◆ append_line_loop()

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

◆ append_sphere()

◆ is_from_dupli_or_set() [1/2]

◆ is_from_dupli_or_set() [2/2]

static bool blender::draw::overlay::is_from_dupli_or_set ( const ObjectRef & ob_ref)
inlinestatic

◆ light_append_direction_line() [1/2]

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

◆ light_append_direction_line() [2/2]

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

◆ light_distance_z_get()

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

Definition at line 198 of file overlay_shape.cc.

Referenced by light_append_direction_line().

◆ ring_vertices()

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

◆ sphere_axes_circles()

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

◆ sphere_lat_lon_vert()

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

Definition at line 276 of file overlay_shape.cc.

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

Referenced by append_sphere().

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},
}

Definition at line 76 of file overlay_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},
}

Definition at line 36 of file overlay_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 21 of file overlay_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 32 of file overlay_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},
}

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

Definition at line 60 of file overlay_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},
{float(M_SQRT1_2), 0.0f, float(M_SQRT1_2)},
{float(M_SQRT1_2), 0.0f, -float(M_SQRT1_2)},
{-float(M_SQRT1_2), 0.0f, -float(M_SQRT1_2)},
{-float(M_SQRT1_2), 0.0f, float(M_SQRT1_2)},
{0.0f, 1.0f, 0.0f},
}
#define M_SQRT1_2

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 111 of file overlay_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 175 of file overlay_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 135 of file overlay_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 96 of file overlay_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},
}

Definition at line 120 of file overlay_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 information. 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 159 of file overlay_shape.cc.

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

◆ circle_nsegments

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

Definition at line 19 of file overlay_shape.cc.

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

◆ diamond_nsegments

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

◆ inner_nsegments

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

Definition at line 17 of file overlay_shape.cc.

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

◆ outer_nsegments

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

Definition at line 18 of file overlay_shape.cc.

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

◆ overlay_edit_text

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