GreasePencil Merge Planning #54721

Closed
opened 2018-04-19 11:19:22 +02:00 by Joshua Leung · 6 comments
Member

Meeting between Bastien, Campbell, Dalai, Joshua, William to review GP Branch and discuss what's needed to get it merged into 2.8.

Meeting Notes: 18/4/2018 GP Branch to 2.8 Merge Meeting Notes 20180418.pdf

GP Branch Mega-Patch: D2889

Meeting between Bastien, Campbell, Dalai, Joshua, William to review GP Branch and discuss what's needed to get it merged into 2.8. Meeting Notes: *18/4/2018* [GP Branch to 2.8 Merge Meeting Notes 20180418.pdf](https://archive.blender.org/developer/F2836205/GP_Branch_to_2.8_Merge_Meeting_Notes_20180418.pdf) GP Branch Mega-Patch: [D2889](https://archive.blender.org/developer/D2889)
Joshua Leung self-assigned this 2018-04-19 11:19:22 +02:00
Author
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung

Added subscriber: @antoniov

Added subscriber: @antoniov

As first step, I'm going to remove the palettecolor pointer from bGPDstroke struct.

As first step, I'm going to remove the palettecolor pointer from bGPDstroke struct.
Dalai Felinto changed title from GP Merge Meeting - 2018/4/18 to GreasePencil Merge Planning 2018-04-20 15:54:34 +02:00

I have removed from DNA any reference to PaletteColor pointer.

I have removed from DNA any reference to PaletteColor pointer.

About the concerns with modifiers (not VFX) there were several reasons that justify our past design decisions.

  1. The object modifier list is already developed and we can reuse all system to copy, enable, disable, link, etc. What is the reason to duplicate code to do the same? Are not modifiers for grease pencil strokes what we have today? From user point of view, what is different in grease pencil modifiers of 3D modifiers?

  2. Currently, there are 3D modifiers used only for some object types, for example we cannot add a particle modifier to curve. The filter to be able to use one modifier for one object type is defined in ModifierTypeType enum. For grease pencil we have added a new type eModifierTypeType_Gpencil, so we don't use any hack or special code for this, just enable this flag in modifier definition.

  3. To define the data that can be used in modifier, there is a definition in ModifierTypeFlag enum. Here again we have added a new flag type eModifierTypeFlag_GpencilMod, and again here no special code or hack.

  4. About reuse 3D modifiers for grease pencil, there is one big difference between 3D objects and grease pencil object. 3D objects use mesh data, grease pencil uses strokes.
    This is not a small difference. Usually, in a 3D object there is a group of points that create a shape. The number of points usually doesn't change, it's their position what change or animate.

On the other side, the stroke data changes by layer and frame, so the points of one stroke for frame 1 are not the same of frame 2, and maybe there are a different number of strokes. We never animate the points of a stroke, the artist creates a new stroke.

The solution used was to define a set of callbacks to the ModifierTypeInfo struct with the required functions for grease pencil. The main difference is that these callbacks receive strokes, not meshes, but the main idea is the same used for meshes, nothing different.

There are more differences with grease pencil modifiers; they can change the shape, the points or the color of the strokes. If we want change the color what would we use? A material modifier? This is not possible because a modifier at material level will override the material for all strokes, but maybe we want change only some strokes of same grease pencil layer.

As final main point against reuse the same modifiers for 3D and GP, the grease pencil objects can be filtered by grease pencil layer, and this is something that we haven't in 3D. We must remember here that grease pencil is a 2D environment in a 3D environment.

  1. Now the modifiers are using a custom copy on write system. When grease pencil was created the standard COW was not ready, so we decided create a custom one.

Every time the frame changes, or the drawing cache is dirty, a fresh copy of the current frame data is done and modifiers applied. Now the custom copy on write system only evaluates current frame and this reduce the overhead.

I'm not against using standard COW, but we would have to test the speed of the system. The grease pencil data can change a lot very fast while the user is drawing or doing edition, and execute a full COW of all data can be very slow (the data could be 10 GP layers, with 50 frames each , with 200 strokes each with an average of 50 points T = 10 * 50 * 200 * 50)

About the concerns with modifiers (not VFX) there were several reasons that justify our past design decisions. 1) The object modifier list is already developed and we can reuse all system to copy, enable, disable, link, etc. What is the reason to duplicate code to do the same? Are not modifiers for grease pencil strokes what we have today? From user point of view, what is different in grease pencil modifiers of 3D modifiers? 2) Currently, there are 3D modifiers used only for some object types, for example we cannot add a particle modifier to curve. The filter to be able to use one modifier for one object type is defined in *ModifierTypeType* enum. For grease pencil we have added a new type e*ModifierTypeType_Gpencil*, so we don't use any hack or special code for this, just enable this flag in modifier definition. 3) To define the data that can be used in modifier, there is a definition in *ModifierTypeFlag* enum. Here again we have added a new flag type *eModifierTypeFlag_GpencilMod*, and again here no special code or hack. 4) About reuse 3D modifiers for grease pencil, there is one big difference between 3D objects and grease pencil object. 3D objects use mesh data, grease pencil uses strokes. This is not a small difference. Usually, in a 3D object there is a group of points that create a shape. The number of points usually doesn't change, it's their position what change or animate. On the other side, the stroke data changes by layer and frame, so the points of one stroke for frame 1 are not the same of frame 2, and maybe there are a different number of strokes. We never animate the points of a stroke, the artist creates a new stroke. The solution used was to define a set of callbacks to the ModifierTypeInfo struct with the required functions for grease pencil. The main difference is that these callbacks receive strokes, not meshes, but the main idea is the same used for meshes, nothing different. There are more differences with grease pencil modifiers; they can change the shape, the points or the color of the strokes. If we want change the color what would we use? A material modifier? This is not possible because a modifier at material level will override the material for all strokes, but maybe we want change only some strokes of same grease pencil layer. As final main point against reuse the same modifiers for 3D and GP, the grease pencil objects can be filtered by grease pencil layer, and this is something that we haven't in 3D. We must remember here that grease pencil is a 2D environment in a 3D environment. 5) Now the modifiers are using a custom copy on write system. When grease pencil was created the standard COW was not ready, so we decided create a custom one. Every time the frame changes, or the drawing cache is dirty, a fresh copy of the current frame data is done and modifiers applied. Now the custom copy on write system only evaluates current frame and this reduce the overhead. I'm not against using standard COW, but we would have to test the speed of the system. The grease pencil data can change a lot very fast while the user is drawing or doing edition, and execute a full COW of all data can be very slow (the data could be 10 GP layers, with 50 frames each , with 200 strokes each with an average of 50 points T = 10 * 50 * 200 * 50)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
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#54721
No description provided.