Fix: Broken mesh to curve conversion #105838

Merged
Hans Goudey merged 1 commits from bonj/blender:fix/convert-mesh-to-curve into main 2023-03-18 03:49:48 +01:00
Contributor

A recent refactor replaced the use of the totpoly local variable where it shouldn't have.

A recent refactor replaced the use of the `totpoly` local variable where it shouldn't have.
Jorijn de Graaf requested review from Campbell Barton 2023-03-16 20:00:20 +01:00
Brecht Van Lommel requested review from Hans Goudey 2023-03-16 21:04:31 +01:00
Hans Goudey requested changes 2023-03-18 02:16:50 +01:00
Hans Goudey left a comment
Member

Thanks for looking at this. Could you update the commit title and the description to mention what this changes at the user-level? It isn't obvious looking at the code.

I guess this was a mistake in one of my recent refactors that used polys.size() instead of totpoly in a place where it shouldn't have?

Thanks for looking at this. Could you update the commit title and the description to mention what this changes at the user-level? It isn't obvious looking at the code. I guess this was a mistake in one of my recent refactors that used `polys.size()` instead of `totpoly` in a place where it shouldn't have?
@ -533,3 +526,2 @@
endVert = edge->v2;
appendPolyLineVert(&polyline, edge->v2);
totpoly++;
appendPolyLineVert(&polyline, endVert);
Member

I understand this is a bit of a cleanup (endVert and edge->v1, might as well use endVert here, but best to leave that sort of cleanup separate from fixes and functional changes.

I understand this is a bit of a cleanup (`endVert` and `edge->v1`, might as well use `endVert` here, but best to leave that sort of cleanup separate from fixes and functional changes.
bonj marked this conversation as resolved
@ -583,3 +567,3 @@
nu = MEM_new<Nurb>("MeshNurb", blender::dna::shallow_zero_initialize());
nu->pntsu = polys.size();
nu->pntsu = BLI_listbase_count(&polyline);
Member

Using BLI_listbase_count will be slower than using totpoly probably, since it's O(n)

Using `BLI_listbase_count` will be slower than using `totpoly` probably, since it's `O(n)`
bonj marked this conversation as resolved
Jorijn de Graaf force-pushed fix/convert-mesh-to-curve from d19c7ef90f to 2decc49def 2023-03-18 03:02:47 +01:00 Compare
Author
Contributor

Thanks for looking at this. Could you update the commit title and the description to mention what this changes at the user-level? It isn't obvious looking at the code.

I'm terrible at this human stuff; what would you propose I change it to?

I guess this was a mistake in one of my recent refactors that used polys.size() instead of totpoly in a place where it shouldn't have?

Yeah that seems to be the case.

> Thanks for looking at this. Could you update the commit title and the description to mention what this changes at the user-level? It isn't obvious looking at the code. I'm terrible at this human stuff; what would you propose I change it to? > I guess this was a mistake in one of my recent refactors that used `polys.size()` instead of `totpoly` in a place where it shouldn't have? Yeah that seems to be the case.
Author
Contributor

@HooglyBoogly I removed the unnecessary changes, leaving only the change of polys.size() to totpoly.
I moved the cleanup stuff into PR #105870.

@HooglyBoogly I removed the unnecessary changes, leaving only the change of `polys.size()` to `totpoly`. I moved the cleanup stuff into PR #105870.
Jorijn de Graaf changed title from Fix: Convert mesh to curve to Fix: Broken mesh to curve conversion 2023-03-18 03:20:03 +01:00
Hans Goudey merged commit cf8640e7b5 into main 2023-03-18 03:49:48 +01:00
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#105838
No description provided.