Armature: Bone Draw Type: Wire #51365

Closed
opened 2017-05-01 09:21:08 +02:00 by Campbell Barton · 7 comments

Note: this also draws bendy-bone segments.

Note: this also draws bendy-bone segments.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Bastien Montagne self-assigned this 2017-05-02 09:12:08 +02:00

Added subscribers: @fclem, @dfelinto

Added subscribers: @fclem, @dfelinto

Ok, so getting basics working here is trivial thanks to neighbor code ;) , but am hitting a problem which is each bbone segment needs its own matrix and… we have nowhere to store those (since batch drawing only copies pointers of data, not data itself, we need them to remain valid at least for the whole draw call).

So far I can think of three solutions:

  • Ditch instantiation of basic primitive (a mere line in this case) for each segment, and generate a complete bone with all its segments at once (but then we cannot reuse those, we have to generate a new VertexBuffer for every bendy bone).
  • Store BBone matrices in bones (as we already store there the disp_mat).

Store BBone matrices in global g_data.

I would go for solution 3, but thought I’d ask first in case you have a better idea, @ideasman42, @dfelinto, @fclem ?

Ok, so getting basics working here is trivial thanks to neighbor code ;) , but am hitting a problem which is each bbone segment needs its own matrix and… we have nowhere to store those (since batch drawing only copies pointers of data, not data itself, we need them to remain valid at least for the whole draw call). So far I can think of three solutions: - Ditch instantiation of basic primitive (a mere line in this case) for each segment, and generate a complete bone with all its segments at once (but then we cannot reuse those, we have to generate a new VertexBuffer for every bendy bone). - Store BBone matrices in bones (as we already store there the `disp_mat`). # Store BBone matrices in global `g_data`. I would go for solution 3, but thought I’d ask first in case you have a better idea, @ideasman42, @dfelinto, @fclem ?

Correction, after quick testing, don't think we can use local static g_data here, works for drawing, but breaks selection (which I’d guess reuses same cached data but is drawn in complete separate call?)…

So new set of proposed solutions:

  • Ditch instantiation of basic primitive (a mere line in this case) for each segment, and generate a complete bone with all its segments at once (but then we cannot reuse those, we have to generate a new VertexBuffer for every bendy bone - and this would be true for BBone drawing itself too).
  • Store BBone matrices in bones (as we already store there the disp_mat).

Store BBone matrices in OBJECT_PrivateData… somehow?

Really dislike option 1, and I’d say option 2 is not acceptable (since it would be using data to store cache, we want to go away from doing that), so will dig around option 3 for now.

Correction, after quick testing, don't think we can use local static `g_data` here, works for drawing, but breaks selection (which I’d guess reuses same cached data but is drawn in complete separate call?)… So new set of proposed solutions: - Ditch instantiation of basic primitive (a mere line in this case) for each segment, and generate a complete bone with all its segments at once (but then we cannot reuse those, we have to generate a new VertexBuffer for every bendy bone - and this would be true for BBone drawing itself too). - Store BBone matrices in bones (as we already store there the disp_mat). # Store BBone matrices in `OBJECT_PrivateData`… somehow? Really dislike option 1, and I’d say option 2 is not acceptable (since it would be using data to store cache, we want to go away from doing that), so will dig around option 3 for now.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Done in d116932f3a.

(For the record, we decided to go with storage of the bbone segment matrices in allocated memory in bPoseChannel for now…).

Done in d116932f3a. (For the record, we decided to go with storage of the bbone segment matrices in allocated memory in bPoseChannel for now…).
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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#51365
No description provided.