Can you help me please? How to draw octahedral shape from the parent head to child head for bones? #119530

Closed
opened 2024-03-15 17:57:49 +01:00 by Alexey Zakharchenko · 1 comment

Hello everyone. I have a question according to this function in file source\blender\draw\engines\overlay\overlay_armature.cc

/* Octahedral */
static void drw_shgroup_bone_octahedral(const ArmatureDrawContext *ctx,
const float (*bone_mat)[4],
const float bone_color[4],
const float hint_color[4],
const float outline_color[4])
{
BoneInstanceData inst_data;
mul_m4_m4m4(inst_data.mat, ctx->ob->object_to_world, bone_mat);
if (ctx->solid) {
OVERLAY_bone_instance_data_set_color(&inst_data, bone_color);
OVERLAY_bone_instance_data_set_color_hint(&inst_data, hint_color);
DRW_buffer_add_entry_struct(ctx->solid, &inst_data);
}
if (outline_color[3] > 0.0f) {
OVERLAY_bone_instance_data_set_color(&inst_data, outline_color);
DRW_buffer_add_entry_struct(ctx->outline, &inst_data);
}
}

Is there any way to transform this function to this one, but with octahedral shape display?

/* Stick */
static void drw_shgroup_bone_stick(const ArmatureDrawContext *ctx,
const float head[3],
const float tail[3],
const float col_wire[4],
const float col_bone[4],
const float col_head[4],
const float col_tail[4])
{
DRW_buffer_add_entry(ctx->stick, head, tail, col_wire, col_bone, col_head, col_tail);
}

Or this thing is hardcoded to Open GL octahedral shader and impossible to fix?
Why I am asking? I want to draw octahedral shape from the bone parent head to the child head. When Viewport Display > Relations Head is enabled. This can be very useful for FBX files display. Thank you very much in advance.

**Hello everyone. I have a question according to this function in file source\blender\draw\engines\overlay\overlay_armature.cc** _/* Octahedral */ static void drw_shgroup_bone_octahedral(const ArmatureDrawContext *ctx, const float (*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4]) { BoneInstanceData inst_data; mul_m4_m4m4(inst_data.mat, ctx->ob->object_to_world, bone_mat); if (ctx->solid) { OVERLAY_bone_instance_data_set_color(&inst_data, bone_color); OVERLAY_bone_instance_data_set_color_hint(&inst_data, hint_color); DRW_buffer_add_entry_struct(ctx->solid, &inst_data); } if (outline_color[3] > 0.0f) { OVERLAY_bone_instance_data_set_color(&inst_data, outline_color); DRW_buffer_add_entry_struct(ctx->outline, &inst_data); } }_ **Is there any way to transform this function to this one, but with octahedral shape display?** _/* Stick */ static void drw_shgroup_bone_stick(const ArmatureDrawContext *ctx, const float head[3], const float tail[3], const float col_wire[4], const float col_bone[4], const float col_head[4], const float col_tail[4]) { DRW_buffer_add_entry(ctx->stick, head, tail, col_wire, col_bone, col_head, col_tail); }_ Or this thing is hardcoded to Open GL octahedral shader and impossible to fix? Why I am asking? I want to draw octahedral shape from the bone parent head to the child head. When _Viewport Display > Relations Head_ is enabled. This can be very useful for FBX files display. Thank you very much in advance.
Alexey Zakharchenko added the
Type
To Do
label 2024-03-15 17:57:49 +01:00

Hi, you can ask this in https://blender.chat/channel/eevee-viewport-module
I'll close this issue since this place is for bug reports.

Hi, you can ask this in https://blender.chat/channel/eevee-viewport-module I'll close this issue since this place is for bug reports.
Blender Bot added the
Status
Archived
label 2024-03-15 18:03:59 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#119530
No description provided.