GPv3: Copy & paste sets stroke hardness to zero if not initialized #120297

Open
opened 2024-04-05 13:18:25 +02:00 by Lukas Tönne · 1 comment
Member

Blender Version
Broken: 4.2
Worked: -

Short description of error
Copying the default stroke into a GPv3 object with existing strokes sets the pasted stroke hardness to zero.

Exact steps for others to reproduce the error

  1. Add a default "Stroke" grease pencil object. This has no hardness attribute, but uses the default of 1.0.
  2. Add an empty grease pencil object and draw some strokes in it. This writes a value of 1.0 to the hardness attribute.
  3. Copy & paste the stroke from the 1st into the 2nd object. The copied stroke is very thin, with a hardness of 0.0.

The reason is that 1.0 is the implicit default value for hardness, but the join_geometries method does not know this. When copying into the 2nd object it chooses a default value of 0.0 for the hardness attribute of the copied stroke.

Solution for now can be to check for known non-zero-default attributes like hardness before pasting, and then initialize the pasted stroke attributes explicitly.

image

**Blender Version** Broken: 4.2 Worked: - **Short description of error** Copying the default stroke into a GPv3 object with existing strokes sets the pasted stroke hardness to zero. **Exact steps for others to reproduce the error** 1. Add a default "Stroke" grease pencil object. This has no `hardness` attribute, but uses the default of 1.0. 2. Add an empty grease pencil object and draw some strokes in it. This writes a value of 1.0 to the hardness attribute. 3. Copy & paste the stroke from the 1st into the 2nd object. The copied stroke is very thin, with a hardness of 0.0. The reason is that 1.0 is the implicit default value for hardness, but the `join_geometries` method does not know this. When copying into the 2nd object it chooses a default value of 0.0 for the hardness attribute of the copied stroke. Solution for now can be to check for known non-zero-default attributes like hardness before pasting, and then initialize the pasted stroke attributes explicitly. ![image](/attachments/8d2d5043-12c6-4c37-aaf9-3b2d1856ed77)
230 KiB
Lukas Tönne added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-04-05 13:18:26 +02:00
Lukas Tönne added this to the Grease Pencil project 2024-04-05 13:18:28 +02:00
Member

Yes, can confirm.

Yes, can confirm.
Pratik Borhade added
Module
Grease Pencil
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-04-06 08:40:24 +02: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#120297
No description provided.