|
Blender V5.0
|
#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) |
Displays armature objects. This includes Object, Edit and Pose mode.
Definition at line 33 of file overlay_armature.hh.
|
inline |
Definition at line 145 of file overlay_armature.hh.
|
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.
|
inline |
Definition at line 508 of file overlay_armature.hh.
References blender::draw::overlay::ARM_DRAW_MODE_OBJECT, ARM_DRAW_RELATION_FROM_HEAD, Object::base_flag, BASE_SELECTED, blender::draw::overlay::Armatures::DrawContext::bone_buf, blender::draw::overlay::Armatures::DrawContext::const_color, blender::draw::overlay::Armatures::DrawContext::const_wire, blender::draw::overlay::Armatures::DrawContext::do_relations, blender::draw::overlay::Armatures::DrawContext::draw_envelope_distance, blender::draw::overlay::Armatures::DrawContext::draw_mode, blender::draw::overlay::Armatures::DrawContext::draw_relation_from_head, bArmature::drawtype, blender::draw::overlay::Armatures::DrawContext::drawtype, DRW_object_get_data_for_drawing(), blender::draw::overlay::Armatures::DrawContext::dt, Object::dt, bArmature::flag, blender::draw::overlay::Armatures::DrawContext::is_filled, nullptr, blender::draw::overlay::Armatures::DrawContext::ob, blender::draw::overlay::Armatures::DrawContext::ob_ref, OB_SOLID, blender::draw::ObjectRef::object, blender::draw::overlay::Resources::object_wire_color(), blender::draw::overlay::Armatures::DrawContext::res, blender::draw::overlay::Armatures::DrawContext::show_relations, blender::draw::overlay::Armatures::DrawContext::show_text, and state.
Referenced by edit_object_sync(), and object_sync().
|
static |
Definition at line 1885 of file overlay_armature.cc.
References bArmature::act_edbone, ARM_DRAW_TYPE_ARMATURE_DEFINED, ARM_DRAWAXES, ARM_DRAWNAMES, blender::draw::overlay::Armatures::DrawContext::bone_buf, BONE_CONNECTED, bone_draw(), BONE_DRAW_ACTIVE, BONE_DRAW_LOCKED_WEIGHT, bone_draw_update_display_matrix(), blender::animrig::bone_is_visible(), blender::draw::overlay::Armatures::DrawContext::const_color, DEG_get_original(), draw_axes(), draw_bone_name(), draw_bone_relations(), bArmature::drawtype, EditBone::drawtype, DRW_object_get_data_for_drawing(), bArmature::edbo, edbo_compute_bbone_child(), ListBase::first, bArmature::flag, EditBone::flag, blender::draw::overlay::Resources::is_selection(), EditBone::next, blender::draw::overlay::Armatures::DrawContext::ob, EditBone::parent, blender::draw::overlay::Armatures::DrawContext::res, Object::runtime, set_ctx_bcolor(), and blender::draw::overlay::Armatures::DrawContext::show_text.
Referenced by edit_object_sync().
|
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().
|
inlinefinalvirtual |
Reimplemented from blender::draw::overlay::Overlay.
Definition at line 640 of file overlay_armature.hh.
References blender::draw::overlay::Overlay::enabled_, GPU_framebuffer_bind(), and view.
|
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().
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().
|
inlinestatic |
Definition at line 654 of file overlay_armature.hh.
References BKE_object_pose_armature_get(), Object::mode, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_POSE, and state.
Referenced by object_sync(), and blender::draw::overlay::MotionPath::object_sync().
|
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().