GP 3.0: More conversions of the legacy grease pencil data. #106822

Closed
opened 2023-04-11 18:55:19 +02:00 by Falk David · 4 comments
Member

Currently, the following data between the old and new data-block is converted:

Point attributes:

  • position (or x,y, and z)
  • radius (or pressure, currently is saved pre-multiplied by the stroke thickness)
  • opacity (or strength)
  • selection (from the flag > GP_SPOINT_SELECT)

Stroke (curve) attributes:

  • cyclic (from the flag > GP_STROKE_CYCLIC)
  • material_index (or mat_nr)

Frame data:

  • frame_number (previously framenum)

There is more data that needs to be converted:

Point attributes:

  • time: seconds since start of drawing the stroke (should maybe be saved as delta between points?)
  • uv_rot: rotation of this point (for dot material mode)
  • vert_color: vertex color

(Note: uv_fac, and uv_fill can be calculated at runtime)

Stroke attributes:

  • thickness: thickness of the stroke
  • inittime: creation time of the stroke
  • caps: end caps flags (should probably be two boolean attributes for front and back)
  • hardness: controls the gradient falloff from the center line to the outer edge of the stroke
  • aspect_ratio[2]: x-y factor for dot shapes (why is this not a single factor?)
  • fill_opacity_fac: Opacisty factor for fills
  • uv_rotation, uv_translation, uv_scale : For fills
  • vert_color_fill: Fill "vertex" color.

(Note: There are a lot of fields in the stroke that is actually runtime data. Like triangles, boundbox, select_index)

Frame data (to be stored in the layer map):

  • selection: frame selection
  • key_type: keyframe type shown in the UI

Layer data:

  • hide, locked, select, use_lights
  • active: This layer is active (should be stored as an index and a reference at runtime)
  • parent, parsubstr: the parent object (could be a bone by name)
  • line_change: Thickness adjustment
  • tintcolor
  • opacity
  • viewlayername: Name of the layer used to filter render output.
  • blend_mode
  • gstep, gstep_next, gcolor_prev, gcolor_next: Onion skinning data Only used by annotations.
  • mask_layers: list of mask layers (how to convert this?)
  • location, rotation, scale: layer transforms

bGPdata:

  • pixfactor (should probably be baked into the radius on the points and be replaced by using a thickness modifier)
  • vertex_group_names, vertex_group_active_index Needs to be moved to CurvesGeometry.
  • onion_factor, onion_mode, onion_flag, onion_keytype
  • grid (Should become a overlay setting. Idea: Use the object viewport display color for the grid color. Scale the grid to the bounding box of the object to make sure it is covered.)
Currently, the following data between the old and new data-block is converted: Point attributes: * `position` (or `x`,`y`, and `z`) * `radius` (or `pressure`, currently is saved pre-multiplied by the stroke thickness) * `opacity` (or `strength`) * `selection` (from the `flag` > `GP_SPOINT_SELECT`) Stroke (curve) attributes: * `cyclic` (from the `flag` > `GP_STROKE_CYCLIC`) * `material_index` (or `mat_nr`) Frame data: * `frame_number` (previously `framenum`) There is more data that needs to be converted: **Point attributes**: - [x] `time`: seconds since start of drawing the stroke (should maybe be saved as delta between points?) - [x] `uv_rot`: rotation of this point (for dot material mode) - [x] `vert_color`: vertex color (Note: `uv_fac`, and `uv_fill` can be calculated at runtime) **Stroke attributes**: - [x] ~~`thickness`: thickness of the stroke~~ - [x] `inittime`: creation time of the stroke - [x] `caps`: end caps flags (should probably be two boolean attributes for front and back) - [x] `hardness`: controls the gradient falloff from the center line to the outer edge of the stroke - [x] `aspect_ratio[2]`: x-y factor for dot shapes (why is this not a single factor?) - [x] ~~`fill_opacity_fac`: Opacisty factor for fills~~ - [x] `uv_rotation`, `uv_translation`, `uv_scale` : For fills - [x] `vert_color_fill`: Fill "vertex" color. (Note: There are a lot of fields in the stroke that is actually runtime data. Like `triangles`, `boundbox`, `select_index`) **Frame data** (to be stored in the layer map): - [x] `selection`: frame selection - [x] `key_type`: keyframe type shown in the UI **Layer data**: - [x] `hide`, `locked`, `select`, `use_lights` - [x] `active`: This layer is active (should be stored as an index and a reference at runtime) - [x] `parent`, `parsubstr`: the parent object (could be a bone by name) - [x] `line_change`: Thickness adjustment - [x] `tintcolor` - [x] `opacity` - [x] `viewlayername`: Name of the layer used to filter render output. - [x] `blend_mode` - [x] ~~`gstep`, `gstep_next`, `gcolor_prev`, `gcolor_next`: Onion skinning data~~ Only used by annotations. - [x] `mask_layers`: list of mask layers (how to convert this?) - [x] `location`, `rotation`, `scale`: layer transforms **bGPdata**: - [x] ~~`pixfactor`~~ (should probably be baked into the `radius` on the points and be replaced by using a thickness modifier) - [x] ~~`vertex_group_names`, `vertex_group_active_index`~~ Needs to be moved to `CurvesGeometry`. - [x] `onion_factor`, `onion_mode`, `onion_flag`, `onion_keytype` - [x] ~~`grid`~~ (Should become a overlay setting. Idea: Use the object viewport display color for the grid color. Scale the grid to the bounding box of the object to make sure it is covered.)
Falk David added the
Type
To Do
label 2023-04-11 18:55:19 +02:00
Falk David added this to the (deleted) project 2023-04-11 18:55:21 +02:00

aspect_ratio could be a single float
vertex_paint_opacity is always 1.0 because is was replaced by overlay value, so it can be removed. This prop is not visible in the UI.

About layer active.... do we want save this as today? if we put in runtime this setting will not be saved.

Onion Skinning parameters would be moved to a separated "sub" struct to keep things organized... now it's not easy to know what is for onion and what not.

`aspect_ratio` could be a single float `vertex_paint_opacity` is always 1.0 because is was replaced by overlay value, so it can be removed. This prop is not visible in the UI. About layer active.... do we want save this as today? if we put in runtime this setting will not be saved. Onion Skinning parameters would be moved to a separated "sub" struct to keep things organized... now it's not easy to know what is for onion and what not.
Author
Member

This commit 0b9a5381f9 adds the frame data and also converts it.

This commit https://projects.blender.org/blender/blender/commit/0b9a5381f94bb203d15829ac431cb29591f66764 adds the frame data and also converts it.
Author
Member

This commit c72ade033d adds the active layer functionality.

This commit https://projects.blender.org/blender/blender/commit/c72ade033d872f4eecac0f78c3c2143716a7a650 adds the active layer functionality.
Author
Member

All the conversions (except for the weights which needs to happen in CurvesGeometry) have been committed.

All the conversions (except for the weights which needs to happen in `CurvesGeometry`) have been committed.
Blender Bot added the
Status
Archived
label 2023-04-17 18:53:24 +02:00
Falk David modified the project from (deleted) to Grease Pencil 2023-06-02 18:05:58 +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#106822
No description provided.