Refactor: draw fcurve bezt function #108748

Merged
Christoph Lendenfeld merged 4 commits from ChrisLend/blender:graph_editor_draw_refactor into main 2023-06-15 18:20:22 +02:00

No functional changes

In preparation to tackle the following 2 Todos

  • TODO: view scale should factor into this someday too...
  • TODO: optimize this to not have to calc stuff out of view too?

I did the following cleanup

  • extracted drawing code for BEZT_IPO_BEZ into a separate function
  • extracted code that calculates the resolution between 2 points into a separate function
  • cleaned up comments
  • renamed variables to have a more telling name
  • moved variables closer to where they are used
  • added const where possible
No functional changes In preparation to tackle the following 2 Todos * TODO: view scale should factor into this someday too... * TODO: optimize this to not have to calc stuff out of view too? I did the following cleanup * extracted drawing code for `BEZT_IPO_BEZ` into a separate function * extracted code that calculates the resolution between 2 points into a separate function * cleaned up comments * renamed variables to have a more telling name * moved variables closer to where they are used * added `const` where possible
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-06-08 12:30:16 +02:00
Christoph Lendenfeld added 1 commit 2023-06-08 12:30:23 +02:00
Christoph Lendenfeld requested review from Sybren A. Stüvel 2023-06-08 12:31:15 +02:00
Christoph Lendenfeld added this to the Animation & Rigging project 2023-06-08 12:37:18 +02:00
Sybren A. Stüvel approved these changes 2023-06-15 17:58:52 +02:00
Sybren A. Stüvel left a comment
Member

I only had time to glance it over, but it looks good to me!

I only had time to glance it over, but it looks good to me!
@ -823,0 +835,4 @@
if (resolution > max_bez_resolution) {
resolution = max_bez_resolution;
}
return resolution;

This could return min_ii(resolution, max_bez_resolution), making it possible for resolution to be const.

This could `return min_ii(resolution, max_bez_resolution)`, making it possible for `resolution` to be `const`.
Christoph Lendenfeld added 3 commits 2023-06-15 18:11:19 +02:00
Christoph Lendenfeld merged commit c3a2de470d into main 2023-06-15 18:20:22 +02:00
Christoph Lendenfeld deleted branch graph_editor_draw_refactor 2023-06-15 18:20:23 +02:00
Sign in to join this conversation.
No reviewers
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 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#108748
No description provided.