Blender V5.0
blender::draw::overlay::Armatures Class Reference

#include <overlay_armature.hh>

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

Classes

struct  DrawContext

Public Member Functions

 Armatures (const SelectionType selection_type)
void begin_sync (Resources &res, const State &state) final
DrawContext create_draw_context (const ObjectRef &ob_ref, Resources &res, const State &state, eArmatureDrawMode draw_mode)
void edit_object_sync (Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final
void object_sync (Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final
void end_sync (Resources &res, const State &) final
void draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final

Static Public Member Functions

static bool is_pose_mode (const Object *armature_ob, const State &state)
Main Draw Loops
static void draw_armature_pose (Armatures::DrawContext *ctx)
static void draw_armature_edit (Armatures::DrawContext *ctx)

Detailed Description

Displays armature objects. This includes Object, Edit and Pose mode.

Definition at line 33 of file overlay_armature.hh.

Constructor & Destructor Documentation

◆ Armatures()

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

Definition at line 145 of file overlay_armature.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Armatures::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 147 of file overlay_armature.hh.

References CTX_MODE_PAINT_WEIGHT, DRW_CLIPPING_UBO_SLOT, DRW_STATE_BLEND_ADD, DRW_STATE_BLEND_ALPHA, DRW_STATE_CULL_BACK, DRW_STATE_CULL_FRONT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, blender::draw::overlay::Overlay::enabled_, OB_WIRE, OVERLAY_GLOBALS_SLOT, state, U, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, V3D_HIDE_HELPLINES, V3D_SELECT_OUTLINE, and XRAY_FLAG_ENABLED.

◆ create_draw_context()

◆ draw_armature_edit()

◆ draw_armature_pose()

void Armatures::draw_armature_pose ( Armatures::DrawContext * ctx)
static

Definition at line 1956 of file overlay_armature.cc.

References bArmature::act_bone, blender::draw::overlay::ARM_DRAW_MODE_OBJECT, blender::draw::overlay::ARM_DRAW_MODE_POSE, ARM_DRAW_TYPE_ARMATURE_DEFINED, ARM_DRAWAXES, ARM_DRAWNAMES, ARM_NO_CUSTOM, Object::base_flag, BASE_FROM_DUPLI, BKE_object_defgroup_list(), BKE_pose_channel_find_name(), bPoseChannel::bone, blender::draw::overlay::Armatures::DrawContext::bone_buf, BONE_CONNECTED, bone_draw(), BONE_DRAW_ACTIVE, BONE_DRAW_LOCKED_WEIGHT, bone_draw_update_display_matrix(), BONE_IK_XLIMIT, BONE_IK_ZLIMIT, blender::animrig::bone_is_visible(), bPose::chanbase, blender::draw::overlay::Armatures::DrawContext::const_color, DEG_get_original(), DG_LOCK_WEIGHT, draw_axes(), draw_bone_degrees_of_freedom(), draw_bone_name(), draw_bone_relations(), blender::draw::overlay::Armatures::DrawContext::draw_mode, bArmature::drawtype, Bone::drawtype, DRW_context_get(), DRW_object_get_data_for_drawing(), ListBase::first, bArmature::flag, Bone::flag, bPose::flag, UnifiedBonePtr::flag(), blender::draw::overlay::is_from_dupli_or_set(), blender::draw::overlay::Resources::is_selection(), Object::mode, bPoseChannel::next, blender::draw::overlay::Armatures::DrawContext::ob, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_POSE, DRWContext::obact, ToolSettings::object_flag, DRWContext::object_mode, DRWContext::object_pose, pchan_draw_data_init(), Object::pose, POSE_RECALC, POSE_SELECTED, blender::draw::overlay::Armatures::DrawContext::res, Object::runtime, SCE_OBJECT_MODE_LOCK, DRWContext::scene, set_ctx_bcolor(), blender::draw::overlay::Armatures::DrawContext::show_relations, blender::draw::overlay::Armatures::DrawContext::show_text, and Scene::toolsettings.

Referenced by object_sync().

◆ draw_line()

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

◆ edit_object_sync()

void blender::draw::overlay::Armatures::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 543 of file overlay_armature.hh.

References blender::draw::overlay::ARM_DRAW_MODE_EDIT, create_draw_context(), draw_armature_edit(), blender::draw::overlay::Overlay::enabled_, and state.

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

◆ end_sync()

void blender::draw::overlay::Armatures::end_sync ( Resources & ,
const State &  )
inlinefinalvirtual

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 572 of file overlay_armature.hh.

References blender::draw::overlay::Overlay::enabled_, end_sync(), GPU_PRIM_LINES, and GPU_PRIM_TRIS.

Referenced by end_sync().

◆ is_pose_mode()

bool blender::draw::overlay::Armatures::is_pose_mode ( const Object * armature_ob,
const State & state )
inlinestatic

◆ object_sync()

void blender::draw::overlay::Armatures::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 556 of file overlay_armature.hh.

References blender::draw::overlay::ARM_DRAW_MODE_OBJECT, blender::draw::overlay::ARM_DRAW_MODE_POSE, create_draw_context(), draw_armature_pose(), blender::draw::overlay::Overlay::enabled_, is_pose_mode(), OB_BOUNDBOX, and state.

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


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