GPencil: natural drawing building with 1 subdivision make animation slower too much that must be #104824

Closed
opened 2023-02-16 16:31:46 +01:00 by hamza.SMA · 11 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.94

Blender Version
Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-02-15 23:48, hash: 4cb119f5339f
Worked: (newest version of Blender that worked as expected)

Short description of error
hi, when i use the new feature natural drawing speed in build modifier, it work well but if i add subdivide modifier before it takes too long time (around x30 times some times x100) even with 1 subdivition.i add subdivide to ad smouth modifier and have nice controle
here the video,

#grease_pencil

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.94 **Blender Version** Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-02-15 23:48, hash: `4cb119f5339f` Worked: (newest version of Blender that worked as expected) **Short description of error** hi, when i use the new feature natural drawing speed in build modifier, it work well but if i add subdivide modifier before it takes too long time (around x30 times some times x100) even with 1 subdivition.i add subdivide to ad smouth modifier and have nice controle here the video, #grease_pencil
hamza.SMA added the
Severity
Normal
Status
Needs Triage
Type
Report
labels 2023-02-16 16:31:46 +01:00
Antonio Vazquez added
Status
Confirmed
Module
Grease Pencil
and removed
Status
Needs Triage
labels 2023-02-16 17:13:55 +01:00

@marcchehab Could you take a look. It looks you are not using the right number of points. Maybe you are using original stroke size and not the evaluated or maybe you are not calculating the time for the new created points.

@marcchehab Could you take a look. It looks you are not using the right number of points. Maybe you are using original stroke size and not the evaluated or maybe you are not calculating the time for the new created points.
Contributor

Hi guys, sorry for the delay. I looked at it today but I'm fighting with my debugger currently. I'll have to continue tomorrow.

Hi guys, sorry for the delay. I looked at it today but I'm fighting with my debugger currently. I'll have to continue tomorrow.
Contributor

Short Update: The problem is that subdiv-modifier doesn't sanitize missing time values that points have (they show as 0). It just takes averages of neighbours, which if one neighbour is missing (0) creates huge deltas in time between points that are added up in the build modifier.

There are two solutions:

  1. Refactor my time sanitization routine and make sub-div modifier call it also. Advantage: Clean solution. Disadvantage: Slows down subdiv-modifier for a feature that isn't even used most of the time. And a lot of work for little added value.

  2. My preference: Make subdiv-modifier fill in 0 for time, making it - if anything - faster. Currently the build modifier is the only area where this data is needed and it has a sanitization routine.

In the future with GP 3.0 the sanitization could be run after strokes are drawn and saved into the stroke data from the start.

@antoniov Can I go with 2 ?

Short Update: The problem is that subdiv-modifier doesn't sanitize missing time values that points have (they show as 0). It just takes averages of neighbours, which if one neighbour is missing (0) creates huge deltas in time between points that are added up in the build modifier. There are two solutions: 1. Refactor my time sanitization routine and make sub-div modifier call it also. Advantage: Clean solution. Disadvantage: Slows down subdiv-modifier for a feature that isn't even used most of the time. And a lot of work for little added value. 2. My preference: Make subdiv-modifier fill in 0 for time, making it - if anything - faster. Currently the build modifier is the only area where this data is needed and it has a sanitization routine. In the future with GP 3.0 the sanitization could be run after strokes are drawn and saved into the stroke data from the start. @antoniov Can I go with 2 ?

Agree with 2) The option 1) is not a good idea.

Agree with 2) The option 1) is not a good idea.
Contributor

Here's a patch (I used master branch, but should work, right?)

  1. I changed the subdivision function to not fill in time but add 0
  2. I fixed a bug in my sanitization function that I noticed while researching this

@hamza-el-barmaki could you test this patch?

Here's a patch (I used master branch, but should work, right?) 1. I changed the subdivision function to not fill in time but add 0 2. I fixed a bug in my sanitization function that I noticed while researching this @hamza-el-barmaki could you test this patch?

@marcchehab Could you create a Pull Request? You don't need commit rights to create the PR.

Here you can find how to do it: https://wiki.blender.org/wiki/Tools/Pull_Requests

@marcchehab Could you create a Pull Request? You don't need commit rights to create the PR. Here you can find how to do it: https://wiki.blender.org/wiki/Tools/Pull_Requests
Contributor

Sure. Great this is now all in git 😊👌
8a4ead69a6

Sure. Great this is now all in git 😊👌 https://projects.blender.org/marcchehab/blender/commit/8a4ead69a65f11baba3ab1fff3e45d0347ccebf4
Contributor

Hmmm I somehow have another user in the pull request. Is that a problem?

Hmmm I somehow have another user in the pull request. Is that a problem?

@marcchehab I guess you need now create the Pull Request using yourbranch <=> blender35 branches. Actually you have the commit in your froked branch, but you miss last step.

@marcchehab I guess you need now create the Pull Request using yourbranch <=> blender35 branches. Actually you have the commit in your froked branch, but you miss last step.
Author

@marcchehab @antoniov hi,sorry i never does a compilation, no expirience there, one thing to mention i tried to use simplify with sample mode and i found that the animation go quickly not naturaly if we put this modiifer first then Build modifier (for other modes no worries), so when there is a new generated points we'll have unexpected quick animation. thank you and sorry.

@marcchehab @antoniov hi,sorry i never does a compilation, no expirience there, one thing to mention i tried to use simplify with sample mode and i found that the animation go quickly not naturaly if we put this modiifer first then Build modifier (for other modes no worries), so when there is a new generated points we'll have unexpected quick animation. thank you and sorry.
Contributor

Thanks a lot for your kind guidance, @antoniov ! Here is the pull request: #105306

Thanks a lot for your kind guidance, @antoniov ! Here is the pull request: https://projects.blender.org/blender/blender/pulls/105306
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-03-01 10:10:24 +01:00
Sign in to join this conversation.
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
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#104824
No description provided.