GPencil obdata used by more than one object makes depgraph eval extremely slow (affects e.g. liboverrides) #95735

Closed
opened 2022-02-12 18:57:05 +01:00 by Nick Alberelli · 11 comments

System Information
Operating system: Linux-5.15.5-76051505-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.86

Tested Blender Versions
Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: dc2d180181
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-11 22:52, hash: 27d3140b13
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-02-11 22:58, hash: 35c261dfcf
Broken: version: 3.2.0 Alpha, branch: greasepencil-object, commit date: 2022-02-02 08:51, hash: c876bccb57

Short description of error
When using library override with a collection that contains a lattice and a grease pencil object there is a considerable frame rate slowdown.

Library Override Playback
local example.mp4

Expected Result
linked example.mp4

Long description of error
When rigging any grease pencil to a lattice and deforming the lattice in some way yields very good playback speeds. If a collection containing these elements (A grease pencil deformed by a lattice) the collection can be linked to no extra frame rate cost. But when using a library override there is a considerable change in frame rate.

Exact steps for others to reproduce the error from startup file

  1. Create a grease pencil object.
  2. Deform the object with a lattice modifier
  3. Open a new blend file and link the collection.
  4. Compare the linked frame rate to the frame rate when using library override.

Exact steps for others to reproduce the error from example .blend

  1. Open "heavy_test_file.blend" and note frame rate.
  2. Compare to "test file with library override.blend"
  3. Open a new blend file and link the collection.
  4. Compare the linked frame rate to the frame rate when using library override.

Example Blends: GP Library Override Lattice Issue.zip

**System Information** Operating system: Linux-5.15.5-76051505-generic-x86_64-with-glibc2.31 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.86 **Tested Blender Versions** Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: `dc2d180181` Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-11 22:52, hash: `27d3140b13` Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-02-11 22:58, hash: `35c261dfcf` Broken: version: 3.2.0 Alpha, branch: greasepencil-object, commit date: 2022-02-02 08:51, hash: `c876bccb57` **Short description of error** When using library override with a collection that contains a lattice and a grease pencil object there is a considerable frame rate slowdown. **Library Override Playback** [local example.mp4](https://archive.blender.org/developer/F12863960/local_example.mp4) **Expected Result** [linked example.mp4](https://archive.blender.org/developer/F12863961/linked_example.mp4) **Long description of error** When rigging any grease pencil to a lattice and deforming the lattice in some way yields very good playback speeds. If a collection containing these elements (A grease pencil deformed by a lattice) the collection can be linked to no extra frame rate cost. But when using a library override there is a considerable change in frame rate. **Exact steps for others to reproduce the error from startup file** 1. Create a grease pencil object. 2. Deform the object with a lattice modifier 3. Open a new blend file and link the collection. 4. Compare the linked frame rate to the frame rate when using library override. **Exact steps for others to reproduce the error from example .blend** 1. Open "heavy_test_file.blend" and note frame rate. 2. Compare to "test file with library override.blend" 3. Open a new blend file and link the collection. 4. Compare the linked frame rate to the frame rate when using library override. Example Blends: [GP Library Override Lattice Issue.zip](https://archive.blender.org/developer/F12863963/GP_Library_Override_Lattice_Issue.zip)
Author

Added subscriber: @TinyNick

Added subscriber: @TinyNick
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Thanks for the report. Can notice reasonable drop in fps with your provided file.
Reports on performance are usually not considered as bug reports (unless they are regression).

To improve performance, consider using less complex geometry, simpler shaders and smaller textures.```

I will let developers decide.

(2.83 is oldest version I checked and same problem I noticed there)
Thanks for the report. Can notice reasonable drop in fps with your provided file. Reports on performance are usually not considered as bug reports (unless they are regression). ```Thanks for the report. While we do continue to work on improving performance in general, potential performance improvements are not handled as bug reports. To improve performance, consider using less complex geometry, simpler shaders and smaller textures.``` I will let developers decide. (2.83 is oldest version I checked and same problem I noticed there)
Author

Thank you, just some additional context: lattices are often used when rigging grease pencil characters, smaller grease pencil objects dont seem to produce this error (needs testing). I only discovered this because the addition of a new more detailed character unexpectedly tanked my performance.

And this only happens with linking, one can copy and paste the character without a loss in framerate. Meaning this effectively breaks rigged gp characters from being linked across scenes.

Thank you, just some additional context: lattices are often used when rigging grease pencil characters, smaller grease pencil objects dont seem to produce this error (needs testing). I only discovered this because the addition of a new more detailed character unexpectedly tanked my performance. And this only happens with linking, one can copy and paste the character without a loss in framerate. Meaning this effectively breaks rigged gp characters from being linked across scenes.

Added subscriber: @mont29

Added subscriber: @mont29

I would let #dependency_graph team check on this first...

From a quick investigation, liboverrides are basically ten times slower to evaluate than either fully linked data, or fully local data:

Type of data/file BKE_object_handle_data_update on OBLattice BKE_object_eval_uber_data on OBGP_Pirate.002 Total eval time
Linked ~004ms ~004ms ~009ms
Linked, made local ~004ms ~004ms ~009ms
liboverride ~050ms ~050ms ~100ms

Further investigation: issue comes from the fact that the greasepencil obdata (Pirata.003) is used by two objects in liboverride case (it has two ID users, the linked object and its local override). Issue being, when evaluated GP ID has more than one user, it is fully duplicated, otherwise it is evaluated 'in place' (BKE_gpencil_prepare_eval_data)?

Copying a GP data takes a lot of time.

I think this is a depsgraph/GPencil issue really.


@TinyNick temporary workaround is to also make the GP obdata itself a liboverride (from the Outliner e.g.).

I would let #dependency_graph team check on this first... From a quick investigation, liboverrides are basically ten times slower to evaluate than either fully linked data, or fully local data: | Type of data/file | `BKE_object_handle_data_update` on `OBLattice` | `BKE_object_eval_uber_data` on `OBGP_Pirate.002` | Total eval time | | ---- | ---- | ---- | ---- | | Linked | ~004ms | ~004ms | ~009ms | | Linked, made local | ~004ms | ~004ms | ~009ms | | liboverride | ~050ms | ~050ms | ~100ms | ------------------------- Further investigation: issue comes from the fact that the greasepencil obdata (`Pirata.003`) is used by *two* objects in liboverride case (it has two ID users, the linked object and its local override). Issue being, when evaluated GP ID has more than one user, it is fully duplicated, otherwise it is evaluated 'in place' (`BKE_gpencil_prepare_eval_data`)? Copying a GP data takes *a lot* of time. I think this is a depsgraph/GPencil issue really. --------------------------- @TinyNick temporary workaround is to also make the GP obdata itself a liboverride (from the Outliner e.g.).
Bastien Montagne changed title from Library Overides: Low Framerate when using Grease Pencil + Lattice Modifier to GPencil obdata used by more than one object makes depgraph eval extremely slow (affects e.g. liboverrides) 2022-02-14 15:41:50 +01:00
Author

@mont29 Thank you, that does appear to work as a temporary workaround. I appreciate the tip it seems to have worked! The playback speed is reasonable using the workaround.

@mont29 Thank you, that does appear to work as a temporary workaround. I appreciate the tip it seems to have worked! The playback speed is reasonable using the workaround.

Added subscriber: @antoniov

Added subscriber: @antoniov

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Antonio Vazquez self-assigned this 2022-03-07 16:29:08 +01:00
Solved with https://developer.blender.org/D14238
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
4 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#95735
No description provided.