Fix #114060: GPv3: Transform crash with multiple object editing #114088

Merged
Hans Goudey merged 2 commits from casey-bianco-davis/blender:GPv3-fix-transform-array-error into main 2023-10-30 08:15:02 +01:00

The problem was that the array of IndexMasks was set to the number of objects selected and not the number of curves in all selected objects.

This fixes the transform code from relying on undefined behavior.

The problem was that the array of `IndexMask`s was set to the number of objects selected and not the number of curves in all selected objects. This fixes the transform code from relying on undefined behavior.
casey-bianco-davis added 1 commit 2023-10-24 06:04:01 +02:00
c08ca09fd5 Fix #114060: GPv3: Avoid crashes for multiple curve grease pencil objects
The problem was that the array of `IndexMask`s was set to the number of objects selected and not the number of curves in all selected objects.
casey-bianco-davis requested review from Falk David 2023-10-24 06:05:38 +02:00
Author
Member

This currently just removes saving the selected points and instead calls retrieve_selected_points twice.
But it could instead be implemented with Vector and appending the selected points IndexMask in to it.
Or could first loop thru the editable curves counting them and create an Array (but this would have 3 total loops thru all layers).
What do you think? @filedescriptor

This currently just removes saving the selected points and instead calls `retrieve_selected_points` twice. But it could instead be implemented with `Vector` and appending the selected points `IndexMask` in to it. Or could first loop thru the editable curves counting them and create an `Array` (but this would have 3 total loops thru all layers). What do you think? @filedescriptor
Hans Goudey requested changes 2023-10-24 10:34:57 +02:00
Hans Goudey left a comment
Member

We shouldn't generate the IndexMask twice here. Better to use a Vector or Map or something like that if the size is not known in advance.

EDIT: Sorry, didn't see the comment above. Either looping a third time or using a Vector makes sense to me.

We shouldn't generate the `IndexMask` twice here. Better to use a `Vector` or `Map` or something like that if the size is not known in advance. EDIT: Sorry, didn't see the comment above. Either looping a third time or using a `Vector` makes sense to me.
casey-bianco-davis added 1 commit 2023-10-25 03:10:03 +02:00
ccff39a7dc GPv3: use `Array` for saving selected points
Note: This does mean that the code loops thru the grease pencil objects and all it's layers 3 times.
Falk David approved these changes 2023-10-25 10:28:17 +02:00
Hans Goudey approved these changes 2023-10-25 14:01:24 +02:00
@ -31,2 +29,4 @@
const bool use_proportional_edit = (t->flag & T_PROP_EDIT_ALL) != 0;
const bool use_connected_only = (t->flag & T_PROP_CONNECTED) != 0;
int number_of_layers_total = 0;
Member

Seems simpler to gather a Vector<Drawing *> here, and simplify the iteration in the other two steps. But the patch is fine to go in either way I think.

Seems simpler to gather a `Vector<Drawing *>` here, and simplify the iteration in the other two steps. But the patch is fine to go in either way I think.
Hans Goudey changed title from Fix #114060: GPv3: Avoid crashes for multiple curve grease pencil objects to Fix #114060: GPv3: Transform crash with multiple object editing 2023-10-30 08:14:29 +01:00
Hans Goudey merged commit dddd1d224d into main 2023-10-30 08:15:02 +01:00
casey-bianco-davis deleted branch GPv3-fix-transform-array-error 2023-10-31 00:05:47 +01: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 project
No Assignees
3 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#114088
No description provided.