Fix: all curves drawn cyclic if "cyclic" attribute exists #116638

Merged
Hans Goudey merged 2 commits from laurynas/blender:cyclic-in-curves-draw into main 2023-12-30 15:55:29 +01:00
Contributor

All curves are drawn cyclic despite "Cyclic" state in redo panel if at least one was created cyclic.
First part of if's condition leads to it:

  if (attributes.contains("cyclic") || bool(calc_flag & CURVE_FIT_CALC_CYCLIC)) {
    curves.cyclic_for_write()[curve_index] = true;
  }

Also patch adds support of "Cyclic" in redo panel for "Poly" curves. It is ignored in "old curve" draw tool.

All curves are drawn cyclic despite "Cyclic" state in redo panel if at least one was created cyclic. First part of if's condition leads to it: ```c if (attributes.contains("cyclic") || bool(calc_flag & CURVE_FIT_CALC_CYCLIC)) { curves.cyclic_for_write()[curve_index] = true; } ``` Also patch adds support of "Cyclic" in redo panel for "Poly" curves. It is ignored in "old curve" draw tool.
Laurynas Duburas added 1 commit 2023-12-29 21:30:56 +01:00
All curves are drawn cyclic despite "Cyclic" state in redo panel if at least one was created cyclic.
Also adds support of "Cyclic" in redo panel for "Poly" curves.
Laurynas Duburas requested review from Hans Goudey 2023-12-29 21:31:30 +01:00
Hans Goudey reviewed 2023-12-30 15:28:42 +01:00
Hans Goudey left a comment
Member

Thanks, makes sense! Just a couple tiny style comments.

Thanks, makes sense! Just a couple tiny style comments.
@ -648,6 +648,7 @@ static int curves_draw_exec(bContext *C, wmOperator *op)
const float error_threshold = RNA_float_get(op->ptr, "error_threshold");
const float corner_angle = RNA_float_get(op->ptr, "corner_angle");
const bool use_cyclic = RNA_boolean_get(op->ptr, "use_cyclic");
bool is_cyclic = (stroke_len > 2) && use_cyclic;
Member

bool -> const bool

`bool` -> `const bool`
Author
Contributor

It can change for Bezier. Look at your comment bellow and my code comment with a wrong style :)

It can change for Bezier. Look at your comment bellow and my code comment with a wrong style :)
Member

Oops, my bad, haha

Oops, my bad, haha
@ -725,6 +726,10 @@ static int curves_draw_exec(bContext *C, wmOperator *op)
if ((stroke_len > 2) && use_cyclic) {
calc_flag |= CURVE_FIT_CALC_CYCLIC;
}
// might happen after removing doubles
Member

Comment style. And it might be clearer inside of the else scope too

Comment style. And it might be clearer inside of the `else` scope too
laurynas marked this conversation as resolved
Laurynas Duburas added 1 commit 2023-12-30 15:52:59 +01:00
Hans Goudey approved these changes 2023-12-30 15:54:38 +01:00
Hans Goudey merged commit 6f5139cdca into main 2023-12-30 15:55:29 +01:00
Laurynas Duburas deleted branch cyclic-in-curves-draw 2023-12-30 20:22:11 +01:00
Sign in to join this conversation.
No reviewers
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#116638
No description provided.