Armature drawing code refactor #106232
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106232
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "dr.sybren/blender:anim/armature-drawing-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refactor of the armature drawing code. This PR introduces a strategy pattern for the implementation of the various armature drawing modes. Instead of having to
switch (arm->drawtype)
everywhere, one function is used to select the appropriateArmatureBoneDrawStrategy
subclass.In the future this class could be expanded even further. Currently there are still places where there are explict checks for the draw type, making it cumbersome to add new types. For now I feel it's already a good enough move forward; future extensions can be done in later PRs.
#106230 introduces a new armature draw type, using this new strategy pattern. To be able to build it, it also contains the code from (an older version of) this PR.
Really liking the changes to the code. A lot clearer what's going on
I assume the Sphere drawing mode should also work in edit mode? Currently it draws the default bone
👍
That's for #106230, but no, for now sphere drawing mode won't work in edit mode. The problem is that for edit mode to work well, you need access to the bone tail, roll, etc.
A solution that was discussed is to draw the octo's in the spheres edit mode, as additional 'ghosts' next to the spheres. For this I feel more of the drawing code should be moved into the
ArmatureBoneDrawStrategy
classes, orArmatureDrawContext
could use some refactoring. Currently the drawing code is IMO still too linked to the drawing mode.9c91f236fa
tod93b3f7b78
d93b3f7b78
to3524e97955
I just force-pushed just the code refactor; the addition of sphere drawing mode will be left to another PR. That way this is just a non-functional refactor patch.
WIP: Armature drawing code refactorto Armature drawing code refactorlgtm. Just a function name that I think could be more descriptive
@ -96,0 +128,4 @@
const int select_id) const = 0;
/** Should the relationship line between this bone and its parent be drawn? */
virtual bool use_bone_relation_to_parent(const EditBone *ebone,
not sure about the function name. "use" is raising the question what it is used for.
The comment explains it but I think calling it e.g.
should_draw_relation_to_parent
would make it clear within the function name itself