Grease pencil can't be instanciated using collection instance #72481

Closed
opened 2019-12-16 19:18:21 +01:00 by Yannick Castaing · 9 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42
Worked: (optional)

Short description of error
When we are making more than one link of a same collection, from another scene, if this collection contains one grease pencil, this one can't be dupplicated, unlike other stuff (like geometry, or whatever).
(Maybe it's due to the fact that grease pencil is animated, but if animation playback is disabled, it shouldn't be a problem).

Exact steps for others to reproduce the error

  • create a scene
  • create a grease pencil monkey inside the default collection, which we can rename "plouf"
  • create a new scene
  • add the collection "plouf" as a collection instance
  • dupplicate or add again the collection "plouf"

the grease pencil is disappearing from the first instance of plouf, and goes to the second instance of plouf, whereas they are the the same

CollectionLinked.blend
image.png

**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: `26bd5ebd42` Worked: (optional) **Short description of error** When we are making more than one link of a same collection, from another scene, if this collection contains one grease pencil, this one can't be dupplicated, unlike other stuff (like geometry, or whatever). (Maybe it's due to the fact that grease pencil is animated, but if animation playback is disabled, it shouldn't be a problem). **Exact steps for others to reproduce the error** - create a scene - create a grease pencil monkey inside the default collection, which we can rename "plouf" - create a new scene - add the collection "plouf" as a collection instance - dupplicate or add again the collection "plouf" the grease pencil is disappearing from the first instance of plouf, and goes to the second instance of plouf, whereas they are the the same [CollectionLinked.blend](https://archive.blender.org/developer/F8226699/CollectionLinked.blend) ![image.png](https://archive.blender.org/developer/F8226710/image.png)

Added subscriber: @BoUBoU

Added subscriber: @BoUBoU

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Similar to #63563, but in this case the stroke is visible.

Similar to #63563, but in this case the stroke is visible.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

When I try to open this file I get a stack-use-after-scope error when accessing ob->... in GPENCIL_draw_scene.

I found that the issue is that the pointer to ob is stored in a cache in GPENCIL_cache_populate. However, in this case, ob points to an object that lives on the stack in DEGObjectIterData.temp_dupli_object created by DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN in DRW_draw_render_loop_ex.

This seems to be a deeper issue in the way grease pencil object duplis are drawn, but I don't understand the full context here...

@fclem, Should GPENCIL_cache_populate be allowed to store pointers to objects passed into it?

When I try to open this file I get a `stack-use-after-scope` error when accessing `ob->...` in `GPENCIL_draw_scene`. I found that the issue is that the pointer to `ob` is stored in a cache in `GPENCIL_cache_populate`. However, in this case, `ob` points to an object that lives on the stack in `DEGObjectIterData.temp_dupli_object` created by `DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN` in `DRW_draw_render_loop_ex`. This seems to be a deeper issue in the way grease pencil object duplis are drawn, but I don't understand the full context here... @fclem, Should `GPENCIL_cache_populate` be allowed to store pointers to objects passed into it?
Member

Added subscriber: @fclem

Added subscriber: @fclem

Added subscriber: @antoniov

Added subscriber: @antoniov

@JacquesLucke In the refactor of the gpencil engine we have changed totally how this works, so don't think this will be a problem in the future.

@JacquesLucke In the refactor of the gpencil engine we have changed totally how this works, so don't think this will be a problem in the future.

Closed as duplicate of #66293

Closed as duplicate of #66293
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
5 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#72481
No description provided.